diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 0f3897062..cc101574f 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -2,3 +2,5 @@ # Rename "refinedstorage2" to "refinedstorage" 03d02f1e07e1e6e9726404c236c3af227126ade0 +# Remove "platform" prefix from modules +328e1bfeb40342a81c375da4a5f75c9a36fe8ef8 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d929057b3..16ae93331 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -12,6 +12,7 @@ These are the most important things to know before contributing (also explained - Branch names must be formatted correctly. The format is `{category}/GH-{issue number}/{lowercase-description}`. Category must match a category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum). + You can also use `NO-ISSUE` instead of a GitHub issue number. - We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style. It is recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) or [config/intellij-code-style.xml](../config/intellij-code-style.xml) file into your @@ -47,7 +48,7 @@ Because we use merge commits when merging a PR, branch names will be part of the branch names must follow a certain standard. The format is `{category}/GH-{issue number}/{lowercase-description}` and a branch name can be maximum 50 characters of -length. +length. You can also use `NO-ISSUE` instead of a GitHub issue number. Category must match a category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum). @@ -140,7 +141,7 @@ easily set up networks for testing. ### Integration testing To test the entire chain from Minecraft to the API modules, we use integration tests. These tests are located in the -test source set of the `refinedstorage-platform-neoforge` module. +test source set of the `refinedstorage-neoforge` module. We write these integration tests as Minecraft gametests. @@ -150,8 +151,8 @@ Our [SonarQube quality gate](https://sonarcloud.io/organizations/refinedmods/qua test coverage percentage of 80%. This an aggregated percentage over all the API modules, with an exclusion for the platform modules. -> The `refinedstorage-platform-*` modules are excluded because they contain a lot of Minecraft-specific code and are -> harder to test. +> The `refinedstorage-neoforge` and `refinedstorage-fabric` modules are excluded because they contain a lot of +> Minecraft-specific code and are harder to test. ### Mutation testing @@ -260,22 +261,23 @@ The workflow takes care of the following: ## Modules -Refined Storage is split up into various modules. - -Most modules aren't dependent on Minecraft or a mod loader. Only modules that start -with `refinedstorage-platform-*` have dependencies on Minecraft. - -| Name | Use in addons | Description | -|----------------------------------|---------------|----------------------------------------------------------------------------------------------------| -| `refinedstorage-core-api` | ✔️ | Contains some utility classes and enums. | -| `refinedstorage-grid-api` | ✔️ | Contains Grid related functionality. | -| `refinedstorage-network-api` | ✔️ | Contains storage network related functionality. | -| `refinedstorage-network` | ❌ | Contains implementations of `refinedstorage-network-api`. | -| `refinedstorage-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. | -| `refinedstorage-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. | -| `refinedstorage-resource-api` | ✔️ | Contains API for handling resources. | -| `refinedstorage-storage-api` | ✔️ | Contains storage related functionality. | -| `refinedstorage-platform-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. | -| `refinedstorage-platform-fabric` | ❌ | The platform module for Fabric. This module contains Fabric specific code. | -| `refinedstorage-platform-forge` | ❌ | The platform module for Forge. This module contains Forge specific code and the integration tests. | -| `refinedstorage-platform-common` | ❌ | Common mod code. Most gameplay code is in here. | +Refined Storage is split up into various modules. Most modules aren't dependent on Minecraft or a mod loader. Only +the `refinedstorage-common`, `refinedstorage-neoforge` and `refinedstorage-fabric` modules have dependencies on +Minecraft. + +| Name | Use in addons | Description | +|-------------------------------|---------------|----------------------------------------------------------------------------------------------------------| +| `refinedstorage-core-api` | ✔️ | Contains some utility classes and enums. | +| `refinedstorage-grid-api` | ✔️ | Contains Grid related functionality. | +| `refinedstorage-network-api` | ✔️ | Contains storage network related functionality. | +| `refinedstorage-network` | ❌ | Contains implementations of `refinedstorage-network-api`. | +| `refinedstorage-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. | +| `refinedstorage-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. | +| `refinedstorage-resource-api` | ✔️ | Contains API for handling resources. | +| `refinedstorage-storage-api` | ✔️ | Contains storage related functionality. | +| `refinedstorage-common-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. | +| `refinedstorage-common` | ❌ | Common mod code. Most gameplay code is in here. | +| `refinedstorage-fabric-api` | ✔️ | Additional API for the Fabric platform. | +| `refinedstorage-fabric` | ❌ | The platform module for Fabric. This module contains Fabric specific code. | +| `refinedstorage-neoforge-api` | ✔️ | Additional API for the NeoForge platform. | +| `refinedstorage-neoforge` | ❌ | The platform module for NeoForge. This module contains NeoForge specific code and the integration tests. | diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 9e5add64b..5e6efeec0 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,6 @@ +#file: noinspection YAMLSchemaValidation,YAMLSchemaValidation blank_issues_enabled: true contact_links: - - name: Discord Community Support - url: https://discordapp.com/invite/VYzsydb - about: Please ask and answer questions here. Issues should be used for bugs and feature requests. + - name: Discord Community Support + url: https://discordapp.com/invite/VYzsydb + about: Please ask and answer questions here. Issues should be used for bugs and feature requests. diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml index 5509c3a70..66e157484 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.yml +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -2,22 +2,22 @@ name: Enhancement description: Do you have a suggestion for a new feature or improvement? Let us know. labels: [ enhancement ] body: - - type: markdown - attributes: - value: | - Provide a summary of the enhancement in the title above. - - Please follow following guidelines before proposing an enchancement: - 1) Ensure that you are running on the latest version (to ensure that the enhancement does not exist yet). - 2) Ensure that your enhancement hasn't already been posted. Please look in the closed issues as well (for enhancements that have been denied). - - We might close your issue, without explanation, if you do not follow these guidelines. - - type: textarea - id: describe - attributes: - label: Describe your enhancement - description: | - Be as detailed as possible. - Tell us how your idea should work. Why should we consider this? - validations: - required: true + - type: markdown + attributes: + value: | + Provide a summary of the enhancement in the title above. + + Please follow following guidelines before proposing an enchancement: + 1) Ensure that you are running on the latest version (to ensure that the enhancement does not exist yet). + 2) Ensure that your enhancement hasn't already been posted. Please look in the closed issues as well (for enhancements that have been denied). + + We might close your issue, without explanation, if you do not follow these guidelines. + - type: textarea + id: describe + attributes: + label: Describe your enhancement + description: | + Be as detailed as possible. + Tell us how your idea should work. Why should we consider this? + validations: + required: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dcdc4de5b..ed44fdb84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: types: [ opened, synchronize, reopened ] jobs: build: - uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.16.4 + uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.16.9 with: gametests: true secrets: inherit diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 2300f88fd..d1b6a91d4 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ on: type: string jobs: draft: - uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.16.4 + uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.16.9 with: release-type: ${{ inputs.release-type }} version-number-override: ${{ inputs.version-number-override }} diff --git a/.github/workflows/issue-for-unsupported-version.yml b/.github/workflows/issue-for-unsupported-version.yml index 7444dec88..054bce154 100644 --- a/.github/workflows/issue-for-unsupported-version.yml +++ b/.github/workflows/issue-for-unsupported-version.yml @@ -4,4 +4,4 @@ on: types: [ labeled, unlabeled, reopened ] jobs: unsupported-labeler: - uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.16.9 \ No newline at end of file diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 5cfaf1f6c..153402dbf 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -7,7 +7,7 @@ on: - closed jobs: publish-release: - uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.16.4 + uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.16.9 secrets: inherit with: project-name: 'Refined Storage' diff --git a/.github/workflows/resolved-issue-locking.yml b/.github/workflows/resolved-issue-locking.yml index ee10c5cfc..fdaa760cc 100644 --- a/.github/workflows/resolved-issue-locking.yml +++ b/.github/workflows/resolved-issue-locking.yml @@ -1,7 +1,7 @@ name: Lock resolved issues and PRs on: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * 1' jobs: lock: - uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.16.9 \ No newline at end of file diff --git a/.github/workflows/validate-branch-name.yml b/.github/workflows/validate-branch-name.yml index 161415298..944aa08bb 100644 --- a/.github/workflows/validate-branch-name.yml +++ b/.github/workflows/validate-branch-name.yml @@ -2,4 +2,4 @@ name: Validate branch name on: [ pull_request ] jobs: validate-branch-name: - uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.16.9 \ No newline at end of file diff --git a/.github/workflows/validate-changelog.yml b/.github/workflows/validate-changelog.yml index d2a2d80d7..218f86e40 100644 --- a/.github/workflows/validate-changelog.yml +++ b/.github/workflows/validate-changelog.yml @@ -4,4 +4,4 @@ on: types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ] jobs: validate-changelog: - uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.16.9 \ No newline at end of file diff --git a/.github/workflows/validate-commit-messages.yml b/.github/workflows/validate-commit-messages.yml index 449efa5d2..b70a80db3 100644 --- a/.github/workflows/validate-commit-messages.yml +++ b/.github/workflows/validate-commit-messages.yml @@ -2,4 +2,4 @@ name: Validate commit messages on: [ pull_request ] jobs: validate-commit-messages: - uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.16.9 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 766ed11d8..2574d4f82 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ eclipse/ *.iws .idea/ !.idea/dictionaries/refinedstorage.xml +!.idea/inspectionProfiles/refinedstorage.xml !.idea/icon.png out/ /bin/ diff --git a/.idea/dictionaries/refinedstorage.xml b/.idea/dictionaries/refinedstorage.xml new file mode 100644 index 000000000..5932a79c6 --- /dev/null +++ b/.idea/dictionaries/refinedstorage.xml @@ -0,0 +1,31 @@ + + + + allowlist + autocrafting + autoselected + blocklist + cullface + emissive + firstperson + frametime + gametests + glowstone + iface + leds + lefthand + modloader + modrinth + netherite + overworld + patreon + raoulvdberge + redstone + refinedarchitect + refinedmods + refinedstorage + righthand + thirdperson + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/refinedstorage.xml b/.idea/inspectionProfiles/refinedstorage.xml new file mode 100644 index 000000000..c518fa1db --- /dev/null +++ b/.idea/inspectionProfiles/refinedstorage.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b9a5ca08a..367afbe1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,20 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [2.0.0-milestone.4.5] - 2024-07-26 + +### Added + +- Ability to extract fluids from the Interface using an empty bucket or other empty fluid container. +- Support for the NeoForge config screen. + +### Fixed + +- Fixed crash when trying to export fluids into an Interface on Fabric. +- Fixed Relay configuration not being correct on NeoForge. +- Fixed crash in logs when trying to quick craft an empty result slot in the Crafting Grid. +- Fixed recipes not using silicon tag and Refined Storage silicon not being tagged properly. + ## [2.0.0-milestone.4.4] - 2024-07-10 ## [2.0.0-milestone.4.3] - 2024-07-06 @@ -21,7 +35,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Fixed not being able to ghost drag resources from recipe viewers into filter slots on NeoForge. - Fixed extra dark backgrounds due to drawing background on GUIs twice. - Fixed Configuration Card not being able to transfer upgrades for the Wireless Transmitter. -- Fixed upgrade inventories not maintaining order after reloading. Upgrade inventories from the milestone 4.2 are incompatible and will be empty. +- Fixed upgrade inventories not maintaining order after reloading. Upgrade inventories from the milestone 4.2 are + incompatible and will be empty. - Fixed Wireless Transmitter not dropping upgrades when breaking block. ## [2.0.0-milestone.4.2] - 2024-07-06 @@ -43,7 +58,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Changed -- The mod ID has been changed from "refinedstorage2" to "refinedstorage". Worlds that used milestone 3 on Minecraft 1.20.4 are no longer compatible. +- The mod ID has been changed from "refinedstorage2" to "refinedstorage". Worlds that used milestone 3 on Minecraft + 1.20.4 are no longer compatible. - Recipes now use common tag conventions from NeoForge and Fabric. ### Fixed @@ -108,9 +124,14 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Changed - The Detector, Network Receiver, Network Transmitter and Security Manager will now always connect regardless of color. -- The Relay now has a "pass-through" mode. By default, pass-through is on, which means that when the Relay is active, the network signal from the input network will be passed through as-is to the output side. -- When the "pass-through" mode on the Relay is off, the network signal from the input network will no longer be passed through as-is to the output side, but you can choose to pass the energy buffer, security settings or (specific) storage resources of the input network to the output network. -- When using the Relay when "pass-through" mode is off, and when passing all storage resources or specific storage resources, you can choose the filter mode, whether fuzzy mode is enabled, the access mode and the priority of the storage exposed to the output network. +- The Relay now has a "pass-through" mode. By default, pass-through is on, which means that when the Relay is active, + the network signal from the input network will be passed through as-is to the output side. +- When the "pass-through" mode on the Relay is off, the network signal from the input network will no longer be passed + through as-is to the output side, but you can choose to pass the energy buffer, security settings or (specific) + storage resources of the input network to the output network. +- When using the Relay when "pass-through" mode is off, and when passing all storage resources or specific storage + resources, you can choose the filter mode, whether fuzzy mode is enabled, the access mode and the priority of the + storage exposed to the output network. ### Fixed @@ -131,8 +152,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - The Security Card can be bound to other (currently online) players via its GUI. - The binding of a Security Card can now be cleared. - The Security Card tooltip and GUI now show whether the permission has been touched/changed in any way. -- As soon as a Security Manager is placed, the storage network will be locked down by default. Start adding Security Cards to allow or deny specific access to players. -- To not lock the entire network by default for players who do not have a matching Security Card, a Fallback Security Card can be used to configure this behavior. +- As soon as a Security Manager is placed, the storage network will be locked down by default. Start adding Security + Cards to allow or deny specific access to players. +- To not lock the entire network by default for players who do not have a matching Security Card, a Fallback Security + Card can be used to configure this behavior. - Smooth scrolling, screen size and max row stretch are no longer Grid-specific settings, but are now global settings. ### Fixed @@ -185,7 +208,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Changed -- The Network Transmitter now goes into an "errored" state if there is no connection (anymore) with the Network Receiver (due to chunk unloading for example). +- The Network Transmitter now goes into an "errored" state if there is no connection (anymore) with the Network + Receiver (due to chunk unloading for example). - The Network Transmitter will actively try to reconnect with the Network Receiver if connection is lost. ### Fixed @@ -266,7 +290,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Constructor - Regulator Upgrade -- Filter slot hints that show which resource will be put in a filter slot and what the effect of the filter is on the device. +- Filter slot hints that show which resource will be put in a filter slot and what the effect of the filter is on the + device. - Grid slot hints that show which resource will be inserted or extracted in a Grid. - Help information to the side buttons by pressing SHIFT. - Help information on items. @@ -278,8 +303,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - The Constructor crafting recipe now takes 2 diamonds instead of 2 redstone. - You can now select a "Scheduling mode" in the Constructor: first available, round robin, random. - The "applicable upgrades" tooltip on the upgrade slot tooltip now shows the upgrade items in item form. -- The Regulator Upgrade now works in an Importer as well. It will only keep importing until the configured amount is reached. -- The Regulator Upgrade now needs to be configured separately, by using the upgrade. It can no longer be configured in the device GUI itself. +- The Regulator Upgrade now works in an Importer as well. It will only keep importing until the configured amount is + reached. +- The Regulator Upgrade now needs to be configured separately, by using the upgrade. It can no longer be configured in + the device GUI itself. ### Fixed @@ -664,7 +691,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - The Grid can now use smooth scrolling. - The Grid now has syntax highlighting for the search query. -[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.4...HEAD +[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.5...HEAD + +[2.0.0-milestone.4.5]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.4...v2.0.0-milestone.4.5 [2.0.0-milestone.4.4]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.3...v2.0.0-milestone.4.4 diff --git a/README.md b/README.md index c7f8db9c9..72f6f77af 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ +
Refined Storage logo

Refined Storage 2

Refined Storage is a mass storage mod for Minecraft that offers the player a network-based storage system, allowing them to store items and fluids on a massively expandable device network.

- [![Build Status](https://github.com/refinedmods/refinedstorage2/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/refinedmods/refinedstorage2/actions/workflows/build.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=coverage)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Crowdin](https://badges.crowdin.net/refined-storage-2/localized.svg)](https://crowdin.com/project/refined-storage-2) [![Downloads on CurseForge](http://cf.way2muchnoise.eu/full_243076_downloads.svg)](http://minecraft.curseforge.com/projects/refined-storage) [![Downloads on Modrinth](https://img.shields.io/modrinth/dt/refined-storage?logo=modrinth)](https://modrinth.com/mod/refined-storage) [![Discord](https://img.shields.io/discord/342942776494653441)](https://discordapp.com/invite/VYzsydb) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md) +[![Build Status](https://github.com/refinedmods/refinedstorage2/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/refinedmods/refinedstorage2/actions/workflows/build.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=coverage)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Crowdin](https://badges.crowdin.net/refined-storage-2/localized.svg)](https://crowdin.com/project/refined-storage-2) [![Downloads on CurseForge](http://cf.way2muchnoise.eu/full_243076_downloads.svg)](http://minecraft.curseforge.com/projects/refined-storage) [![Downloads on Modrinth](https://img.shields.io/modrinth/dt/refined-storage?logo=modrinth)](https://modrinth.com/mod/refined-storage) [![Discord](https://img.shields.io/discord/342942776494653441)](https://discordapp.com/invite/VYzsydb) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md)
## About @@ -15,7 +16,7 @@ access the inventories of many devices through a single unified GUI. This mod not only adds storage solutions, but also devices that can be used to manipulate items and blocks in the world and from within the system, such as importers, exporters, constructors, destructors, and more! There are also devices in -this mod that allow the player to setup auto-crafting, allowing the crafting of complex recipes in a few simple clicks. +this mod that allow the player to set up auto-crafting, allowing the crafting of complex recipes in a few simple clicks. ## Links diff --git a/build.gradle.kts b/build.gradle.kts index cf817e367..d99f52400 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import org.sonarqube.gradle.SonarExtension + plugins { id("refinedarchitect.root") id("refinedarchitect.base") @@ -10,3 +12,21 @@ refinedarchitect { subprojects { group = "com.refinedmods.refinedstorage" } + +project.extensions.getByType().apply { + properties { + property( + "sonar.coverage.exclusions", + "refinedstorage-neoforge-api/**/*,refinedstorage-neoforge/**/*,refinedstorage-fabric-api/**/*,refinedstorage-fabric/**/*,refinedstorage-common/**/*,refinedstorage-common-api/**/*" + ) + } +} + +allprojects { + apply(plugin = "maven-publish") + publishing { + repositories { + mavenLocal() + } + } +} \ No newline at end of file diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 0f886cd2a..49d68cdb1 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -2,6 +2,7 @@ + diff --git a/config/intellij-code-style.xml b/config/intellij-code-style.xml index 49b79c2e9..b36a21484 100644 --- a/config/intellij-code-style.xml +++ b/config/intellij-code-style.xml @@ -1,66 +1,66 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/crowdin.yml b/crowdin.yml index 5bb3deca0..37f9d07bb 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -6,8 +6,8 @@ base_path: . pull_request_labels: - skip-changelog files: - - source: /refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/en_us.json - translation: /refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/%locale_with_underscore%.json + - source: /refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json + translation: /refinedstorage-common/src/main/resources/assets/refinedstorage/lang/%locale_with_underscore%.json languages_mapping: locale_with_underscore: af: af_za diff --git a/doc/architecture/decision/001-multi-loader-architecture.md b/doc/architecture/decision/001-multi-loader-architecture.md index f8a43dd89..5f38b13d4 100644 --- a/doc/architecture/decision/001-multi-loader-architecture.md +++ b/doc/architecture/decision/001-multi-loader-architecture.md @@ -19,7 +19,7 @@ There will be a common module, and most code should reside in there. The modload reserved for platform specific functionality, like registration, networking, etc. -The module naming follows the standard of `refinedstorage-platform-{name}`. +The module naming follows the standard of `refinedstorage-{modloader-name}`. ## Consequences diff --git a/doc/architecture/decision/003-the-platform-api-module.md b/doc/architecture/decision/003-the-platform-api-module.md deleted file mode 100644 index d335110af..000000000 --- a/doc/architecture/decision/003-the-platform-api-module.md +++ /dev/null @@ -1,39 +0,0 @@ -# 3. The platform API module - -Date: 2021-12-29 - -## Status - -Accepted - -## Context - -Now that we have platform modules (one for each modloader, and a common module) [[1]](#1) and API -modules [[2]](#2), we still need a way for addons to integrate with the mod. - -Doing so via the common module would be detrimental as it would expose too much code to addons (just like it did in -Refined Storage 1). - -## Decision - -Refined Storage will have a modloader-neutral (just like the common module) platform API module which addon mods can -use to integrate with Refined Storage. - -Moreover, Refined Storage itself will use this platform API module. - -The module is named `refinedstorage-platform-api`. - -## Consequences - -By offering a dedicated platform API module we can much more tightly control API surface. - -The platform API module is platform-neutral so addons can decide what modloader they target. Moreover, it saves us time -because we don't have to maintain different platform APIs per modloader. - -However, if addon mods want to support multiple modloaders, they'll have to create their own abstractions. - -## References - -- [1] See [1. Multi-loader architecture](001-multi-loader-architecture.md) -- [1] See [2. API modules](002-api-modules.md) -- https://github.com/refinedmods/refinedstorage2/commit/64e97fd170185d3d55a60879db7fca2134ae6dd0 \ No newline at end of file diff --git a/doc/architecture/decision/003-the-platform-api-modules.md b/doc/architecture/decision/003-the-platform-api-modules.md new file mode 100644 index 000000000..77c2bfb87 --- /dev/null +++ b/doc/architecture/decision/003-the-platform-api-modules.md @@ -0,0 +1,32 @@ +# 3. The platform API modules + +Date: 2021-12-29 + +## Status + +Accepted + +## Context + +Now that we have platform modules (one for each modloader, and a common module) [[1]](#1) and API +modules [[2]](#2), we still need a way for addons to integrate with the mod. + +Doing so via the common module would be detrimental as it would expose too much code to addons (just like it did in +Refined Storage 1). + +## Decision + +Refined Storage will have a modloader-neutral (just like the common module) platform API module which addon mods can use +to integrate with Refined Storage: `refinedstorage-common-api`. + +For modloader specific integrations, we'll have a `refinedstorage-{modloader-name}-api` module. + +## Consequences + +By offering dedicated platform API modules we can much more tightly control API surface. + +## References + +- [1] See [1. Multi-loader architecture](001-multi-loader-architecture.md) +- [1] See [2. API modules](002-api-modules.md) +- https://github.com/refinedmods/refinedstorage2/commit/64e97fd170185d3d55a60879db7fca2134ae6dd0 \ No newline at end of file diff --git a/doc/architecture/decision/004-coverage-requirements.md b/doc/architecture/decision/004-coverage-requirements.md index d7679dda5..8d43c9a22 100644 --- a/doc/architecture/decision/004-coverage-requirements.md +++ b/doc/architecture/decision/004-coverage-requirements.md @@ -13,15 +13,11 @@ Since we are writing more unit tests with our API modules [[1]](#1) we need to e ## Decision We will differentiate between platform modules [[2]](#2) and API modules [[1]](#1). The reason for this is that it's -difficult to test -Minecraft code properly. +difficult to test Minecraft code properly. The platform modules will be tested by Minecraft gametests. Luckily, since our most important (business-logic) code resides in the API modules [[1]](#1) we can put our testing focus there and establish coverage requirements. -However, sometimes it is still advised to write a test for platform code, even if there are no coverage requirements for -it. For that reason, the `refinedstorage-platform-test` module exists, to provide helpers to deal with Minecraft code. - ## Consequences For API modules, this means that: diff --git a/doc/architecture/decision/007-refined-architect.md b/doc/architecture/decision/007-refined-architect.md index 032dd55e5..74e5cc19f 100644 --- a/doc/architecture/decision/007-refined-architect.md +++ b/doc/architecture/decision/007-refined-architect.md @@ -8,13 +8,17 @@ Accepted ## Context -For Refined Storage, we want to build a large ecosystem of addon mods. However, all those addon mods, and even unrelated mods managed by Refined Mods, have a lot of duplication in terms of build infrastructure, GitHub Actions workflows and Gradle setup code. +For Refined Storage, we want to build a large ecosystem of addon mods. However, all those addon mods, and even unrelated +mods managed by Refined Mods, have a lot of duplication in terms of build infrastructure, GitHub Actions workflows and +Gradle setup code. -This duplication makes it difficult to maintain the soon-to-be suite of mods as a whole, especially if we have to upgrade Minecraft. +This duplication makes it difficult to maintain the soon-to-be suite of mods as a whole, especially if we have to +upgrade Minecraft. ## Decision -We introduce [Refined Architect](https://github.com/refinedmods/refinedarchitect): a project that is used by all the mods of Refined Mods. +We introduce [Refined Architect](https://github.com/refinedmods/refinedarchitect): a project that is used by all the +mods of Refined Mods. It contains GitHub workflows, version management and Gradle helpers to help making (cross-platform) mods easier. diff --git a/doc/architecture/decision/008-versioning.md b/doc/architecture/decision/008-versioning.md index 605af230a..e971f27a3 100644 --- a/doc/architecture/decision/008-versioning.md +++ b/doc/architecture/decision/008-versioning.md @@ -23,7 +23,8 @@ We choose [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### How do we store versioning information? -The code doesn't contain version metadata: `build.gradle` specifies a version of `0.0.0` (via [Refined Architect](https://github.com/refinedmods/refinedarchitect)). +The code doesn't contain version metadata: `build.gradle` specifies a version of `0.0.0` ( +via [Refined Architect](https://github.com/refinedmods/refinedarchitect)). The versioning information is entirely contained in Git by using tags. ### When do we determine the next version number? diff --git a/doc/architecture/decision/009-package-by-feature.md b/doc/architecture/decision/009-package-by-feature.md index c3b4dd125..40e14e839 100644 --- a/doc/architecture/decision/009-package-by-feature.md +++ b/doc/architecture/decision/009-package-by-feature.md @@ -8,7 +8,8 @@ Accepted ## Context -Refined Storage adds a lot of content. For ease of maintenance, we need to think about how we are going to segment our packages. +Refined Storage adds a lot of content. For ease of maintenance, we need to think about how we are going to segment our +packages. ## Decision @@ -22,4 +23,5 @@ Implementation provided in [[1]](#1). ## References -- [1] See [implementation](https://github.com/refinedmods/refinedstorage2/commit/d109b09be863c6ea71138091b6ce66c2a573546e) +- [1] + See [implementation](https://github.com/refinedmods/refinedstorage2/commit/d109b09be863c6ea71138091b6ce66c2a573546e) diff --git a/doc/architecture/decision/010-shared-storage.md b/doc/architecture/decision/010-shared-storage.md index 971450fd9..6d251a443 100644 --- a/doc/architecture/decision/010-shared-storage.md +++ b/doc/architecture/decision/010-shared-storage.md @@ -8,36 +8,37 @@ Accepted ## Context -Refined Storage has the concept of a storage channel. A storage channel is the highest-level storage of a network. It +Refined Storage has the concept of a root storage. A root storage is the highest-level storage of a network. It is used by other network devices to interact with the storage network. As Refined Storage supports multiple resource types, we must decide how we partition those resource types. ## Decision -At the lowest level, we allow mixed resource types within a storage. Since a storage channel is a storage as well, this -means that the highest level, the storage channel, will allow mixed resource types as well. +At the lowest level, we allow mixed resource types within a storage. Since a root storage is a storage as well, this +means that the highest level, the root storage, will allow mixed resource types as well. We don't partition storages by resource type because: - This implies the use of a generic type on the `Storage` class, which becomes cumbersome quickly when we don't know the resource type at runtime (relying on unchecked and rawtypes operations). -- There's no real technical reason to partition storages by resource type. We can have a single storage channel with +- There's no real technical reason to partition storages by resource type. We can have a single root storage with mixed resource types. -- If there is a single storage channel, blocks like the Disk Drive don't need to maintain a storage per storage channel. - They can expose one storage for all the storage channels, making it easier to reason about. +- If there is a single root storage, blocks like the Disk Drive don't need to maintain a storage per root storage. + They can just expose one storage, making it easier to reason about. Implementation provided in [[1]](#1). ## Consequences - We do remove some compile time safety because we won't have a generic on `Storage`. However: - 1) It's a natural consequence if we want to allow mixed storage channels. + 1) It's a natural consequence if we want to allow mixed root storages. 2) The compile time safety was mostly gone anyway already due to all the unchecked and raw types operations. - We introduce `ResourceKey` to provide some level of safety (not using `Object`). -- We don't need a storage channel type abstraction (there is only a single storage channel) and move some logic +- We don't need a "storage channel" type abstraction (there is only a single root storage) and move some logic to `ResourceKey`. ## References -- [1] See [implementation](https://github.com/refinedmods/refinedstorage2/commit/1fd63d17417e387d427b2e018a93df89e31edc0f) +- [1] + See [implementation](https://github.com/refinedmods/refinedstorage2/commit/1fd63d17417e387d427b2e018a93df89e31edc0f) diff --git a/gradle.properties b/gradle.properties index a8d260d7d..714a71d9d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,3 @@ +refinedarchitectVersion=0.16.9 # Gradle org.gradle.jvmargs=-Xmx1G diff --git a/refinedstorage-common-api/build.gradle.kts b/refinedstorage-common-api/build.gradle.kts new file mode 100644 index 000000000..14141ebd5 --- /dev/null +++ b/refinedstorage-common-api/build.gradle.kts @@ -0,0 +1,30 @@ +plugins { + id("refinedarchitect.common") +} + +refinedarchitect { + common() + testing() + javadoc() + publishing { + maven = true + } +} + +base { + archivesName.set("refinedstorage-common-api") +} + +dependencies { + api(libs.apiguardian) + api(project(":refinedstorage-core-api")) + api(project(":refinedstorage-storage-api")) + api(project(":refinedstorage-resource-api")) + api(project(":refinedstorage-network-api")) + api(project(":refinedstorage-grid-api")) + testImplementation(libs.junit.api) + testImplementation(libs.junit.params) + testImplementation(libs.assertj) + testImplementation(libs.equalsverifier) + testRuntimeOnly(libs.junit.engine) +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApi.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApi.java new file mode 100644 index 000000000..4afc37e7b --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApi.java @@ -0,0 +1,203 @@ +package com.refinedmods.refinedstorage.common.api; + +import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.NetworkComponent; +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.api.network.node.NetworkNode; +import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHint; +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHints; +import com.refinedmods.refinedstorage.common.api.grid.GridSynchronizer; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategyFactory; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategyFactory; +import com.refinedmods.refinedstorage.common.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItemHelper; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.api.storage.StorageType; +import com.refinedmods.refinedstorage.common.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.support.energy.EnergyItemHelper; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemHelper; +import com.refinedmods.refinedstorage.common.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage.common.api.support.resource.RecipeModIngredientConverter; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainerInsertStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceProvider; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage.common.api.wirelesstransmitter.WirelessTransmitterRangeModifier; + +import java.util.Collection; +import java.util.Optional; +import java.util.Set; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") +public interface RefinedStorageApi { + RefinedStorageApi INSTANCE = new RefinedStorageApiProxy(); + + PlatformRegistry getStorageTypeRegistry(); + + StorageRepository getClientStorageRepository(); + + StorageRepository getStorageRepository(Level level); + + StorageContainerItemHelper getStorageContainerItemHelper(); + + PlatformRegistry getResourceTypeRegistry(); + + PlatformRegistry getImporterTransferStrategyRegistry(); + + PlatformRegistry getExporterTransferStrategyRegistry(); + + void addExternalStorageProviderFactory(PlatformExternalStorageProviderFactory factory); + + Collection getExternalStorageProviderFactories(); + + Collection getDestructorStrategyFactories(); + + void addDestructorStrategyFactory(DestructorStrategyFactory factory); + + Collection getConstructorStrategyFactories(); + + void addConstructorStrategyFactory(ConstructorStrategyFactory factory); + + void addStorageMonitorExtractionStrategy(StorageMonitorExtractionStrategy strategy); + + StorageMonitorExtractionStrategy getStorageMonitorExtractionStrategy(); + + void addStorageMonitorInsertionStrategy(StorageMonitorInsertionStrategy strategy); + + StorageMonitorInsertionStrategy getStorageMonitorInsertionStrategy(); + + ComponentMapFactory getNetworkComponentMapFactory(); + + PlatformRegistry getGridSynchronizerRegistry(); + + UpgradeRegistry getUpgradeRegistry(); + + NetworkNodeContainerProvider createNetworkNodeContainerProvider(); + + InWorldNetworkNodeContainer.Builder createNetworkNodeContainer(BlockEntity blockEntity, NetworkNode networkNode); + + void initializeNetworkNodeContainer(InWorldNetworkNodeContainer container, + @Nullable Level level, + @Nullable Runnable callback); + + void removeNetworkNodeContainer(InWorldNetworkNodeContainer container, @Nullable Level level); + + void updateNetworkNodeContainer(InWorldNetworkNodeContainer container, @Nullable Level level); + + GridInsertionStrategy createGridInsertionStrategy(AbstractContainerMenu containerMenu, + ServerPlayer player, + Grid grid); + + void addGridInsertionStrategyFactory(GridInsertionStrategyFactory insertionStrategyFactory); + + void addResourceContainerInsertStrategy(ResourceContainerInsertStrategy strategy); + + Collection getResourceContainerInsertStrategies(); + + void addAlternativeGridInsertionHint(GridInsertionHint hint); + + GridInsertionHints getGridInsertionHints(); + + GridExtractionStrategy createGridExtractionStrategy(AbstractContainerMenu containerMenu, + ServerPlayer player, + Grid grid); + + void addGridExtractionStrategyFactory(GridExtractionStrategyFactory extractionStrategyFactory); + + GridScrollingStrategy createGridScrollingStrategy(AbstractContainerMenu containerMenu, + ServerPlayer player, + Grid grid); + + void addGridScrollingStrategyFactory(GridScrollingStrategyFactory scrollingStrategyFactory); + + void addResourceFactory(ResourceFactory factory); + + ResourceFactory getItemResourceFactory(); + + StorageType getItemStorageType(); + + ResourceFactory getFluidResourceFactory(); + + StorageType getFluidStorageType(); + + Set getAlternativeResourceFactories(); + + void registerResourceRendering(Class resourceClass, ResourceRendering rendering); + + ResourceRendering getResourceRendering(ResourceKey resource); + + void addIngredientConverter(RecipeModIngredientConverter converter); + + RecipeModIngredientConverter getIngredientConverter(); + + void addWirelessTransmitterRangeModifier(WirelessTransmitterRangeModifier rangeModifier); + + WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier(); + + Optional getEnergyStorage(ItemStack stack); + + EnergyItemHelper getEnergyItemHelper(); + + EnergyStorage asItemEnergyStorage(EnergyStorage energyStorage, ItemStack stack); + + EnergyStorage asBlockItemEnergyStorage( + EnergyStorage energyStorage, + ItemStack stack, + BlockEntityType blockEntityType + ); + + NetworkItemHelper getNetworkItemHelper(); + + PlatformRegistry getSlotReferenceFactoryRegistry(); + + void addSlotReferenceProvider(SlotReferenceProvider slotReferenceProvider); + + SlotReference createInventorySlotReference(Player player, InteractionHand hand); + + void useSlotReferencedItem(Player player, Item... items); + + PlatformRegistry getPermissionRegistry(); + + SecurityPolicy createDefaultSecurityPolicy(); + + void sendNoPermissionToOpenMessage(ServerPlayer player, Component target); + + void sendNoPermissionMessage(ServerPlayer player, Component message); + + boolean canPlaceNetworkNode(ServerPlayer player, Level level, BlockPos pos, BlockState state); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApiProxy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApiProxy.java new file mode 100644 index 000000000..9f9553678 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApiProxy.java @@ -0,0 +1,404 @@ +package com.refinedmods.refinedstorage.common.api; + +import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.NetworkComponent; +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.api.network.node.NetworkNode; +import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHint; +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHints; +import com.refinedmods.refinedstorage.common.api.grid.GridSynchronizer; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategyFactory; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategyFactory; +import com.refinedmods.refinedstorage.common.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItemHelper; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.api.storage.StorageType; +import com.refinedmods.refinedstorage.common.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.support.energy.EnergyItemHelper; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemHelper; +import com.refinedmods.refinedstorage.common.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage.common.api.support.resource.RecipeModIngredientConverter; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainerInsertStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceProvider; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage.common.api.wirelesstransmitter.WirelessTransmitterRangeModifier; + +import java.util.Collection; +import java.util.Optional; +import java.util.Set; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +public class RefinedStorageApiProxy implements RefinedStorageApi { + @Nullable + private RefinedStorageApi delegate; + + public void setDelegate(final RefinedStorageApi delegate) { + if (this.delegate != null) { + throw new IllegalStateException("API already injected"); + } + this.delegate = delegate; + } + + @Override + public PlatformRegistry getStorageTypeRegistry() { + return ensureLoaded().getStorageTypeRegistry(); + } + + @Override + public StorageRepository getClientStorageRepository() { + return ensureLoaded().getClientStorageRepository(); + } + + @Override + public StorageRepository getStorageRepository(final Level level) { + return ensureLoaded().getStorageRepository(level); + } + + @Override + public StorageContainerItemHelper getStorageContainerItemHelper() { + return ensureLoaded().getStorageContainerItemHelper(); + } + + @Override + public PlatformRegistry getResourceTypeRegistry() { + return ensureLoaded().getResourceTypeRegistry(); + } + + @Override + public PlatformRegistry getImporterTransferStrategyRegistry() { + return ensureLoaded().getImporterTransferStrategyRegistry(); + } + + @Override + public PlatformRegistry getExporterTransferStrategyRegistry() { + return ensureLoaded().getExporterTransferStrategyRegistry(); + } + + @Override + public void addExternalStorageProviderFactory(final PlatformExternalStorageProviderFactory factory) { + ensureLoaded().addExternalStorageProviderFactory(factory); + } + + @Override + public Collection getExternalStorageProviderFactories() { + return ensureLoaded().getExternalStorageProviderFactories(); + } + + @Override + public Collection getDestructorStrategyFactories() { + return ensureLoaded().getDestructorStrategyFactories(); + } + + @Override + public void addDestructorStrategyFactory(final DestructorStrategyFactory factory) { + ensureLoaded().addDestructorStrategyFactory(factory); + } + + @Override + public Collection getConstructorStrategyFactories() { + return ensureLoaded().getConstructorStrategyFactories(); + } + + @Override + public void addConstructorStrategyFactory(final ConstructorStrategyFactory factory) { + ensureLoaded().addConstructorStrategyFactory(factory); + } + + @Override + public void addStorageMonitorExtractionStrategy(final StorageMonitorExtractionStrategy strategy) { + ensureLoaded().addStorageMonitorExtractionStrategy(strategy); + } + + @Override + public StorageMonitorExtractionStrategy getStorageMonitorExtractionStrategy() { + return ensureLoaded().getStorageMonitorExtractionStrategy(); + } + + @Override + public void addStorageMonitorInsertionStrategy(final StorageMonitorInsertionStrategy strategy) { + ensureLoaded().addStorageMonitorInsertionStrategy(strategy); + } + + @Override + public StorageMonitorInsertionStrategy getStorageMonitorInsertionStrategy() { + return ensureLoaded().getStorageMonitorInsertionStrategy(); + } + + @Override + public ComponentMapFactory getNetworkComponentMapFactory() { + return ensureLoaded().getNetworkComponentMapFactory(); + } + + @Override + public PlatformRegistry getGridSynchronizerRegistry() { + return ensureLoaded().getGridSynchronizerRegistry(); + } + + @Override + public UpgradeRegistry getUpgradeRegistry() { + return ensureLoaded().getUpgradeRegistry(); + } + + @Override + public NetworkNodeContainerProvider createNetworkNodeContainerProvider() { + return ensureLoaded().createNetworkNodeContainerProvider(); + } + + @Override + public InWorldNetworkNodeContainer.Builder createNetworkNodeContainer(final BlockEntity blockEntity, + final NetworkNode networkNode) { + return ensureLoaded().createNetworkNodeContainer(blockEntity, networkNode); + } + + @Override + public void initializeNetworkNodeContainer(final InWorldNetworkNodeContainer container, + @Nullable final Level level, + @Nullable final Runnable callback) { + ensureLoaded().initializeNetworkNodeContainer(container, level, callback); + } + + @Override + public void removeNetworkNodeContainer(final InWorldNetworkNodeContainer container, + @Nullable final Level level) { + ensureLoaded().removeNetworkNodeContainer(container, level); + } + + @Override + public void updateNetworkNodeContainer(final InWorldNetworkNodeContainer container, + @Nullable final Level level) { + ensureLoaded().updateNetworkNodeContainer(container, level); + } + + @Override + public GridInsertionStrategy createGridInsertionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + return ensureLoaded().createGridInsertionStrategy(containerMenu, player, grid); + } + + @Override + public void addGridInsertionStrategyFactory(final GridInsertionStrategyFactory insertionStrategyFactory) { + ensureLoaded().addGridInsertionStrategyFactory(insertionStrategyFactory); + } + + @Override + public void addResourceContainerInsertStrategy(final ResourceContainerInsertStrategy strategy) { + ensureLoaded().addResourceContainerInsertStrategy(strategy); + } + + @Override + public Collection getResourceContainerInsertStrategies() { + return ensureLoaded().getResourceContainerInsertStrategies(); + } + + @Override + public void addAlternativeGridInsertionHint(final GridInsertionHint hint) { + ensureLoaded().addAlternativeGridInsertionHint(hint); + } + + @Override + public GridInsertionHints getGridInsertionHints() { + return ensureLoaded().getGridInsertionHints(); + } + + @Override + public GridExtractionStrategy createGridExtractionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + return ensureLoaded().createGridExtractionStrategy(containerMenu, player, grid); + } + + @Override + public void addGridExtractionStrategyFactory(final GridExtractionStrategyFactory extractionStrategyFactory) { + ensureLoaded().addGridExtractionStrategyFactory(extractionStrategyFactory); + } + + @Override + public GridScrollingStrategy createGridScrollingStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + return ensureLoaded().createGridScrollingStrategy(containerMenu, player, grid); + } + + @Override + public void addGridScrollingStrategyFactory(final GridScrollingStrategyFactory scrollingStrategyFactory) { + ensureLoaded().addGridScrollingStrategyFactory(scrollingStrategyFactory); + } + + @Override + public void addResourceFactory(final ResourceFactory factory) { + ensureLoaded().addResourceFactory(factory); + } + + @Override + public ResourceFactory getItemResourceFactory() { + return ensureLoaded().getItemResourceFactory(); + } + + @Override + public StorageType getItemStorageType() { + return ensureLoaded().getItemStorageType(); + } + + @Override + public ResourceFactory getFluidResourceFactory() { + return ensureLoaded().getFluidResourceFactory(); + } + + @Override + public StorageType getFluidStorageType() { + return ensureLoaded().getFluidStorageType(); + } + + @Override + public Set getAlternativeResourceFactories() { + return ensureLoaded().getAlternativeResourceFactories(); + } + + @Override + public void registerResourceRendering(final Class resourceClass, + final ResourceRendering rendering) { + ensureLoaded().registerResourceRendering(resourceClass, rendering); + } + + @Override + public ResourceRendering getResourceRendering(final ResourceKey resource) { + return ensureLoaded().getResourceRendering(resource); + } + + @Override + public void addIngredientConverter(final RecipeModIngredientConverter converter) { + ensureLoaded().addIngredientConverter(converter); + } + + @Override + public RecipeModIngredientConverter getIngredientConverter() { + return ensureLoaded().getIngredientConverter(); + } + + @Override + public void addWirelessTransmitterRangeModifier(final WirelessTransmitterRangeModifier rangeModifier) { + ensureLoaded().addWirelessTransmitterRangeModifier(rangeModifier); + } + + @Override + public WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier() { + return ensureLoaded().getWirelessTransmitterRangeModifier(); + } + + @Override + public Optional getEnergyStorage(final ItemStack stack) { + return ensureLoaded().getEnergyStorage(stack); + } + + @Override + public EnergyItemHelper getEnergyItemHelper() { + return ensureLoaded().getEnergyItemHelper(); + } + + @Override + public EnergyStorage asItemEnergyStorage(final EnergyStorage energyStorage, final ItemStack stack) { + return ensureLoaded().asItemEnergyStorage(energyStorage, stack); + } + + @Override + public EnergyStorage asBlockItemEnergyStorage(final EnergyStorage energyStorage, + final ItemStack stack, + final BlockEntityType blockEntityType) { + return ensureLoaded().asBlockItemEnergyStorage(energyStorage, stack, blockEntityType); + } + + @Override + public NetworkItemHelper getNetworkItemHelper() { + return ensureLoaded().getNetworkItemHelper(); + } + + @Override + public PlatformRegistry getSlotReferenceFactoryRegistry() { + return ensureLoaded().getSlotReferenceFactoryRegistry(); + } + + @Override + public void addSlotReferenceProvider(final SlotReferenceProvider slotReferenceProvider) { + ensureLoaded().addSlotReferenceProvider(slotReferenceProvider); + } + + @Override + public SlotReference createInventorySlotReference(final Player player, final InteractionHand hand) { + return ensureLoaded().createInventorySlotReference(player, hand); + } + + @Override + public void useSlotReferencedItem(final Player player, final Item... items) { + ensureLoaded().useSlotReferencedItem(player, items); + } + + @Override + public PlatformRegistry getPermissionRegistry() { + return ensureLoaded().getPermissionRegistry(); + } + + @Override + public SecurityPolicy createDefaultSecurityPolicy() { + return ensureLoaded().createDefaultSecurityPolicy(); + } + + @Override + public void sendNoPermissionToOpenMessage(final ServerPlayer player, final Component target) { + ensureLoaded().sendNoPermissionToOpenMessage(player, target); + } + + @Override + public void sendNoPermissionMessage(final ServerPlayer player, final Component message) { + ensureLoaded().sendNoPermissionMessage(player, message); + } + + @Override + public boolean canPlaceNetworkNode(final ServerPlayer player, + final Level level, + final BlockPos pos, + final BlockState state) { + return ensureLoaded().canPlaceNetworkNode(player, level, pos, state); + } + + private RefinedStorageApi ensureLoaded() { + if (delegate == null) { + throw new IllegalStateException("API not loaded yet"); + } + return delegate; + } +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/configurationcard/ConfigurationCardTarget.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/configurationcard/ConfigurationCardTarget.java similarity index 91% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/configurationcard/ConfigurationCardTarget.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/configurationcard/ConfigurationCardTarget.java index ac995ccef..efdacae3c 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/configurationcard/ConfigurationCardTarget.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/configurationcard/ConfigurationCardTarget.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.configurationcard; +package com.refinedmods.refinedstorage.common.api.configurationcard; import java.util.Collections; import java.util.List; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/configurationcard/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/configurationcard/package-info.java new file mode 100644 index 000000000..a651883e9 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/configurationcard/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.configurationcard; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/ConstructorStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/ConstructorStrategy.java new file mode 100644 index 000000000..b6ba506cb --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/ConstructorStrategy.java @@ -0,0 +1,14 @@ +package com.refinedmods.refinedstorage.common.api.constructordestructor; + +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.Actor; + +import net.minecraft.world.entity.player.Player; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.11") +@FunctionalInterface +public interface ConstructorStrategy { + boolean apply(ResourceKey resource, Actor actor, Player player, Network network); +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/ConstructorStrategyFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/ConstructorStrategyFactory.java similarity index 82% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/ConstructorStrategyFactory.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/ConstructorStrategyFactory.java index fbeea71de..3b211168e 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/ConstructorStrategyFactory.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/ConstructorStrategyFactory.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.api.constructordestructor; +package com.refinedmods.refinedstorage.common.api.constructordestructor; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; import java.util.Optional; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/DestructorStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/DestructorStrategy.java new file mode 100644 index 000000000..a3ba6a2b7 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/DestructorStrategy.java @@ -0,0 +1,16 @@ +package com.refinedmods.refinedstorage.common.api.constructordestructor; + +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.resource.filter.Filter; +import com.refinedmods.refinedstorage.api.storage.Actor; + +import java.util.function.Supplier; + +import net.minecraft.world.entity.player.Player; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.10") +@FunctionalInterface +public interface DestructorStrategy { + boolean apply(Filter filter, Actor actor, Supplier networkSupplier, Player player); +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/DestructorStrategyFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/DestructorStrategyFactory.java similarity index 82% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/DestructorStrategyFactory.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/DestructorStrategyFactory.java index 02726b09e..c77471c2a 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/DestructorStrategyFactory.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/DestructorStrategyFactory.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.api.constructordestructor; +package com.refinedmods.refinedstorage.common.api.constructordestructor; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; import java.util.Optional; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/package-info.java new file mode 100644 index 000000000..d820b71e1 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/constructordestructor/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.constructordestructor; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/exporter/ExporterTransferStrategyFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/exporter/ExporterTransferStrategyFactory.java new file mode 100644 index 000000000..7e423a3bd --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/exporter/ExporterTransferStrategyFactory.java @@ -0,0 +1,23 @@ +package com.refinedmods.refinedstorage.common.api.exporter; + +import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4") +@FunctionalInterface +public interface ExporterTransferStrategyFactory { + ExporterTransferStrategy create( + ServerLevel level, + BlockPos pos, + Direction direction, + UpgradeState upgradeState, + AmountOverride amountOverride, + boolean fuzzyMode + ); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/exporter/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/exporter/package-info.java new file mode 100644 index 000000000..11f69bf0a --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/exporter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.exporter; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/Grid.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/Grid.java similarity index 86% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/Grid.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/Grid.java index 5fcb6e97a..92e194e46 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/Grid.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/Grid.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.api.grid; +package com.refinedmods.refinedstorage.common.api.grid; import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.Storage; import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import java.util.List; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridInsertionHint.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridInsertionHint.java similarity index 86% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridInsertionHint.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridInsertionHint.java index 9a679207b..8f2eef1f3 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridInsertionHint.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridInsertionHint.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.grid; +package com.refinedmods.refinedstorage.common.api.grid; import java.util.Optional; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridInsertionHints.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridInsertionHints.java similarity index 86% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridInsertionHints.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridInsertionHints.java index 53deb941d..aef34e5d6 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridInsertionHints.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridInsertionHints.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.grid; +package com.refinedmods.refinedstorage.common.api.grid; import java.util.List; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridResourceAttributeKeys.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridResourceAttributeKeys.java similarity index 83% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridResourceAttributeKeys.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridResourceAttributeKeys.java index 9e9ed0322..6a5d59efc 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridResourceAttributeKeys.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridResourceAttributeKeys.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.grid; +package com.refinedmods.refinedstorage.common.api.grid; import com.refinedmods.refinedstorage.api.grid.view.GridResourceAttributeKey; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridScrollMode.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridScrollMode.java new file mode 100644 index 000000000..aa1090d5a --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridScrollMode.java @@ -0,0 +1,7 @@ +package com.refinedmods.refinedstorage.common.api.grid; + +public enum GridScrollMode { + GRID_TO_INVENTORY, + INVENTORY_TO_GRID, + GRID_TO_CURSOR +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridSynchronizer.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridSynchronizer.java similarity index 90% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridSynchronizer.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridSynchronizer.java index 6640be2b1..f3caa76fc 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridSynchronizer.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridSynchronizer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.grid; +package com.refinedmods.refinedstorage.common.api.grid; import javax.annotation.Nullable; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/package-info.java new file mode 100644 index 000000000..d47924ff7 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.grid; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridExtractionStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridExtractionStrategy.java new file mode 100644 index 000000000..63babe6fa --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridExtractionStrategy.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage.common.api.grid.strategy; + +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") +@FunctionalInterface +public interface GridExtractionStrategy { + boolean onExtract(PlatformResourceKey resource, GridExtractMode extractMode, boolean cursor); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridExtractionStrategyFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridExtractionStrategyFactory.java new file mode 100644 index 000000000..3d0b8cd8d --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridExtractionStrategyFactory.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage.common.api.grid.strategy; + +import com.refinedmods.refinedstorage.common.api.grid.Grid; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") +@FunctionalInterface +public interface GridExtractionStrategyFactory { + GridExtractionStrategy create(AbstractContainerMenu containerMenu, ServerPlayer player, Grid grid); +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridInsertionStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridInsertionStrategy.java similarity index 83% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridInsertionStrategy.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridInsertionStrategy.java index 53aa2fab5..d97d9ea4e 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridInsertionStrategy.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridInsertionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.grid.strategy; +package com.refinedmods.refinedstorage.common.api.grid.strategy; import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridInsertionStrategyFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridInsertionStrategyFactory.java new file mode 100644 index 000000000..e697368d7 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridInsertionStrategyFactory.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage.common.api.grid.strategy; + +import com.refinedmods.refinedstorage.common.api.grid.Grid; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") +@FunctionalInterface +public interface GridInsertionStrategyFactory { + GridInsertionStrategy create(AbstractContainerMenu containerMenu, ServerPlayer player, Grid grid); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridScrollingStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridScrollingStrategy.java new file mode 100644 index 000000000..a186e9414 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridScrollingStrategy.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage.common.api.grid.strategy; + +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") +@FunctionalInterface +public interface GridScrollingStrategy { + boolean onScroll(PlatformResourceKey resource, GridScrollMode scrollMode, int slotIndex); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridScrollingStrategyFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridScrollingStrategyFactory.java new file mode 100644 index 000000000..354116999 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/GridScrollingStrategyFactory.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage.common.api.grid.strategy; + +import com.refinedmods.refinedstorage.common.api.grid.Grid; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") +@FunctionalInterface +public interface GridScrollingStrategyFactory { + GridScrollingStrategy create(AbstractContainerMenu containerMenu, ServerPlayer player, Grid grid); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/package-info.java new file mode 100644 index 000000000..2059caa77 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/strategy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/AbstractPlatformGridResource.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/AbstractPlatformGridResource.java similarity index 88% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/AbstractPlatformGridResource.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/AbstractPlatformGridResource.java index 348934ca5..f633c8021 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/AbstractPlatformGridResource.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/AbstractPlatformGridResource.java @@ -1,9 +1,8 @@ -package com.refinedmods.refinedstorage.platform.api.grid.view; +package com.refinedmods.refinedstorage.common.api.grid.view; import com.refinedmods.refinedstorage.api.grid.view.GridResourceAttributeKey; import com.refinedmods.refinedstorage.api.grid.view.GridView; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; import java.util.Collections; @@ -28,13 +27,9 @@ protected AbstractPlatformGridResource(final ResourceAmount resourceAmount, this.attributes = attributes; } - public ResourceKey getResource() { - return resourceAmount.getResource(); - } - @Override public Optional getTrackedResource(final GridView view) { - return view.getTrackedResource(getResource()); + return view.getTrackedResource(resourceAmount.getResource()); } @Override diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/PlatformGridResource.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/PlatformGridResource.java new file mode 100644 index 000000000..9436be8f2 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/PlatformGridResource.java @@ -0,0 +1,46 @@ +package com.refinedmods.refinedstorage.common.api.grid.view; + +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.api.grid.view.GridResource; +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; + +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.network.chat.Component; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") +public interface PlatformGridResource extends GridResource { + void onExtract(GridExtractMode extractMode, + boolean cursor, + GridExtractionStrategy extractionStrategy); + + void onScroll(GridScrollMode scrollMode, + GridScrollingStrategy scrollingStrategy); + + void render(GuiGraphics graphics, int x, int y); + + String getDisplayedAmount(); + + String getAmountInTooltip(); + + List getTooltip(); + + Optional getTooltipImage(); + + int getRegistryId(); + + List getExtractionHints(); + + @Nullable + @API(status = API.Status.INTERNAL) + PlatformResourceKey getUnderlyingResource(); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/package-info.java new file mode 100644 index 000000000..16e4076d6 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.grid.view; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/importer/ImporterTransferStrategyFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/importer/ImporterTransferStrategyFactory.java new file mode 100644 index 000000000..8768c37cd --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/importer/ImporterTransferStrategyFactory.java @@ -0,0 +1,22 @@ +package com.refinedmods.refinedstorage.common.api.importer; + +import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.1") +@FunctionalInterface +public interface ImporterTransferStrategyFactory { + ImporterTransferStrategy create( + ServerLevel level, + BlockPos pos, + Direction direction, + UpgradeState upgradeState, + AmountOverride amountOverride + ); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/importer/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/importer/package-info.java new file mode 100644 index 000000000..6a98b4281 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/importer/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.importer; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/package-info.java new file mode 100644 index 000000000..7035db66a --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/PlatformPermission.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/PlatformPermission.java similarity index 92% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/PlatformPermission.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/PlatformPermission.java index 45101a1e4..367a9d227 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/PlatformPermission.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/PlatformPermission.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.security; +package com.refinedmods.refinedstorage.common.api.security; import com.refinedmods.refinedstorage.api.network.security.Permission; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/PlatformSecurityNetworkComponent.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/PlatformSecurityNetworkComponent.java similarity index 88% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/PlatformSecurityNetworkComponent.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/PlatformSecurityNetworkComponent.java index 151dd1607..7541379be 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/PlatformSecurityNetworkComponent.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/PlatformSecurityNetworkComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.security; +package com.refinedmods.refinedstorage.common.api.security; import com.refinedmods.refinedstorage.api.network.security.Permission; import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/SecurityHelper.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/SecurityHelper.java similarity index 89% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/SecurityHelper.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/SecurityHelper.java index 2f52e636e..c320fa99f 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/SecurityHelper.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/SecurityHelper.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.api.security; +package com.refinedmods.refinedstorage.common.api.security; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.node.NetworkNode; import com.refinedmods.refinedstorage.api.network.security.Permission; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; import java.util.Set; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/SecurityPolicyContainerItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/SecurityPolicyContainerItem.java similarity index 94% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/SecurityPolicyContainerItem.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/SecurityPolicyContainerItem.java index 97fa69ad5..f65a2bbb6 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/SecurityPolicyContainerItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/SecurityPolicyContainerItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.security; +package com.refinedmods.refinedstorage.common.api.security; import com.refinedmods.refinedstorage.api.network.security.SecurityActor; import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/package-info.java new file mode 100644 index 000000000..66be52667 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/security/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.security; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/AbstractStorageContainerBlockItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerBlockItem.java similarity index 93% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/AbstractStorageContainerBlockItem.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerBlockItem.java index 47563d6ef..b913b0651 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/AbstractStorageContainerBlockItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerBlockItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.api.storage; +package com.refinedmods.refinedstorage.common.api.storage; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import java.util.List; import javax.annotation.Nullable; @@ -75,7 +75,7 @@ public void appendHoverText(final ItemStack stack, final List tooltip, final TooltipFlag flag) { super.appendHoverText(stack, context, tooltip, flag); - final StorageRepository storageRepository = PlatformApi.INSTANCE.getClientStorageRepository(); + final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getClientStorageRepository(); helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, hasCapacity()); } diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/AbstractStorageContainerItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerItem.java similarity index 90% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/AbstractStorageContainerItem.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerItem.java index cd38b2c6d..e1a45b760 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/AbstractStorageContainerItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.api.storage; +package com.refinedmods.refinedstorage.common.api.storage; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import java.util.List; import java.util.Optional; @@ -52,7 +52,7 @@ public void inventoryTick(final ItemStack stack, final boolean selected) { super.inventoryTick(stack, level, entity, slot, selected); if (!level.isClientSide() && !helper.hasStorage(stack) && entity instanceof Player) { - final StorageRepository storageRepository = PlatformApi.INSTANCE.getStorageRepository(level); + final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getStorageRepository(level); helper.setStorage(storageRepository, stack, createStorage(storageRepository)); } } @@ -63,7 +63,7 @@ public void appendHoverText(final ItemStack stack, final List tooltip, final TooltipFlag flag) { super.appendHoverText(stack, context, tooltip, flag); - final StorageRepository storageRepository = PlatformApi.INSTANCE.getClientStorageRepository(); + final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getClientStorageRepository(); helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, hasCapacity()); } diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/PlayerActor.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/PlayerActor.java similarity index 90% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/PlayerActor.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/PlayerActor.java index b8321e13c..7a4dbdcaa 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/PlayerActor.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/PlayerActor.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storage; +package com.refinedmods.refinedstorage.common.api.storage; import com.refinedmods.refinedstorage.api.storage.Actor; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/SerializableStorage.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/SerializableStorage.java new file mode 100644 index 000000000..841e721e8 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/SerializableStorage.java @@ -0,0 +1,18 @@ +package com.refinedmods.refinedstorage.common.api.storage; + +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; + +import com.mojang.serialization.Codec; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.4") +public interface SerializableStorage extends Storage { + StorageType getType(); + + static Codec getCodec(final Runnable listener) { + return RefinedStorageApi.INSTANCE.getStorageTypeRegistry() + .codec() + .dispatch(SerializableStorage::getType, storage -> storage.getMapCodec(listener)); + } +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageBlockEntity.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageBlockEntity.java similarity index 87% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageBlockEntity.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageBlockEntity.java index 6b5896f17..5ad9716f5 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageBlockEntity.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storage; +package com.refinedmods.refinedstorage.common.api.storage; import java.util.UUID; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageContainerItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItem.java similarity index 90% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageContainerItem.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItem.java index 0bf359500..4537dc62a 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageContainerItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storage; +package com.refinedmods.refinedstorage.common.api.storage; import java.util.Optional; import java.util.function.Predicate; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageContainerItemHelper.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItemHelper.java similarity index 97% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageContainerItemHelper.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItemHelper.java index aa8449768..0ac5f8798 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageContainerItemHelper.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItemHelper.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storage; +package com.refinedmods.refinedstorage.common.api.storage; import java.util.List; import java.util.Map; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageInfo.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageInfo.java similarity index 90% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageInfo.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageInfo.java index 760486109..766e7befa 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageInfo.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageInfo.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storage; +package com.refinedmods.refinedstorage.common.api.storage; import com.refinedmods.refinedstorage.api.storage.Storage; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorage; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageRepository.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageRepository.java similarity index 94% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageRepository.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageRepository.java index e0ff56515..e66e6823a 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageRepository.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageRepository.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storage; +package com.refinedmods.refinedstorage.common.api.storage; import java.util.Optional; import java.util.UUID; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageType.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageType.java similarity index 89% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageType.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageType.java index a6c8ce7a0..fc28551dd 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/StorageType.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storage; +package com.refinedmods.refinedstorage.common.api.storage; import com.refinedmods.refinedstorage.api.resource.ResourceKey; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/externalstorage/PlatformExternalStorageProviderFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/externalstorage/PlatformExternalStorageProviderFactory.java similarity index 87% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/externalstorage/PlatformExternalStorageProviderFactory.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/externalstorage/PlatformExternalStorageProviderFactory.java index 001428a90..b9d34882b 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/externalstorage/PlatformExternalStorageProviderFactory.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/externalstorage/PlatformExternalStorageProviderFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storage.externalstorage; +package com.refinedmods.refinedstorage.common.api.storage.externalstorage; import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/externalstorage/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/externalstorage/package-info.java new file mode 100644 index 000000000..9ce0ab5f5 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/externalstorage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.storage.externalstorage; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/package-info.java new file mode 100644 index 000000000..31f5bf6a1 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.storage; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/root/FuzzyRootStorage.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/root/FuzzyRootStorage.java new file mode 100644 index 000000000..9f6f516b3 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/root/FuzzyRootStorage.java @@ -0,0 +1,14 @@ +package com.refinedmods.refinedstorage.common.api.storage.root; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; + +import java.util.Collection; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4") +public interface FuzzyRootStorage extends RootStorage { + Collection getFuzzy(ResourceKey resource); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/root/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/root/package-info.java new file mode 100644 index 000000000..b275d9134 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/root/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.storage.root; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storagemonitor/StorageMonitorExtractionStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storagemonitor/StorageMonitorExtractionStrategy.java similarity index 88% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storagemonitor/StorageMonitorExtractionStrategy.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storagemonitor/StorageMonitorExtractionStrategy.java index 1dba4ccdd..4250a07b6 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storagemonitor/StorageMonitorExtractionStrategy.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storagemonitor/StorageMonitorExtractionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storagemonitor; +package com.refinedmods.refinedstorage.common.api.storagemonitor; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.resource.ResourceKey; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storagemonitor/StorageMonitorInsertionStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storagemonitor/StorageMonitorInsertionStrategy.java similarity index 88% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storagemonitor/StorageMonitorInsertionStrategy.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storagemonitor/StorageMonitorInsertionStrategy.java index 0525ea66e..6653fa5d2 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storagemonitor/StorageMonitorInsertionStrategy.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storagemonitor/StorageMonitorInsertionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.storagemonitor; +package com.refinedmods.refinedstorage.common.api.storagemonitor; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.resource.ResourceKey; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storagemonitor/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storagemonitor/package-info.java new file mode 100644 index 000000000..54eee32f0 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storagemonitor/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.storagemonitor; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/AmountFormatting.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/AmountFormatting.java similarity index 96% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/AmountFormatting.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/AmountFormatting.java index e3483dbb7..6997df638 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/AmountFormatting.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/AmountFormatting.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support; +package com.refinedmods.refinedstorage.common.api.support; import java.math.RoundingMode; import java.text.DecimalFormat; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/HelpTooltipComponent.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/HelpTooltipComponent.java similarity index 88% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/HelpTooltipComponent.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/HelpTooltipComponent.java index 0cdeb6f30..222cea2fe 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/HelpTooltipComponent.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/HelpTooltipComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support; +package com.refinedmods.refinedstorage.common.api.support; import net.minecraft.network.chat.Component; import net.minecraft.world.inventory.tooltip.TooltipComponent; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractEnergyBlockItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractEnergyBlockItem.java similarity index 96% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractEnergyBlockItem.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractEnergyBlockItem.java index 4573fa03c..d5e8fa2aa 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractEnergyBlockItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractEnergyBlockItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.energy; +package com.refinedmods.refinedstorage.common.api.support.energy; import java.util.List; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractEnergyItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractEnergyItem.java similarity index 95% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractEnergyItem.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractEnergyItem.java index 620198d93..acef2462b 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractEnergyItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractEnergyItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.energy; +package com.refinedmods.refinedstorage.common.api.support.energy; import java.util.List; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractNetworkEnergyItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractNetworkEnergyItem.java new file mode 100644 index 000000000..f9646e79d --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractNetworkEnergyItem.java @@ -0,0 +1,80 @@ +package com.refinedmods.refinedstorage.common.api.support.energy; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemContext; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemHelper; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceHandlerItem; + +import java.util.List; +import java.util.Optional; + +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.Level; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") +public abstract class AbstractNetworkEnergyItem extends AbstractEnergyItem implements SlotReferenceHandlerItem { + protected final NetworkItemHelper networkItemHelper; + + protected AbstractNetworkEnergyItem(final Properties properties, + final EnergyItemHelper energyItemHelper, + final NetworkItemHelper networkItemHelper) { + super(properties, energyItemHelper); + this.networkItemHelper = networkItemHelper; + } + + @Override + public InteractionResult useOn(final UseOnContext ctx) { + return networkItemHelper.bind(ctx); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return networkItemHelper.getTooltipImage(stack); + } + + @Override + public void appendHoverText(final ItemStack stack, + final TooltipContext context, + final List tooltip, + final TooltipFlag flag) { + super.appendHoverText(stack, context, tooltip, flag); + networkItemHelper.addTooltip(stack, tooltip); + } + + @Override + public InteractionResultHolder use(final Level level, final Player player, final InteractionHand hand) { + final ItemStack stack = player.getItemInHand(hand); + if (player instanceof ServerPlayer serverPlayer && level.getServer() != null) { + final SlotReference slotReference = RefinedStorageApi.INSTANCE.createInventorySlotReference(player, hand); + slotReference.resolve(player).ifPresent(s -> use(serverPlayer, s, slotReference)); + } + return InteractionResultHolder.consume(stack); + } + + @Override + public void use(final ServerPlayer player, final ItemStack stack, final SlotReference slotReference) { + final NetworkItemContext context = RefinedStorageApi.INSTANCE.getNetworkItemHelper().createContext( + stack, + player, + slotReference + ); + use(player, slotReference, context); + } + + protected abstract void use(ServerPlayer player, SlotReference slotReference, NetworkItemContext context); + + public boolean isBound(final ItemStack stack) { + return networkItemHelper.isBound(stack); + } +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/EnergyItemHelper.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/EnergyItemHelper.java similarity index 90% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/EnergyItemHelper.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/EnergyItemHelper.java index c72fa5f48..0ecd5c6ef 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/EnergyItemHelper.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/EnergyItemHelper.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.energy; +package com.refinedmods.refinedstorage.common.api.support.energy; import java.util.List; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/TransferableBlockEntityEnergy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/TransferableBlockEntityEnergy.java new file mode 100644 index 000000000..2fd3a75a6 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/TransferableBlockEntityEnergy.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage.common.api.support.energy; + +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") +@FunctionalInterface +public interface TransferableBlockEntityEnergy { + EnergyStorage getEnergyStorage(); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/package-info.java new file mode 100644 index 000000000..febba993b --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.support.energy; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/AbstractNetworkNodeContainerBlockEntity.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/AbstractNetworkNodeContainerBlockEntity.java new file mode 100644 index 000000000..a98eec24a --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/AbstractNetworkNodeContainerBlockEntity.java @@ -0,0 +1,54 @@ +package com.refinedmods.refinedstorage.common.api.support.network; + +import com.refinedmods.refinedstorage.api.network.node.NetworkNode; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.2") +public abstract class AbstractNetworkNodeContainerBlockEntity extends BlockEntity { + protected final T mainNetworkNode; + protected final NetworkNodeContainerProvider containers; + + protected AbstractNetworkNodeContainerBlockEntity(final BlockEntityType type, + final BlockPos pos, + final BlockState state, + final T mainNetworkNode) { + super(type, pos, state); + this.containers = createContainerProvider(); + this.containers.addContainer(createMainContainer(mainNetworkNode)); + this.mainNetworkNode = mainNetworkNode; + } + + protected NetworkNodeContainerProvider createContainerProvider() { + return RefinedStorageApi.INSTANCE.createNetworkNodeContainerProvider(); + } + + protected InWorldNetworkNodeContainer createMainContainer(final T networkNode) { + return RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, networkNode).build(); + } + + @Override + public void clearRemoved() { + super.clearRemoved(); + containers.initialize(level, this::containerInitialized); + } + + protected void containerInitialized() { + // no op + } + + @Override + public void setRemoved() { + super.setRemoved(); + containers.remove(level); + } + + public final NetworkNodeContainerProvider getContainerProvider() { + return containers; + } +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/AmountOverride.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/AmountOverride.java new file mode 100644 index 000000000..2a4dc9030 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/AmountOverride.java @@ -0,0 +1,23 @@ +package com.refinedmods.refinedstorage.common.api.support.network; + +import com.refinedmods.refinedstorage.api.resource.ResourceKey; + +import java.util.function.LongSupplier; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.12") +@FunctionalInterface +public interface AmountOverride { + AmountOverride NONE = (resource, amount, currentAmount) -> amount; + + /** + * Modifies the requested amount to a new amount. + * + * @param resource the resource + * @param amount the original requested amount + * @param currentAmountSupplier the current amount present in the source + * @return the new requested amount, may be 0 + */ + long overrideAmount(ResourceKey resource, long amount, LongSupplier currentAmountSupplier); +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/ConnectionSink.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/ConnectionSink.java similarity index 83% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/ConnectionSink.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/ConnectionSink.java index dff5d3cf9..5f4bea828 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/ConnectionSink.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/ConnectionSink.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.network; +package com.refinedmods.refinedstorage.common.api.support.network; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/ConnectionStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/ConnectionStrategy.java new file mode 100644 index 000000000..8b92520c1 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/ConnectionStrategy.java @@ -0,0 +1,33 @@ +package com.refinedmods.refinedstorage.common.api.support.network; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; + +import net.minecraft.core.Direction; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.6") +public interface ConnectionStrategy { + /** + * Add outgoing connections here. + * Called when a node is about to be added into the network graph. + * If the outgoing connections ever change, call {@link + * RefinedStorageApi#updateNetworkNodeContainer(InWorldNetworkNodeContainer, Level)}. + * + * @param sink the sink that accepts outgoing connections + */ + void addOutgoingConnections(ConnectionSink sink); + + /** + * Returns whether the (not yet discovered) node can accept an incoming connection. + * Changes to this return value won't cause a rebuild of the network state. + * If the return value ever changes, call {@link + * RefinedStorageApi#updateNetworkNodeContainer(InWorldNetworkNodeContainer, Level)}. + * + * @param incomingDirection the incoming direction + * @param connectingState the state wanting to connect + * @return whether the node can accept an incoming connection + */ + boolean canAcceptIncomingConnection(Direction incomingDirection, BlockState connectingState); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/InWorldNetworkNodeContainer.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/InWorldNetworkNodeContainer.java new file mode 100644 index 000000000..de9fb8763 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/InWorldNetworkNodeContainer.java @@ -0,0 +1,35 @@ +package com.refinedmods.refinedstorage.common.api.support.network; + +import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer; + +import java.util.function.Supplier; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.world.level.block.state.BlockState; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.1") +public interface InWorldNetworkNodeContainer extends NetworkNodeContainer, ConnectionStrategy { + BlockState getBlockState(); + + boolean isRemoved(); + + GlobalPos getPosition(); + + BlockPos getLocalPosition(); + + String getName(); + + interface Builder { + Builder name(String name); + + Builder priority(int priority); + + Builder connectionStrategy(ConnectionStrategy connectionStrategy); + + Builder keyProvider(Supplier keyProvider); + + InWorldNetworkNodeContainer build(); + } +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/NetworkNodeContainerProvider.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/NetworkNodeContainerProvider.java new file mode 100644 index 000000000..d718ed8d6 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/NetworkNodeContainerProvider.java @@ -0,0 +1,35 @@ +package com.refinedmods.refinedstorage.common.api.support.network; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; + +import java.util.Set; +import javax.annotation.Nullable; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.level.Level; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.6") +public interface NetworkNodeContainerProvider { + Set getContainers(); + + void addContainer(InWorldNetworkNodeContainer container); + + boolean canBuild(ServerPlayer player); + + default void update(@Nullable final Level level) { + getContainers().forEach(container -> RefinedStorageApi.INSTANCE.updateNetworkNodeContainer(container, level)); + } + + default void initialize(@Nullable final Level level, @Nullable final Runnable callback) { + getContainers().forEach(container -> RefinedStorageApi.INSTANCE.initializeNetworkNodeContainer( + container, + level, + callback + )); + } + + default void remove(@Nullable final Level level) { + getContainers().forEach(container -> RefinedStorageApi.INSTANCE.removeNetworkNodeContainer(container, level)); + } +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemContext.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemContext.java new file mode 100644 index 000000000..51826357d --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemContext.java @@ -0,0 +1,16 @@ +package com.refinedmods.refinedstorage.common.api.support.network.item; + +import com.refinedmods.refinedstorage.api.network.Network; + +import java.util.Optional; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") +public interface NetworkItemContext { + Optional resolveNetwork(); + + boolean isActive(); + + void drainEnergy(long amount); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemHelper.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemHelper.java new file mode 100644 index 000000000..c0ee9a1bf --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemHelper.java @@ -0,0 +1,27 @@ +package com.refinedmods.refinedstorage.common.api.support.network.item; + +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; + +import java.util.List; +import java.util.Optional; + +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.UseOnContext; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") +public interface NetworkItemHelper { + void addTooltip(ItemStack stack, List lines); + + InteractionResult bind(UseOnContext ctx); + + Optional getTooltipImage(ItemStack stack); + + NetworkItemContext createContext(ItemStack stack, ServerPlayer player, SlotReference slotReference); + + boolean isBound(ItemStack stack); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemPlayerValidator.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemPlayerValidator.java new file mode 100644 index 000000000..e5166da14 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemPlayerValidator.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage.common.api.support.network.item; + +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import org.apiguardian.api.API; + +@FunctionalInterface +@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.5") +public interface NetworkItemPlayerValidator { + boolean isValid(PlayerCoordinates coordinates); + + record PlayerCoordinates(ResourceKey dimension, Vec3 position) { + } +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemTargetBlockEntity.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemTargetBlockEntity.java new file mode 100644 index 000000000..280e08922 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/NetworkItemTargetBlockEntity.java @@ -0,0 +1,14 @@ +package com.refinedmods.refinedstorage.common.api.support.network.item; + +import com.refinedmods.refinedstorage.api.network.Network; + +import javax.annotation.Nullable; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.6") +@FunctionalInterface +public interface NetworkItemTargetBlockEntity { + @Nullable + Network getNetworkForItem(); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/package-info.java new file mode 100644 index 000000000..8cefdc2cc --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/item/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.support.network.item; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/package-info.java new file mode 100644 index 000000000..726444374 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/network/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.support.network; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/package-info.java new file mode 100644 index 000000000..880217947 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.support; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/registry/PlatformRegistry.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/registry/PlatformRegistry.java similarity index 95% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/registry/PlatformRegistry.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/registry/PlatformRegistry.java index 5c72be8db..198f09867 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/registry/PlatformRegistry.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/registry/PlatformRegistry.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.registry; +package com.refinedmods.refinedstorage.common.api.support.registry; import java.util.List; import java.util.Optional; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/registry/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/registry/package-info.java new file mode 100644 index 000000000..49b77fb44 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/registry/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.support.registry; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/AbstractResourceType.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/AbstractResourceType.java similarity index 95% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/AbstractResourceType.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/AbstractResourceType.java index 7c911413e..6bd422fd7 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/AbstractResourceType.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/AbstractResourceType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.resource; +package com.refinedmods.refinedstorage.common.api.support.resource; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/FluidOperationResult.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/FluidOperationResult.java new file mode 100644 index 000000000..2416a0d46 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/FluidOperationResult.java @@ -0,0 +1,8 @@ +package com.refinedmods.refinedstorage.common.api.support.resource; + +import net.minecraft.world.item.ItemStack; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.5") +public record FluidOperationResult(ItemStack container, PlatformResourceKey fluid, long amount) { +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/FuzzyModeNormalizer.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/FuzzyModeNormalizer.java similarity index 76% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/FuzzyModeNormalizer.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/FuzzyModeNormalizer.java index c622348cd..420cfb9db 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/FuzzyModeNormalizer.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/FuzzyModeNormalizer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.resource; +package com.refinedmods.refinedstorage.common.api.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceKey; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/PlatformResourceKey.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/PlatformResourceKey.java similarity index 80% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/PlatformResourceKey.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/PlatformResourceKey.java index 539789045..220f29367 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/PlatformResourceKey.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/PlatformResourceKey.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.resource; +package com.refinedmods.refinedstorage.common.api.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceKey; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/RecipeModIngredientConverter.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/RecipeModIngredientConverter.java similarity index 82% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/RecipeModIngredientConverter.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/RecipeModIngredientConverter.java index fbaa33558..7ba4a1b38 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/RecipeModIngredientConverter.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/RecipeModIngredientConverter.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.resource; +package com.refinedmods.refinedstorage.common.api.support.resource; import java.util.Optional; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceContainer.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainer.java similarity index 96% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceContainer.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainer.java index 2baa83546..cdc582672 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceContainer.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.resource; +package com.refinedmods.refinedstorage.common.api.support.resource; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainerInsertStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainerInsertStrategy.java new file mode 100644 index 000000000..139039666 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainerInsertStrategy.java @@ -0,0 +1,31 @@ +package com.refinedmods.refinedstorage.common.api.support.resource; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; + +import java.util.Optional; + +import net.minecraft.world.item.ItemStack; +import org.apiguardian.api.API; + +/** + * Defines how a resource can be extracted from a resource slot into a container. + * For fluids, this maps to how a fluid is inserted into a fluid container like a bucket. + */ +@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.5") +public interface ResourceContainerInsertStrategy { + /** + * @param container the container to insert the resource into + * @param resourceAmount the resource to insert into the container + * @return the result of the insertion, if any. If no result is present, the next insertion strategy will be tried. + */ + Optional insert(ItemStack container, ResourceAmount resourceAmount); + + Optional getConversionInfo(ResourceKey resource); + + record InsertResult(ItemStack container, long inserted) { + } + + record ConversionInfo(ItemStack from, ItemStack to) { + } +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceFactory.java similarity index 86% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceFactory.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceFactory.java index fbf51c942..13aa5da6d 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceFactory.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.resource; +package com.refinedmods.refinedstorage.common.api.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceRendering.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceRendering.java similarity index 92% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceRendering.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceRendering.java index b52992ed4..1c50428d7 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceRendering.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceRendering.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.resource; +package com.refinedmods.refinedstorage.common.api.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceKey; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceType.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceType.java similarity index 79% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceType.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceType.java index 7ed1658f3..ad0d97054 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceType.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceType.java @@ -1,14 +1,13 @@ -package com.refinedmods.refinedstorage.platform.api.support.resource; +package com.refinedmods.refinedstorage.common.api.support.resource; import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; import com.refinedmods.refinedstorage.api.grid.view.GridResource; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import java.util.Optional; -import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.MutableComponent; @@ -20,8 +19,6 @@ public interface ResourceType { MapCodec getMapCodec(); - Codec getCodec(); - StreamCodec getStreamCodec(); MutableComponent getTitle(); @@ -42,5 +39,5 @@ public interface ResourceType { long getInterfaceExportLimit(); - GridOperations createGridOperations(StorageChannel storageChannel, Actor actor); + GridOperations createGridOperations(RootStorage rootStorage, Actor actor); } diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/list/FuzzyResourceList.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/list/FuzzyResourceList.java similarity index 81% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/list/FuzzyResourceList.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/list/FuzzyResourceList.java index 0539365f0..0842d3181 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/list/FuzzyResourceList.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/list/FuzzyResourceList.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.api.support.resource.list; +package com.refinedmods.refinedstorage.common.api.support.resource.list; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage.platform.api.support.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage.common.api.support.resource.FuzzyModeNormalizer; import java.util.Collection; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/list/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/list/package-info.java new file mode 100644 index 000000000..66b1e7e0a --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/list/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.support.resource.list; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/package-info.java new file mode 100644 index 000000000..c641b384d --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.support.resource; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReference.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReference.java similarity index 83% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReference.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReference.java index 903495ad3..d26400480 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReference.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReference.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.slotreference; +package com.refinedmods.refinedstorage.common.api.support.slotreference; import java.util.Optional; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReferenceFactory.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReferenceFactory.java new file mode 100644 index 000000000..61f6440db --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReferenceFactory.java @@ -0,0 +1,31 @@ +package com.refinedmods.refinedstorage.common.api.support.slotreference; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.resources.ResourceLocation; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") +@FunctionalInterface +public interface SlotReferenceFactory { + StreamCodec STREAM_CODEC = StreamCodec.of( + (buf, slotReference) -> { + final ResourceLocation factoryId = RefinedStorageApi.INSTANCE.getSlotReferenceFactoryRegistry() + .getId(slotReference.getFactory()) + .orElseThrow(); + buf.writeResourceLocation(factoryId); + slotReference.getFactory().getStreamCodec().encode(buf, slotReference); + }, + buf -> { + final ResourceLocation factoryId = buf.readResourceLocation(); + final SlotReferenceFactory factory = RefinedStorageApi.INSTANCE.getSlotReferenceFactoryRegistry() + .get(factoryId) + .orElseThrow(); + return factory.getStreamCodec().decode(buf); + } + ); + + StreamCodec getStreamCodec(); +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceHandlerItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReferenceHandlerItem.java similarity index 81% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceHandlerItem.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReferenceHandlerItem.java index edeeabe5c..1b7d19b49 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceHandlerItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReferenceHandlerItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.slotreference; +package com.refinedmods.refinedstorage.common.api.support.slotreference; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceProvider.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReferenceProvider.java similarity index 78% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceProvider.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReferenceProvider.java index c86829255..1189e3180 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceProvider.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/SlotReferenceProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.slotreference; +package com.refinedmods.refinedstorage.common.api.support.slotreference; import java.util.List; import java.util.Set; @@ -8,6 +8,7 @@ import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") +@FunctionalInterface public interface SlotReferenceProvider { List find(Player player, Set validItems); } diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/package-info.java new file mode 100644 index 000000000..7da81bf24 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/slotreference/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.support.slotreference; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/AbstractUpgradeItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/AbstractUpgradeItem.java similarity index 94% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/AbstractUpgradeItem.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/AbstractUpgradeItem.java index 6875c70a3..4bb7c9740 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/AbstractUpgradeItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/AbstractUpgradeItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.upgrade; +package com.refinedmods.refinedstorage.common.api.upgrade; import java.util.Optional; import java.util.Set; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeDestination.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeDestination.java similarity index 82% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeDestination.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeDestination.java index 8b8ddcac5..3c4abfbd0 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeDestination.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeDestination.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.upgrade; +package com.refinedmods.refinedstorage.common.api.upgrade; import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeItem.java new file mode 100644 index 000000000..5ee85cbd7 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeItem.java @@ -0,0 +1,9 @@ +package com.refinedmods.refinedstorage.common.api.upgrade; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.10") +@FunctionalInterface +public interface UpgradeItem { + long getEnergyUsage(); +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeMapping.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeMapping.java similarity index 90% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeMapping.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeMapping.java index e7580389e..69a533d7c 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeMapping.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeMapping.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.upgrade; +package com.refinedmods.refinedstorage.common.api.upgrade; import net.minecraft.network.chat.Component; import net.minecraft.world.item.Item; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeRegistry.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeRegistry.java similarity index 91% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeRegistry.java rename to refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeRegistry.java index 06560bc67..b4fda40de 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeRegistry.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeRegistry.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.upgrade; +package com.refinedmods.refinedstorage.common.api.upgrade; import java.util.Set; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeState.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeState.java new file mode 100644 index 000000000..4a94bc33b --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/UpgradeState.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage.common.api.upgrade; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.10") +@FunctionalInterface +public interface UpgradeState { + default boolean has(UpgradeItem upgradeItem) { + return getAmount(upgradeItem) > 0; + } + + int getAmount(UpgradeItem upgradeItem); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/package-info.java new file mode 100644 index 000000000..82d6ec3a6 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/upgrade/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.upgrade; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/wirelesstransmitter/WirelessTransmitterRangeModifier.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/wirelesstransmitter/WirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..fa4325bfb --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/wirelesstransmitter/WirelessTransmitterRangeModifier.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage.common.api.wirelesstransmitter; + +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") +@FunctionalInterface +public interface WirelessTransmitterRangeModifier { + int modifyRange(UpgradeState upgradeState, int range); + + default int getPriority() { + return 0; + } +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/wirelesstransmitter/package-info.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/wirelesstransmitter/package-info.java new file mode 100644 index 000000000..3b7dd5a89 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/wirelesstransmitter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.api.wirelesstransmitter; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/test/java/com/refinedmods/refinedstorage/platform/api/support/AmountFormattingTest.java b/refinedstorage-common-api/src/test/java/com/refinedmods/refinedstorage/common/api/support/AmountFormattingTest.java similarity index 98% rename from refinedstorage-platform-api/src/test/java/com/refinedmods/refinedstorage/platform/api/support/AmountFormattingTest.java rename to refinedstorage-common-api/src/test/java/com/refinedmods/refinedstorage/common/api/support/AmountFormattingTest.java index fd635d791..faefd7d76 100644 --- a/refinedstorage-platform-api/src/test/java/com/refinedmods/refinedstorage/platform/api/support/AmountFormattingTest.java +++ b/refinedstorage-common-api/src/test/java/com/refinedmods/refinedstorage/common/api/support/AmountFormattingTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support; +package com.refinedmods.refinedstorage.common.api.support; import org.junit.jupiter.api.Test; diff --git a/refinedstorage-common/build.gradle.kts b/refinedstorage-common/build.gradle.kts new file mode 100644 index 000000000..79c862962 --- /dev/null +++ b/refinedstorage-common/build.gradle.kts @@ -0,0 +1,32 @@ +plugins { + id("refinedarchitect.common") +} + +refinedarchitect { + common() + testing() + javadoc() + publishing { + maven = true + } +} + +base { + archivesName.set("refinedstorage-common") +} + +dependencies { + api(project(":refinedstorage-common-api")) + api(project(":refinedstorage-core-api")) + api(project(":refinedstorage-resource-api")) + api(project(":refinedstorage-storage-api")) + api(project(":refinedstorage-network-api")) + api(project(":refinedstorage-network")) + api(project(":refinedstorage-query-parser")) + api(project(":refinedstorage-grid-api")) + testImplementation(libs.junit.api) + testImplementation(libs.junit.params) + testImplementation(libs.assertj) + testImplementation(libs.equalsverifier) + testRuntimeOnly(libs.junit.engine) +} diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/black_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/blue_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/brown_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/green_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_blue_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/lime_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/orange_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/pink_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/purple_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/red_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/white_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/core/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/cable/extension/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/controller/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/controller/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/inactive.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/inactive.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/inactive.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/crafting_grid/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/detector/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/detector/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/base_yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/inactive.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/inactive.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/inactive.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/disk_interface/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/inactive.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/inactive.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/inactive.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/grid/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/grid/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/inactive.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/inactive.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/inactive.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_receiver/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/error.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/error.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/error.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/error.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/inactive.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/inactive.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/inactive.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/network_transmitter/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/inactive.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/inactive.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/inactive.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/relay/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/relay/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/inactive.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/inactive.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/inactive.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/security_manager/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/black.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/black.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/black.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/brown.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/brown.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/brown.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/cyan.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/cyan.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/cyan.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/green.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/green.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/green.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/light_blue.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/light_blue.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/light_blue.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/light_gray.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/light_gray.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/light_gray.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/lime.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/lime.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/lime.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/magenta.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/magenta.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/magenta.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/orange.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/orange.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/orange.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/pink.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/pink.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/pink.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/purple.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/purple.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/purple.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/red.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/red.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/red.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/white.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/white.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/white.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/yellow.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/yellow.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/wireless_transmitter/yellow.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/black_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/blue_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/brown_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/cyan_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/green_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_blue_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/lime_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/magenta_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/orange_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/pink_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/purple_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/red_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/white_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_cable.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_cable.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_constructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_constructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_crafting_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_crafting_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_creative_controller.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_creative_controller.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_destructor.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_destructor.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_detector.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_detector.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_disk_interface.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_disk_interface.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_exporter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_exporter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_external_storage.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_external_storage.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_grid.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_grid.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_importer.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_importer.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_network_receiver.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_network_receiver.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_network_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_network_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_relay.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_relay.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_security_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_security_manager.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/assets/refinedstorage/models/item/yellow_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_creative_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_creative_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_creative_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_cable.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_cable.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_cable.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_constructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_constructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_constructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_controller.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_controller.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_controller.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_crafting_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_crafting_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_destructor.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_destructor.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_destructor.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_detector.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_detector.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_detector.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_disk_interface.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_disk_interface.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_exporter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_exporter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_exporter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_exporter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_external_storage.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_external_storage.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_external_storage.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_grid.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_grid.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_grid.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_importer.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_importer.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_importer.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_importer.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_network_receiver.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_network_receiver.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_network_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_network_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_relay.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_relay.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_relay.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_security_manager.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_security_manager.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_wireless_transmitter.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/cables.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/cables.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/cables.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/cables.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/constructors.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/constructors.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/constructors.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/constructors.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/controllers.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/controllers.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/controllers.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/controllers.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/crafting_grids.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/crafting_grids.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/crafting_grids.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/crafting_grids.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/creative_controllers.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/creative_controllers.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/creative_controllers.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/creative_controllers.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/destructors.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/destructors.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/destructors.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/destructors.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/detectors.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/detectors.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/detectors.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/detectors.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/disk_interfaces.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/disk_interfaces.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/disk_interfaces.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/disk_interfaces.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/exporters.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/exporters.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/exporters.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/exporters.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/external_storages.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/external_storages.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/external_storages.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/external_storages.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/fluid_storage_disks.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/fluid_storage_disks.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/fluid_storage_disks.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/fluid_storage_disks.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/grids.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/grids.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/grids.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/grids.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/importers.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/importers.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/importers.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/importers.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/network_receivers.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/network_receivers.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/network_receivers.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/network_receivers.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/network_transmitters.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/network_transmitters.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/network_transmitters.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/network_transmitters.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/relays.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/relays.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/relays.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/relays.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/security_managers.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/security_managers.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/security_managers.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/security_managers.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/storage_disks.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/storage_disks.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/storage_disks.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/storage_disks.json diff --git a/refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/wireless_transmitters.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/wireless_transmitters.json similarity index 100% rename from refinedstorage-platform-common/src/generated/resources/data/refinedstorage/tags/item/wireless_transmitters.json rename to refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/wireless_transmitters.json diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java new file mode 100644 index 000000000..b7a8be0fe --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java @@ -0,0 +1,143 @@ +package com.refinedmods.refinedstorage.common; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorScreen; +import com.refinedmods.refinedstorage.common.constructordestructor.DestructorScreen; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.content.KeyMappings; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.controller.ControllerScreen; +import com.refinedmods.refinedstorage.common.detector.DetectorScreen; +import com.refinedmods.refinedstorage.common.exporter.ExporterScreen; +import com.refinedmods.refinedstorage.common.grid.GridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.WirelessGridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.screen.CraftingGridScreen; +import com.refinedmods.refinedstorage.common.grid.screen.GridScreen; +import com.refinedmods.refinedstorage.common.grid.screen.hint.FluidGridInsertionHint; +import com.refinedmods.refinedstorage.common.iface.InterfaceScreen; +import com.refinedmods.refinedstorage.common.importer.ImporterScreen; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterScreen; +import com.refinedmods.refinedstorage.common.networking.RelayScreen; +import com.refinedmods.refinedstorage.common.security.FallbackSecurityCardScreen; +import com.refinedmods.refinedstorage.common.security.SecurityCardScreen; +import com.refinedmods.refinedstorage.common.security.SecurityManagerScreen; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.diskdrive.DiskDriveScreen; +import com.refinedmods.refinedstorage.common.storage.diskinterface.DiskInterfaceScreen; +import com.refinedmods.refinedstorage.common.storage.externalstorage.ExternalStorageScreen; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridScreen; +import com.refinedmods.refinedstorage.common.storage.storageblock.FluidStorageBlockScreen; +import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlockScreen; +import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorScreen; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResourceRendering; +import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeScreen; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterScreen; + +import net.minecraft.client.KeyMapping; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.gui.screens.inventory.MenuAccess; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.MenuType; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public abstract class AbstractClientModInitializer { + protected static void registerScreens(final ScreenRegistration registration) { + registration.register(Menus.INSTANCE.getDiskDrive(), DiskDriveScreen::new); + registration.register(Menus.INSTANCE.getGrid(), GridScreen::new); + registration.register(Menus.INSTANCE.getCraftingGrid(), CraftingGridScreen::new); + registration.register(Menus.INSTANCE.getWirelessGrid(), GridScreen::new); + registration.register(Menus.INSTANCE.getController(), ControllerScreen::new); + registration.register(Menus.INSTANCE.getItemStorage(), ItemStorageBlockScreen::new); + registration.register(Menus.INSTANCE.getFluidStorage(), FluidStorageBlockScreen::new); + registration.register(Menus.INSTANCE.getImporter(), ImporterScreen::new); + registration.register(Menus.INSTANCE.getExporter(), ExporterScreen::new); + registration.register(Menus.INSTANCE.getInterface(), InterfaceScreen::new); + registration.register(Menus.INSTANCE.getExternalStorage(), ExternalStorageScreen::new); + registration.register(Menus.INSTANCE.getDetector(), DetectorScreen::new); + registration.register(Menus.INSTANCE.getDestructor(), DestructorScreen::new); + registration.register(Menus.INSTANCE.getConstructor(), ConstructorScreen::new); + registration.register(Menus.INSTANCE.getRegulatorUpgrade(), RegulatorUpgradeScreen::new); + registration.register(Menus.INSTANCE.getWirelessTransmitter(), WirelessTransmitterScreen::new); + registration.register(Menus.INSTANCE.getStorageMonitor(), StorageMonitorScreen::new); + registration.register(Menus.INSTANCE.getNetworkTransmitter(), NetworkTransmitterScreen::new); + registration.register(Menus.INSTANCE.getPortableGridBlock(), PortableGridScreen::new); + registration.register(Menus.INSTANCE.getPortableGridItem(), PortableGridScreen::new); + registration.register(Menus.INSTANCE.getSecurityCard(), SecurityCardScreen::new); + registration.register(Menus.INSTANCE.getFallbackSecurityCard(), FallbackSecurityCardScreen::new); + registration.register(Menus.INSTANCE.getSecurityManager(), SecurityManagerScreen::new); + registration.register(Menus.INSTANCE.getRelay(), RelayScreen::new); + registration.register(Menus.INSTANCE.getDiskInterface(), DiskInterfaceScreen::new); + } + + protected static void registerAlternativeGridHints() { + RefinedStorageApi.INSTANCE.addAlternativeGridInsertionHint(new FluidGridInsertionHint()); + } + + protected static void registerResourceRendering() { + RefinedStorageApi.INSTANCE.registerResourceRendering(ItemResource.class, new ItemResourceRendering()); + RefinedStorageApi.INSTANCE.registerResourceRendering(FluidResource.class, new FluidResourceRendering()); + } + + protected static void handleInputEvents() { + final Player player = Minecraft.getInstance().player; + if (player == null) { + return; + } + final KeyMapping openWirelessGrid = KeyMappings.INSTANCE.getOpenWirelessGrid(); + while (openWirelessGrid != null && openWirelessGrid.consumeClick()) { + RefinedStorageApi.INSTANCE.useSlotReferencedItem( + player, + Items.INSTANCE.getWirelessGrid(), + Items.INSTANCE.getCreativeWirelessGrid() + ); + } + final KeyMapping openPortableGrid = KeyMappings.INSTANCE.getOpenPortableGrid(); + while (openPortableGrid != null && openPortableGrid.consumeClick()) { + RefinedStorageApi.INSTANCE.useSlotReferencedItem( + player, + Items.INSTANCE.getPortableGrid(), + Items.INSTANCE.getCreativePortableGrid() + ); + } + } + + protected static void registerDiskModels() { + final ResourceLocation diskModel = createIdentifier("block/disk/disk"); + for (final ItemStorageVariant variant : ItemStorageVariant.values()) { + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().registerDiskModel( + Items.INSTANCE.getItemStorageDisk(variant), + diskModel + ); + } + + final ResourceLocation fluidDiskModel = createIdentifier("block/disk/fluid_disk"); + for (final FluidStorageVariant variant : FluidStorageVariant.values()) { + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().registerDiskModel( + Items.INSTANCE.getFluidStorageDisk(variant), + fluidDiskModel + ); + } + } + + @FunctionalInterface + public interface ScreenRegistration { + > void register(MenuType type, + ScreenConstructor + factory); + } + + @FunctionalInterface + public interface ScreenConstructor> { + U create(T menu, Inventory inventory, Component title); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java new file mode 100644 index 000000000..5780792be --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java @@ -0,0 +1,852 @@ +package com.refinedmods.refinedstorage.common; + +import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; +import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyNetworkComponentImpl; +import com.refinedmods.refinedstorage.api.network.impl.node.GraphNetworkComponentImpl; +import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage.api.network.impl.security.SecurityNetworkComponentImpl; +import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent; +import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApiProxy; +import com.refinedmods.refinedstorage.common.api.security.PlatformSecurityNetworkComponent; +import com.refinedmods.refinedstorage.common.api.upgrade.AbstractUpgradeItem; +import com.refinedmods.refinedstorage.common.configurationcard.ConfigurationCardItem; +import com.refinedmods.refinedstorage.common.configurationcard.ConfigurationCardState; +import com.refinedmods.refinedstorage.common.constructordestructor.BlockBreakDestructorStrategyFactory; +import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorBlockEntity; +import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorContainerMenu; +import com.refinedmods.refinedstorage.common.constructordestructor.DestructorBlockEntity; +import com.refinedmods.refinedstorage.common.constructordestructor.DestructorContainerMenu; +import com.refinedmods.refinedstorage.common.constructordestructor.FluidBreakDestructorStrategyFactory; +import com.refinedmods.refinedstorage.common.constructordestructor.ItemDropConstructorStrategyFactory; +import com.refinedmods.refinedstorage.common.constructordestructor.ItemPickupDestructorStrategyFactory; +import com.refinedmods.refinedstorage.common.constructordestructor.PlaceBlockConstructorStrategy; +import com.refinedmods.refinedstorage.common.constructordestructor.PlaceFireworksConstructorStrategy; +import com.refinedmods.refinedstorage.common.constructordestructor.PlaceFluidConstructorStrategy; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.BlockEntityTypeFactory; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.ContentIds; +import com.refinedmods.refinedstorage.common.content.DataComponents; +import com.refinedmods.refinedstorage.common.content.ExtendedMenuTypeFactory; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.content.LootFunctions; +import com.refinedmods.refinedstorage.common.content.MenuTypeFactory; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.content.RegistryCallback; +import com.refinedmods.refinedstorage.common.content.Sounds; +import com.refinedmods.refinedstorage.common.controller.ControllerBlockEntity; +import com.refinedmods.refinedstorage.common.controller.ControllerContainerMenu; +import com.refinedmods.refinedstorage.common.controller.ControllerData; +import com.refinedmods.refinedstorage.common.controller.ControllerType; +import com.refinedmods.refinedstorage.common.detector.DetectorBlockEntity; +import com.refinedmods.refinedstorage.common.detector.DetectorContainerMenu; +import com.refinedmods.refinedstorage.common.exporter.ExporterBlockEntity; +import com.refinedmods.refinedstorage.common.exporter.ExporterContainerMenu; +import com.refinedmods.refinedstorage.common.grid.CraftingGridBlockEntity; +import com.refinedmods.refinedstorage.common.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.GridBlockEntity; +import com.refinedmods.refinedstorage.common.grid.GridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.GridData; +import com.refinedmods.refinedstorage.common.grid.PortableGridData; +import com.refinedmods.refinedstorage.common.grid.WirelessGridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.WirelessGridData; +import com.refinedmods.refinedstorage.common.iface.InterfaceBlock; +import com.refinedmods.refinedstorage.common.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.iface.InterfaceContainerMenu; +import com.refinedmods.refinedstorage.common.iface.InterfaceData; +import com.refinedmods.refinedstorage.common.importer.ImporterBlockEntity; +import com.refinedmods.refinedstorage.common.importer.ImporterContainerMenu; +import com.refinedmods.refinedstorage.common.misc.ProcessorItem; +import com.refinedmods.refinedstorage.common.misc.WrenchItem; +import com.refinedmods.refinedstorage.common.networking.NetworkCardItem; +import com.refinedmods.refinedstorage.common.networking.NetworkReceiverBlockEntity; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterBlockEntity; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterData; +import com.refinedmods.refinedstorage.common.networking.RelayBlockEntity; +import com.refinedmods.refinedstorage.common.networking.RelayContainerMenu; +import com.refinedmods.refinedstorage.common.security.BuiltinPermission; +import com.refinedmods.refinedstorage.common.security.FallbackSecurityCardContainerMenu; +import com.refinedmods.refinedstorage.common.security.PlatformSecurityNetworkComponentImpl; +import com.refinedmods.refinedstorage.common.security.PlayerBoundSecurityCardData; +import com.refinedmods.refinedstorage.common.security.SecurityCardBoundPlayer; +import com.refinedmods.refinedstorage.common.security.SecurityCardContainerMenu; +import com.refinedmods.refinedstorage.common.security.SecurityCardData; +import com.refinedmods.refinedstorage.common.security.SecurityCardPermissions; +import com.refinedmods.refinedstorage.common.security.SecurityManagerBlockEntity; +import com.refinedmods.refinedstorage.common.security.SecurityManagerContainerMenu; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.StorageTypes; +import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage.common.storage.diskdrive.DiskDriveBlock; +import com.refinedmods.refinedstorage.common.storage.diskdrive.DiskDriveContainerMenu; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.storage.diskinterface.DiskInterfaceContainerMenu; +import com.refinedmods.refinedstorage.common.storage.externalstorage.ExternalStorageBlockEntity; +import com.refinedmods.refinedstorage.common.storage.externalstorage.ExternalStorageContainerMenu; +import com.refinedmods.refinedstorage.common.storage.portablegrid.AbstractPortableGridBlockEntity; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlock; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockContainerMenu; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridItemContainerMenu; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridLootItemFunction; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridType; +import com.refinedmods.refinedstorage.common.storage.storageblock.FluidStorageBlock; +import com.refinedmods.refinedstorage.common.storage.storageblock.FluidStorageBlockBlockEntity; +import com.refinedmods.refinedstorage.common.storage.storageblock.FluidStorageBlockBlockItem; +import com.refinedmods.refinedstorage.common.storage.storageblock.FluidStorageBlockContainerMenu; +import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlock; +import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlockBlockEntity; +import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlockBlockItem; +import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlockContainerMenu; +import com.refinedmods.refinedstorage.common.storage.storageblock.StorageBlockData; +import com.refinedmods.refinedstorage.common.storage.storageblock.StorageBlockLootItemFunction; +import com.refinedmods.refinedstorage.common.storage.storagedisk.FluidStorageDiskItem; +import com.refinedmods.refinedstorage.common.storage.storagedisk.ItemStorageDiskItem; +import com.refinedmods.refinedstorage.common.storagemonitor.FluidStorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage.common.storagemonitor.FluidStorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage.common.storagemonitor.ItemStorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage.common.storagemonitor.ItemStorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorBlock; +import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorBlockEntity; +import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorContainerMenu; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.SimpleBlock; +import com.refinedmods.refinedstorage.common.support.SimpleItem; +import com.refinedmods.refinedstorage.common.support.containermenu.SingleAmountData; +import com.refinedmods.refinedstorage.common.support.energy.EnergyLootItemFunction; +import com.refinedmods.refinedstorage.common.support.network.BaseNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.network.component.PlatformStorageNetworkComponent; +import com.refinedmods.refinedstorage.common.support.resource.FluidResourceContainerInsertStrategy; +import com.refinedmods.refinedstorage.common.support.resource.FluidResourceFactory; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; +import com.refinedmods.refinedstorage.common.support.slotreference.InventorySlotReferenceFactory; +import com.refinedmods.refinedstorage.common.upgrade.FortuneUpgradeItem; +import com.refinedmods.refinedstorage.common.upgrade.RangeUpgradeItem; +import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeContainerMenu; +import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeState; +import com.refinedmods.refinedstorage.common.upgrade.SimpleUpgradeItem; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeWithEnchantedBookRecipeSerializer; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.BaseWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.CreativeRangeUpgradeWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.RangeUpgradeWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterBlockEntity; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterContainerMenu; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterData; + +import java.util.Optional; +import java.util.UUID; +import java.util.function.BiFunction; +import java.util.function.Supplier; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.core.UUIDUtil; +import net.minecraft.core.component.DataComponentType; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.storage.loot.functions.LootItemFunctionType; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public abstract class AbstractModInitializer { + private static final String ITEM_REGISTRY_KEY = "item"; + private static final String FLUID_REGISTRY_KEY = "fluid"; + + protected final void initializePlatformApi() { + ((RefinedStorageApiProxy) RefinedStorageApi.INSTANCE).setDelegate(new RefinedStorageApiImpl()); + registerStorageTypes(); + registerResourceTypes(); + registerAdditionalResourceFactories(); + registerResourceContainerInsertStrategies(); + registerDestructorStrategyFactories(); + registerConstructorStrategyFactories(); + registerStorageMonitorInsertionStrategies(); + registerStorageMonitorExtractionStrategies(); + registerNetworkComponents(); + registerWirelessTransmitterRangeModifiers(); + registerPermissions(); + registerInventorySlotReference(); + } + + private void registerStorageTypes() { + RefinedStorageApi.INSTANCE.getStorageTypeRegistry().register( + createIdentifier(ITEM_REGISTRY_KEY), + StorageTypes.ITEM + ); + RefinedStorageApi.INSTANCE.getStorageTypeRegistry().register( + createIdentifier(FLUID_REGISTRY_KEY), + StorageTypes.FLUID + ); + } + + private void registerResourceTypes() { + RefinedStorageApi.INSTANCE.getResourceTypeRegistry().register( + createIdentifier(ITEM_REGISTRY_KEY), + ResourceTypes.ITEM + ); + RefinedStorageApi.INSTANCE.getResourceTypeRegistry().register( + createIdentifier(FLUID_REGISTRY_KEY), + ResourceTypes.FLUID + ); + } + + private void registerAdditionalResourceFactories() { + RefinedStorageApi.INSTANCE.addResourceFactory(new FluidResourceFactory()); + } + + private void registerResourceContainerInsertStrategies() { + RefinedStorageApi.INSTANCE.addResourceContainerInsertStrategy(new FluidResourceContainerInsertStrategy()); + } + + private void registerDestructorStrategyFactories() { + RefinedStorageApi.INSTANCE.addDestructorStrategyFactory(new BlockBreakDestructorStrategyFactory()); + RefinedStorageApi.INSTANCE.addDestructorStrategyFactory(new FluidBreakDestructorStrategyFactory()); + RefinedStorageApi.INSTANCE.addDestructorStrategyFactory(new ItemPickupDestructorStrategyFactory()); + } + + private void registerConstructorStrategyFactories() { + RefinedStorageApi.INSTANCE.addConstructorStrategyFactory((level, pos, direction, upgradeState, dropItems) -> + Optional.of(new PlaceBlockConstructorStrategy(level, pos, direction))); + RefinedStorageApi.INSTANCE.addConstructorStrategyFactory((level, pos, direction, upgradeState, dropItems) -> + Optional.of(new PlaceFireworksConstructorStrategy(level, pos, direction))); + RefinedStorageApi.INSTANCE.addConstructorStrategyFactory((level, pos, direction, upgradeState, dropItems) -> + Optional.of(new PlaceFluidConstructorStrategy(level, pos, direction))); + RefinedStorageApi.INSTANCE.addConstructorStrategyFactory(new ItemDropConstructorStrategyFactory()); + } + + private void registerStorageMonitorInsertionStrategies() { + RefinedStorageApi.INSTANCE.addStorageMonitorInsertionStrategy(new ItemStorageMonitorInsertionStrategy()); + RefinedStorageApi.INSTANCE.addStorageMonitorInsertionStrategy(new FluidStorageMonitorInsertionStrategy()); + } + + private void registerStorageMonitorExtractionStrategies() { + RefinedStorageApi.INSTANCE.addStorageMonitorExtractionStrategy(new ItemStorageMonitorExtractionStrategy()); + RefinedStorageApi.INSTANCE.addStorageMonitorExtractionStrategy(new FluidStorageMonitorExtractionStrategy()); + } + + private void registerNetworkComponents() { + RefinedStorageApi.INSTANCE.getNetworkComponentMapFactory().addFactory( + EnergyNetworkComponent.class, + network -> new EnergyNetworkComponentImpl() + ); + RefinedStorageApi.INSTANCE.getNetworkComponentMapFactory().addFactory( + GraphNetworkComponent.class, + GraphNetworkComponentImpl::new + ); + RefinedStorageApi.INSTANCE.getNetworkComponentMapFactory().addFactory( + StorageNetworkComponent.class, + network -> new PlatformStorageNetworkComponent() + ); + RefinedStorageApi.INSTANCE.getNetworkComponentMapFactory().addFactory( + PlatformSecurityNetworkComponent.class, + network -> new PlatformSecurityNetworkComponentImpl( + RefinedStorageApi.INSTANCE.createDefaultSecurityPolicy() + ) + ); + RefinedStorageApi.INSTANCE.getNetworkComponentMapFactory().addFactory( + SecurityNetworkComponent.class, + network -> new SecurityNetworkComponentImpl(RefinedStorageApi.INSTANCE.createDefaultSecurityPolicy()) + ); + } + + private void registerWirelessTransmitterRangeModifiers() { + RefinedStorageApi.INSTANCE.addWirelessTransmitterRangeModifier(new BaseWirelessTransmitterRangeModifier()); + RefinedStorageApi.INSTANCE.addWirelessTransmitterRangeModifier( + new RangeUpgradeWirelessTransmitterRangeModifier() + ); + RefinedStorageApi.INSTANCE.addWirelessTransmitterRangeModifier( + new CreativeRangeUpgradeWirelessTransmitterRangeModifier() + ); + } + + private void registerPermissions() { + for (final BuiltinPermission permission : BuiltinPermission.values()) { + RefinedStorageApi.INSTANCE.getPermissionRegistry().register(permission.getId(), permission); + } + } + + protected final void registerBlocks( + final RegistryCallback callback, + final BiFunction diskDriveBlockEntityFactory, + final BiFunction portableGridBlockEntityFactory, + final BiFunction creativePortableGridBlockEntityFactory, + final BiFunction diskInterfaceBlockEntityFactory + ) { + Blocks.INSTANCE.setQuartzEnrichedIronBlock(callback.register( + ContentIds.QUARTZ_ENRICHED_IRON_BLOCK, SimpleBlock::new)); + Blocks.INSTANCE.setQuartzEnrichedCopperBlock( + callback.register(ContentIds.QUARTZ_ENRICHED_COPPER_BLOCK, SimpleBlock::new)); + Blocks.INSTANCE.setDiskDrive( + callback.register(ContentIds.DISK_DRIVE, () -> new DiskDriveBlock(diskDriveBlockEntityFactory)) + ); + Blocks.INSTANCE.setMachineCasing(callback.register(ContentIds.MACHINE_CASING, SimpleBlock::new)); + for (final ItemStorageVariant variant : ItemStorageVariant.values()) { + Blocks.INSTANCE.setItemStorageBlock(variant, callback.register( + ContentIds.forItemStorageBlock(variant), + () -> new ItemStorageBlock(variant) + )); + } + for (final FluidStorageVariant variant : FluidStorageVariant.values()) { + Blocks.INSTANCE.setFluidStorageBlock(variant, callback.register( + ContentIds.forFluidStorageBlock(variant), + () -> new FluidStorageBlock(variant) + )); + } + Blocks.INSTANCE.getController().registerBlocks(callback); + Blocks.INSTANCE.getCreativeController().registerBlocks(callback); + Blocks.INSTANCE.getCable().registerBlocks(callback); + Blocks.INSTANCE.getGrid().registerBlocks(callback); + Blocks.INSTANCE.getCraftingGrid().registerBlocks(callback); + Blocks.INSTANCE.getDetector().registerBlocks(callback); + Blocks.INSTANCE.getImporter().registerBlocks(callback); + Blocks.INSTANCE.getExporter().registerBlocks(callback); + Blocks.INSTANCE.getExternalStorage().registerBlocks(callback); + Blocks.INSTANCE.getConstructor().registerBlocks(callback); + Blocks.INSTANCE.getDestructor().registerBlocks(callback); + Blocks.INSTANCE.setInterface(callback.register(ContentIds.INTERFACE, InterfaceBlock::new)); + Blocks.INSTANCE.getWirelessTransmitter().registerBlocks(callback); + Blocks.INSTANCE.setStorageMonitor(callback.register(ContentIds.STORAGE_MONITOR, StorageMonitorBlock::new)); + Blocks.INSTANCE.getNetworkReceiver().registerBlocks(callback); + Blocks.INSTANCE.getNetworkTransmitter().registerBlocks(callback); + Blocks.INSTANCE.setPortableGrid(callback.register(ContentIds.PORTABLE_GRID, () -> new PortableGridBlock( + PortableGridType.NORMAL, + portableGridBlockEntityFactory + ))); + Blocks.INSTANCE.setCreativePortableGrid( + callback.register(ContentIds.CREATIVE_PORTABLE_GRID, () -> new PortableGridBlock( + PortableGridType.CREATIVE, + creativePortableGridBlockEntityFactory + ))); + Blocks.INSTANCE.getSecurityManager().registerBlocks(callback); + Blocks.INSTANCE.getRelay().registerBlocks(callback); + Blocks.INSTANCE.setDiskInterface(diskInterfaceBlockEntityFactory).registerBlocks(callback); + } + + protected final void registerItems(final RegistryCallback callback) { + registerSimpleItems(callback); + Blocks.INSTANCE.getGrid().registerItems(callback); + Blocks.INSTANCE.getCraftingGrid().registerItems(callback); + Blocks.INSTANCE.getCable().registerItems(callback, Items.INSTANCE::addCable); + Blocks.INSTANCE.getController().registerItems(callback, Items.INSTANCE::addController); + Blocks.INSTANCE.getCreativeController().registerItems(callback, Items.INSTANCE::addCreativeController); + Blocks.INSTANCE.getDetector().registerItems(callback, Items.INSTANCE::addDetector); + Blocks.INSTANCE.getImporter().registerItems(callback, Items.INSTANCE::addImporter); + Blocks.INSTANCE.getExporter().registerItems(callback, Items.INSTANCE::addExporter); + Blocks.INSTANCE.getExternalStorage().registerItems(callback, Items.INSTANCE::addExternalStorage); + Blocks.INSTANCE.getConstructor().registerItems(callback, Items.INSTANCE::addConstructor); + Blocks.INSTANCE.getDestructor().registerItems(callback, Items.INSTANCE::addDestructor); + Blocks.INSTANCE.getWirelessTransmitter().registerItems(callback, Items.INSTANCE::addWirelessTransmitter); + Blocks.INSTANCE.getNetworkReceiver().registerItems(callback, Items.INSTANCE::addNetworkReceiver); + Blocks.INSTANCE.getNetworkTransmitter().registerItems(callback, Items.INSTANCE::addNetworkTransmitter); + Blocks.INSTANCE.getSecurityManager().registerItems(callback, Items.INSTANCE::addSecurityManager); + Blocks.INSTANCE.getRelay().registerItems(callback, Items.INSTANCE::addRelay); + Blocks.INSTANCE.getDiskInterface().registerItems(callback, Items.INSTANCE::addDiskInterface); + registerStorageItems(callback); + registerUpgrades(callback); + } + + private void registerSimpleItems(final RegistryCallback callback) { + Items.INSTANCE.setQuartzEnrichedIron(callback.register(ContentIds.QUARTZ_ENRICHED_IRON, SimpleItem::new)); + Items.INSTANCE.setQuartzEnrichedCopper(callback.register(ContentIds.QUARTZ_ENRICHED_COPPER, SimpleItem::new)); + callback.register( + ContentIds.QUARTZ_ENRICHED_IRON_BLOCK, + () -> new BaseBlockItem(Blocks.INSTANCE.getQuartzEnrichedIronBlock()) + ); + callback.register( + ContentIds.QUARTZ_ENRICHED_COPPER_BLOCK, + () -> new BaseBlockItem(Blocks.INSTANCE.getQuartzEnrichedCopperBlock()) + ); + Items.INSTANCE.setSilicon(callback.register(ContentIds.SILICON, SimpleItem::new)); + Items.INSTANCE.setProcessorBinding(callback.register(ContentIds.PROCESSOR_BINDING, SimpleItem::new)); + callback.register(ContentIds.DISK_DRIVE, () -> Blocks.INSTANCE.getDiskDrive().createBlockItem()); + Items.INSTANCE.setWrench(callback.register(ContentIds.WRENCH, WrenchItem::new)); + Items.INSTANCE.setStorageHousing(callback.register(ContentIds.STORAGE_HOUSING, SimpleItem::new)); + callback.register(ContentIds.MACHINE_CASING, () -> new BaseBlockItem(Blocks.INSTANCE.getMachineCasing())); + callback.register(ContentIds.STORAGE_MONITOR, () -> Blocks.INSTANCE.getStorageMonitor().createBlockItem()); + callback.register(ContentIds.INTERFACE, () -> Blocks.INSTANCE.getInterface().createBlockItem()); + Items.INSTANCE.setConstructionCore(callback.register(ContentIds.CONSTRUCTION_CORE, SimpleItem::new)); + Items.INSTANCE.setDestructionCore(callback.register(ContentIds.DESTRUCTION_CORE, SimpleItem::new)); + for (final ProcessorItem.Type type : ProcessorItem.Type.values()) { + registerProcessor(callback, type); + } + Items.INSTANCE.setConfigurationCard(callback.register( + ContentIds.CONFIGURATION_CARD, + ConfigurationCardItem::new + )); + Items.INSTANCE.setNetworkCard(callback.register(ContentIds.NETWORK_CARD, NetworkCardItem::new)); + } + + private void registerProcessor(final RegistryCallback callback, final ProcessorItem.Type type) { + Items.INSTANCE.setProcessor(type, callback.register(ContentIds.forProcessor(type), ProcessorItem::new)); + } + + private void registerStorageItems(final RegistryCallback callback) { + for (final ItemStorageVariant variant : ItemStorageVariant.values()) { + registerItemStorageItems(callback, variant); + } + for (final FluidStorageVariant variant : FluidStorageVariant.values()) { + registerFluidStorageItems(callback, variant); + } + } + + private void registerItemStorageItems(final RegistryCallback callback, + final ItemStorageVariant variant) { + if (variant != ItemStorageVariant.CREATIVE) { + Items.INSTANCE.setItemStoragePart(variant, callback.register( + ContentIds.forItemStoragePart(variant), + SimpleItem::new) + ); + } + Items.INSTANCE.setItemStorageDisk(variant, callback.register( + ContentIds.forStorageDisk(variant), + () -> new ItemStorageDiskItem(variant) + )); + callback.register( + ContentIds.forItemStorageBlock(variant), + () -> new ItemStorageBlockBlockItem(Blocks.INSTANCE.getItemStorageBlock(variant), variant) + ); + } + + private void registerFluidStorageItems(final RegistryCallback callback, + final FluidStorageVariant variant) { + if (variant != FluidStorageVariant.CREATIVE) { + Items.INSTANCE.setFluidStoragePart(variant, callback.register( + ContentIds.forFluidStoragePart(variant), + SimpleItem::new) + ); + } + Items.INSTANCE.setFluidStorageDisk(variant, callback.register( + ContentIds.forFluidStorageDisk(variant), + () -> new FluidStorageDiskItem(variant) + )); + callback.register( + ContentIds.forFluidStorageBlock(variant), + () -> new FluidStorageBlockBlockItem(Blocks.INSTANCE.getFluidStorageBlock(variant), variant) + ); + } + + private void registerUpgrades(final RegistryCallback callback) { + Items.INSTANCE.setUpgrade(callback.register( + ContentIds.UPGRADE, + SimpleItem::new + )); + final Supplier speedUpgrade = callback.register( + ContentIds.SPEED_UPGRADE, + SimpleUpgradeItem::speedUpgrade + ); + Items.INSTANCE.setSpeedUpgrade(speedUpgrade); + final Supplier stackUpgrade = callback.register( + ContentIds.STACK_UPGRADE, + SimpleUpgradeItem::stackUpgrade + ); + Items.INSTANCE.setStackUpgrade(stackUpgrade); + final Supplier fortune1Upgrade = callback.register( + ContentIds.FORTUNE_1_UPGRADE, + () -> new FortuneUpgradeItem(RefinedStorageApi.INSTANCE.getUpgradeRegistry(), 1) + ); + Items.INSTANCE.setFortune1Upgrade(fortune1Upgrade); + final Supplier fortune2Upgrade = callback.register( + ContentIds.FORTUNE_2_UPGRADE, + () -> new FortuneUpgradeItem(RefinedStorageApi.INSTANCE.getUpgradeRegistry(), 2) + ); + Items.INSTANCE.setFortune2Upgrade(fortune2Upgrade); + final Supplier fortune3Upgrade = callback.register( + ContentIds.FORTUNE_3_UPGRADE, + () -> new FortuneUpgradeItem(RefinedStorageApi.INSTANCE.getUpgradeRegistry(), 3) + ); + Items.INSTANCE.setFortune3Upgrade(fortune3Upgrade); + final Supplier silkTouchUpgrade = callback.register( + ContentIds.SILK_TOUCH_UPGRADE, + SimpleUpgradeItem::silkTouchUpgrade + ); + Items.INSTANCE.setSilkTouchUpgrade(silkTouchUpgrade); + Items.INSTANCE.setRangeUpgrade(callback.register( + ContentIds.RANGE_UPGRADE, + () -> new RangeUpgradeItem(RefinedStorageApi.INSTANCE.getUpgradeRegistry(), false) + )); + Items.INSTANCE.setCreativeRangeUpgrade(callback.register( + ContentIds.CREATIVE_RANGE_UPGRADE, + () -> new RangeUpgradeItem(RefinedStorageApi.INSTANCE.getUpgradeRegistry(), true) + )); + } + + protected final void registerUpgradeMappings() { + RefinedStorageApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.IMPORTER) + .add(Items.INSTANCE.getSpeedUpgrade(), 4) + .add(Items.INSTANCE.getStackUpgrade()) + .add(Items.INSTANCE.getRegulatorUpgrade()); + + RefinedStorageApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.EXPORTER) + .add(Items.INSTANCE.getSpeedUpgrade(), 4) + .add(Items.INSTANCE.getStackUpgrade()) + .add(Items.INSTANCE.getRegulatorUpgrade()); + + RefinedStorageApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.DESTRUCTOR) + .add(Items.INSTANCE.getSpeedUpgrade(), 4) + .add(Items.INSTANCE.getFortune1Upgrade()) + .add(Items.INSTANCE.getFortune2Upgrade()) + .add(Items.INSTANCE.getFortune3Upgrade()) + .add(Items.INSTANCE.getSilkTouchUpgrade()); + + RefinedStorageApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.CONSTRUCTOR) + .add(Items.INSTANCE.getSpeedUpgrade(), 4) + .add(Items.INSTANCE.getStackUpgrade()); + + RefinedStorageApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.WIRELESS_TRANSMITTER) + .add(Items.INSTANCE.getRangeUpgrade(), 4) + .add(Items.INSTANCE.getCreativeRangeUpgrade()); + + RefinedStorageApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.DISK_INTERFACE) + .add(Items.INSTANCE.getSpeedUpgrade(), 4) + .add(Items.INSTANCE.getStackUpgrade()); + } + + protected final void registerBlockEntities( + final RegistryCallback> callback, + final BlockEntityTypeFactory typeFactory, + final BlockEntityTypeFactory.BlockEntitySupplier diskDriveBlockEntitySupplier, + final BlockEntityTypeFactory.BlockEntitySupplier + portableGridBlockEntitySupplier, + final BlockEntityTypeFactory.BlockEntitySupplier + creativePortableGridBlockEntitySupplier, + final BlockEntityTypeFactory.BlockEntitySupplier + diskInterfaceBlockEntitySupplier + ) { + BlockEntities.INSTANCE.setCable(callback.register( + ContentIds.CABLE, + () -> typeFactory.create((pos, state) -> new BaseNetworkNodeContainerBlockEntity<>( + BlockEntities.INSTANCE.getCable(), + pos, + state, + new SimpleNetworkNode(Platform.INSTANCE.getConfig().getCable().getEnergyUsage()) + ), Blocks.INSTANCE.getCable().toArray()) + )); + BlockEntities.INSTANCE.setController(callback.register( + ContentIds.CONTROLLER, + () -> typeFactory.create( + (pos, state) -> new ControllerBlockEntity(ControllerType.NORMAL, pos, state), + Blocks.INSTANCE.getController().toArray() + ) + )); + BlockEntities.INSTANCE.setCreativeController(callback.register( + ContentIds.CREATIVE_CONTROLLER, + () -> typeFactory.create( + (pos, state) -> new ControllerBlockEntity(ControllerType.CREATIVE, pos, state), + Blocks.INSTANCE.getCreativeController().toArray() + ) + )); + BlockEntities.INSTANCE.setDiskDrive(callback.register( + ContentIds.DISK_DRIVE, + () -> typeFactory.create(diskDriveBlockEntitySupplier, Blocks.INSTANCE.getDiskDrive()) + )); + BlockEntities.INSTANCE.setGrid(callback.register( + ContentIds.GRID, + () -> typeFactory.create(GridBlockEntity::new, Blocks.INSTANCE.getGrid().toArray()) + )); + BlockEntities.INSTANCE.setCraftingGrid(callback.register( + ContentIds.CRAFTING_GRID, + () -> typeFactory.create(CraftingGridBlockEntity::new, Blocks.INSTANCE.getCraftingGrid().toArray()) + )); + for (final ItemStorageVariant variant : ItemStorageVariant.values()) { + BlockEntities.INSTANCE.setItemStorageBlock(variant, callback.register( + ContentIds.forItemStorageBlock(variant), + () -> typeFactory.create( + (pos, state) -> new ItemStorageBlockBlockEntity(pos, state, variant), + Blocks.INSTANCE.getItemStorageBlock(variant) + ) + )); + } + for (final FluidStorageVariant variant : FluidStorageVariant.values()) { + BlockEntities.INSTANCE.setFluidStorageBlock(variant, callback.register( + ContentIds.forFluidStorageBlock(variant), + () -> typeFactory.create( + (pos, state) -> new FluidStorageBlockBlockEntity(pos, state, variant), + Blocks.INSTANCE.getFluidStorageBlock(variant) + ) + )); + } + BlockEntities.INSTANCE.setImporter(callback.register( + ContentIds.IMPORTER, + () -> typeFactory.create(ImporterBlockEntity::new, Blocks.INSTANCE.getImporter().toArray()) + + )); + BlockEntities.INSTANCE.setExporter(callback.register( + ContentIds.EXPORTER, + () -> typeFactory.create(ExporterBlockEntity::new, Blocks.INSTANCE.getExporter().toArray()) + + )); + BlockEntities.INSTANCE.setInterface(callback.register( + ContentIds.INTERFACE, + () -> typeFactory.create(InterfaceBlockEntity::new, Blocks.INSTANCE.getInterface()) + )); + BlockEntities.INSTANCE.setExternalStorage(callback.register( + ContentIds.EXTERNAL_STORAGE, + () -> typeFactory.create(ExternalStorageBlockEntity::new, Blocks.INSTANCE.getExternalStorage().toArray()) + )); + BlockEntities.INSTANCE.setDetector(callback.register( + ContentIds.DETECTOR, + () -> typeFactory.create(DetectorBlockEntity::new, Blocks.INSTANCE.getDetector().toArray()) + )); + BlockEntities.INSTANCE.setConstructor(callback.register( + ContentIds.CONSTRUCTOR, + () -> typeFactory.create(ConstructorBlockEntity::new, Blocks.INSTANCE.getConstructor().toArray()) + )); + BlockEntities.INSTANCE.setDestructor(callback.register( + ContentIds.DESTRUCTOR, + () -> typeFactory.create(DestructorBlockEntity::new, Blocks.INSTANCE.getDestructor().toArray()) + )); + BlockEntities.INSTANCE.setWirelessTransmitter(callback.register( + ContentIds.WIRELESS_TRANSMITTER, + () -> typeFactory.create( + WirelessTransmitterBlockEntity::new, + Blocks.INSTANCE.getWirelessTransmitter().toArray() + ) + )); + BlockEntities.INSTANCE.setStorageMonitor(callback.register( + ContentIds.STORAGE_MONITOR, + () -> typeFactory.create(StorageMonitorBlockEntity::new, Blocks.INSTANCE.getStorageMonitor()) + )); + BlockEntities.INSTANCE.setNetworkReceiver(callback.register( + ContentIds.NETWORK_RECEIVER, + () -> typeFactory.create(NetworkReceiverBlockEntity::new, Blocks.INSTANCE.getNetworkReceiver().toArray()) + )); + BlockEntities.INSTANCE.setNetworkTransmitter(callback.register( + ContentIds.NETWORK_TRANSMITTER, + () -> typeFactory.create( + NetworkTransmitterBlockEntity::new, + Blocks.INSTANCE.getNetworkTransmitter().toArray() + ) + )); + BlockEntities.INSTANCE.setPortableGrid(callback.register( + ContentIds.PORTABLE_GRID, + () -> typeFactory.create(portableGridBlockEntitySupplier::create, Blocks.INSTANCE.getPortableGrid()) + )); + BlockEntities.INSTANCE.setCreativePortableGrid(callback.register( + ContentIds.CREATIVE_PORTABLE_GRID, + () -> typeFactory.create( + creativePortableGridBlockEntitySupplier::create, + Blocks.INSTANCE.getCreativePortableGrid() + ) + )); + BlockEntities.INSTANCE.setSecurityManager(callback.register( + ContentIds.SECURITY_MANAGER, + () -> typeFactory.create( + SecurityManagerBlockEntity::new, + Blocks.INSTANCE.getSecurityManager().toArray() + ) + )); + BlockEntities.INSTANCE.setRelay(callback.register( + ContentIds.RELAY, + () -> typeFactory.create(RelayBlockEntity::new, Blocks.INSTANCE.getRelay().toArray()) + )); + BlockEntities.INSTANCE.setDiskInterface(callback.register( + ContentIds.DISK_INTERFACE, + () -> typeFactory.create(diskInterfaceBlockEntitySupplier, Blocks.INSTANCE.getDiskInterface().toArray()) + )); + } + + protected final void registerMenus(final RegistryCallback> callback, + final MenuTypeFactory menuTypeFactory, + final ExtendedMenuTypeFactory extendedMenuTypeFactory) { + Menus.INSTANCE.setController(callback.register( + ContentIds.CONTROLLER, + () -> extendedMenuTypeFactory.create(ControllerContainerMenu::new, ControllerData.STREAM_CODEC) + )); + Menus.INSTANCE.setDiskDrive(callback.register( + ContentIds.DISK_DRIVE, + () -> extendedMenuTypeFactory.create(DiskDriveContainerMenu::new, ResourceContainerData.STREAM_CODEC) + )); + Menus.INSTANCE.setGrid(callback.register( + ContentIds.GRID, + () -> extendedMenuTypeFactory.create(GridContainerMenu::new, GridData.STREAM_CODEC) + )); + Menus.INSTANCE.setCraftingGrid(callback.register( + ContentIds.CRAFTING_GRID, + () -> extendedMenuTypeFactory.create(CraftingGridContainerMenu::new, GridData.STREAM_CODEC) + )); + Menus.INSTANCE.setWirelessGrid(callback.register( + ContentIds.WIRELESS_GRID, + () -> extendedMenuTypeFactory.create(WirelessGridContainerMenu::new, WirelessGridData.STREAM_CODEC) + )); + Menus.INSTANCE.setItemStorage(callback.register( + ContentIds.ITEM_STORAGE_BLOCK, + () -> extendedMenuTypeFactory.create(ItemStorageBlockContainerMenu::new, StorageBlockData.STREAM_CODEC) + )); + Menus.INSTANCE.setFluidStorage(callback.register( + ContentIds.FLUID_STORAGE_BLOCK, + () -> extendedMenuTypeFactory.create(FluidStorageBlockContainerMenu::new, StorageBlockData.STREAM_CODEC) + )); + Menus.INSTANCE.setImporter(callback.register( + ContentIds.IMPORTER, + () -> extendedMenuTypeFactory.create(ImporterContainerMenu::new, ResourceContainerData.STREAM_CODEC) + )); + Menus.INSTANCE.setExporter(callback.register( + ContentIds.EXPORTER, + () -> extendedMenuTypeFactory.create(ExporterContainerMenu::new, ResourceContainerData.STREAM_CODEC) + )); + Menus.INSTANCE.setInterface(callback.register( + ContentIds.INTERFACE, + () -> extendedMenuTypeFactory.create(InterfaceContainerMenu::new, InterfaceData.STREAM_CODEC) + )); + Menus.INSTANCE.setExternalStorage(callback.register( + ContentIds.EXTERNAL_STORAGE, + () -> extendedMenuTypeFactory.create(ExternalStorageContainerMenu::new, ResourceContainerData.STREAM_CODEC) + )); + Menus.INSTANCE.setDetector(callback.register( + ContentIds.DETECTOR, + () -> extendedMenuTypeFactory.create(DetectorContainerMenu::new, SingleAmountData.STREAM_CODEC) + )); + Menus.INSTANCE.setDestructor(callback.register( + ContentIds.DESTRUCTOR, + () -> extendedMenuTypeFactory.create(DestructorContainerMenu::new, ResourceContainerData.STREAM_CODEC) + )); + Menus.INSTANCE.setConstructor(callback.register( + ContentIds.CONSTRUCTOR, + () -> extendedMenuTypeFactory.create(ConstructorContainerMenu::new, ResourceContainerData.STREAM_CODEC) + )); + Menus.INSTANCE.setRegulatorUpgrade(callback.register( + ContentIds.REGULATOR_UPGRADE, + () -> extendedMenuTypeFactory.create(RegulatorUpgradeContainerMenu::new, SingleAmountData.STREAM_CODEC) + )); + Menus.INSTANCE.setWirelessTransmitter(callback.register( + ContentIds.WIRELESS_TRANSMITTER, + () -> extendedMenuTypeFactory.create(WirelessTransmitterContainerMenu::new, + WirelessTransmitterData.STREAM_CODEC) + )); + Menus.INSTANCE.setStorageMonitor(callback.register( + ContentIds.STORAGE_MONITOR, + () -> extendedMenuTypeFactory.create(StorageMonitorContainerMenu::new, ResourceContainerData.STREAM_CODEC) + )); + Menus.INSTANCE.setNetworkTransmitter(callback.register( + ContentIds.NETWORK_TRANSMITTER, + () -> extendedMenuTypeFactory.create(NetworkTransmitterContainerMenu::new, + NetworkTransmitterData.STREAM_CODEC) + )); + Menus.INSTANCE.setPortableGridBlock(callback.register( + createIdentifier("portable_grid_block"), + () -> extendedMenuTypeFactory.create(PortableGridBlockContainerMenu::new, PortableGridData.STREAM_CODEC) + )); + Menus.INSTANCE.setPortableGridItem(callback.register( + createIdentifier("portable_grid_item"), + () -> extendedMenuTypeFactory.create(PortableGridItemContainerMenu::new, PortableGridData.STREAM_CODEC) + )); + Menus.INSTANCE.setSecurityCard(callback.register( + ContentIds.SECURITY_CARD, + () -> extendedMenuTypeFactory.create(SecurityCardContainerMenu::new, + PlayerBoundSecurityCardData.STREAM_CODEC) + )); + Menus.INSTANCE.setFallbackSecurityCard(callback.register( + ContentIds.FALLBACK_SECURITY_CARD, + () -> extendedMenuTypeFactory.create(FallbackSecurityCardContainerMenu::new, SecurityCardData.STREAM_CODEC) + )); + Menus.INSTANCE.setSecurityManager(callback.register( + ContentIds.SECURITY_MANAGER, + () -> menuTypeFactory.create(SecurityManagerContainerMenu::new) + )); + Menus.INSTANCE.setRelay(callback.register( + ContentIds.RELAY, + () -> extendedMenuTypeFactory.create(RelayContainerMenu::new, ResourceContainerData.STREAM_CODEC) + )); + Menus.INSTANCE.setDiskInterface(callback.register( + ContentIds.DISK_INTERFACE, + () -> extendedMenuTypeFactory.create(DiskInterfaceContainerMenu::new, ResourceContainerData.STREAM_CODEC) + )); + } + + protected final void registerLootFunctions(final RegistryCallback> callback) { + LootFunctions.INSTANCE.setStorageBlock(callback.register( + ContentIds.STORAGE_BLOCK, + () -> new LootItemFunctionType<>(MapCodec.unit(new StorageBlockLootItemFunction())) + )); + LootFunctions.INSTANCE.setPortableGrid(callback.register( + ContentIds.PORTABLE_GRID, + () -> new LootItemFunctionType<>(MapCodec.unit(new PortableGridLootItemFunction())) + )); + LootFunctions.INSTANCE.setEnergy(callback.register( + createIdentifier("energy"), + () -> new LootItemFunctionType<>(MapCodec.unit(new EnergyLootItemFunction())) + )); + } + + protected final void registerSounds(final RegistryCallback callback) { + Sounds.INSTANCE.setWrench(callback.register( + ContentIds.WRENCH, + () -> SoundEvent.createVariableRangeEvent(ContentIds.WRENCH) + )); + } + + protected final void registerRecipeSerializers(final RegistryCallback> callback) { + callback.register( + createIdentifier("upgrade_with_enchanted_book"), + UpgradeWithEnchantedBookRecipeSerializer::new + ); + } + + protected final void registerDataComponents(final RegistryCallback> callback) { + DataComponents.INSTANCE.setEnergy( + callback.register(createIdentifier("energy"), () -> DataComponentType.builder() + .persistent(Codec.LONG) + .networkSynchronized(ByteBufCodecs.VAR_LONG) + .build())); + DataComponents.INSTANCE.setNetworkLocation( + callback.register(createIdentifier("network_location"), () -> DataComponentType.builder() + .persistent(GlobalPos.CODEC) + .networkSynchronized(GlobalPos.STREAM_CODEC) + .build())); + DataComponents.INSTANCE.setStorageReference( + callback.register(createIdentifier("storage_reference"), () -> DataComponentType.builder() + .persistent(UUIDUtil.CODEC) + .networkSynchronized(UUIDUtil.STREAM_CODEC) + .build())); + DataComponents.INSTANCE.setRegulatorUpgradeState( + callback.register(createIdentifier("regulator_upgrade_state"), + () -> DataComponentType.builder() + .persistent(RegulatorUpgradeState.CODEC) + .networkSynchronized(RegulatorUpgradeState.STREAM_CODEC) + .build())); + DataComponents.INSTANCE.setSecurityCardBoundPlayer( + callback.register(createIdentifier("security_card_bound_player"), + () -> DataComponentType.builder() + .persistent(SecurityCardBoundPlayer.CODEC) + .networkSynchronized(SecurityCardBoundPlayer.STREAM_CODEC) + .build())); + DataComponents.INSTANCE.setSecurityCardPermissions( + callback.register(createIdentifier("security_card_permissions"), + () -> DataComponentType.builder() + .persistent(SecurityCardPermissions.CODEC) + .networkSynchronized(SecurityCardPermissions.STREAM_CODEC) + .build())); + DataComponents.INSTANCE.setConfigurationCardState( + callback.register(createIdentifier("configuration_card_state"), + () -> DataComponentType.builder() + .persistent(ConfigurationCardState.CODEC) + .networkSynchronized(ConfigurationCardState.STREAM_CODEC) + .build())); + } + + protected final void registerInventorySlotReference() { + RefinedStorageApi.INSTANCE.getSlotReferenceFactoryRegistry().register( + createIdentifier("inventory"), + InventorySlotReferenceFactory.INSTANCE + ); + } + + protected static boolean allowComponentsUpdateAnimation(final ItemStack oldStack, final ItemStack newStack) { + return oldStack.getItem() != newStack.getItem(); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractPlatform.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractPlatform.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractPlatform.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractPlatform.java index 7f90c8e2d..468d9b6ab 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractPlatform.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractPlatform.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common; +package com.refinedmods.refinedstorage.common; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.MenuOpener; -import com.refinedmods.refinedstorage.platform.common.support.render.FluidRenderer; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage.common.support.containermenu.MenuOpener; +import com.refinedmods.refinedstorage.common.support.render.FluidRenderer; public abstract class AbstractPlatform implements Platform { private final MenuOpener menuOpener; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Config.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Config.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java index 757c10b70..e828d1c07 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Config.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common; +package com.refinedmods.refinedstorage.common; import com.refinedmods.refinedstorage.api.grid.view.GridSortingDirection; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridMatrixCloseBehavior; -import com.refinedmods.refinedstorage.platform.common.grid.GridSortingTypes; -import com.refinedmods.refinedstorage.platform.common.support.stretching.ScreenSize; +import com.refinedmods.refinedstorage.common.grid.CraftingGridMatrixCloseBehavior; +import com.refinedmods.refinedstorage.common.grid.GridSortingTypes; +import com.refinedmods.refinedstorage.common.support.stretching.ScreenSize; import java.util.Optional; @@ -101,9 +101,9 @@ interface GridEntry extends SimpleEnergyUsageEntry { void setSortingType(GridSortingTypes sortingType); - Optional getResourceTypeId(); + Optional getResourceType(); - void setResourceTypeId(ResourceLocation resourceTypeId); + void setResourceType(ResourceLocation resourceTypeId); void clearResourceType(); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Platform.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Platform.java new file mode 100644 index 000000000..b1b96a0ff --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Platform.java @@ -0,0 +1,134 @@ +package com.refinedmods.refinedstorage.common; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; +import com.refinedmods.refinedstorage.common.support.containermenu.MenuOpener; +import com.refinedmods.refinedstorage.common.support.containermenu.TransferManager; +import com.refinedmods.refinedstorage.common.support.render.FluidRenderer; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import java.io.File; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.function.BiConsumer; +import javax.annotation.Nullable; + +import net.minecraft.client.KeyMapping; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.components.EditBox; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.NonNullList; +import net.minecraft.network.chat.Component; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.Container; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.CraftingContainer; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.CraftingInput; +import net.minecraft.world.item.crafting.CraftingRecipe; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.LiquidBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.saveddata.SavedData; +import net.minecraft.world.phys.BlockHitResult; + +public interface Platform { + Platform INSTANCE = new PlatformProxy(); + + MenuOpener getMenuOpener(); + + long getBucketAmount(); + + Config getConfig(); + + boolean canEditBoxLoseFocus(EditBox editBox); + + boolean isKeyDown(KeyMapping keyMapping); + + GridResourceFactory getItemGridResourceFactory(); + + GridResourceFactory getFluidGridResourceFactory(); + + GridInsertionStrategyFactory getDefaultGridInsertionStrategyFactory(); + + FluidRenderer getFluidRenderer(); + + Optional drainContainer(ItemStack container); + + Optional fillContainer(ItemStack container, ResourceAmount resourceAmount); + + Optional getFilledBucket(FluidResource fluidResource); + + TransferManager createTransferManager(AbstractContainerMenu containerMenu); + + long insertIntoContainer(Container container, ItemResource itemResource, long amount, Action action); + + ItemStack getCloneItemStack(BlockState state, Level level, BlockHitResult hitResult, Player player); + + NonNullList getRemainingCraftingItems(Player player, + CraftingRecipe craftingRecipe, + CraftingInput input); + + void onItemCrafted(Player player, ItemStack craftedStack, CraftingContainer container); + + Player getFakePlayer(ServerLevel level, @Nullable UUID playerId); + + boolean canBreakBlock(Level level, BlockPos pos, BlockState state, Player player); + + boolean placeBlock(Level level, BlockPos pos, Direction direction, Player player, ItemStack stack); + + boolean placeFluid(Level level, BlockPos pos, Direction direction, Player player, FluidResource fluidResource); + + ItemStack getBlockAsItemStack(Block block, + BlockState state, + Direction direction, + LevelReader level, + BlockPos pos, + Player player); + + Optional getBucketPickupSound(LiquidBlock liquidBlock, BlockState state); + + List processTooltipComponents( + ItemStack stack, + GuiGraphics graphics, + int mouseX, + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") Optional imageComponent, + List components + ); + + void renderTooltip(GuiGraphics graphics, List components, int x, int y); + + Optional getEnergyStorage(ItemStack stack); + + void sendPacketToServer(T packet); + + void sendPacketToClient(ServerPlayer player, T packet); + + void saveSavedData(SavedData savedData, + File file, + HolderLookup.Provider provider, + BiConsumer defaultSaveFunction); + + @Nullable + NetworkNodeContainerProvider getContainerProvider(Level level, BlockPos pos, @Nullable Direction direction); + + @Nullable + NetworkNodeContainerProvider getContainerProviderSafely(Level level, BlockPos pos, @Nullable Direction direction); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformProxy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/PlatformProxy.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformProxy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/PlatformProxy.java index 8c246f989..6c28ad8e5 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformProxy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/PlatformProxy.java @@ -1,18 +1,23 @@ -package com.refinedmods.refinedstorage.platform.common; +package com.refinedmods.refinedstorage.common; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.MenuOpener; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.TransferManager; -import com.refinedmods.refinedstorage.platform.common.support.render.FluidRenderer; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; +import com.refinedmods.refinedstorage.common.support.containermenu.MenuOpener; +import com.refinedmods.refinedstorage.common.support.containermenu.TransferManager; +import com.refinedmods.refinedstorage.common.support.render.FluidRenderer; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import java.io.File; import java.util.List; import java.util.Optional; import java.util.UUID; +import java.util.function.BiConsumer; import javax.annotation.Nullable; import net.minecraft.client.KeyMapping; @@ -21,6 +26,7 @@ import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.core.NonNullList; import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; @@ -40,6 +46,7 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.saveddata.SavedData; import net.minecraft.world.phys.BlockHitResult; public class PlatformProxy implements Platform { @@ -47,7 +54,7 @@ public class PlatformProxy implements Platform { private Platform platform; public static void loadPlatform(final Platform platform) { - final PlatformProxy proxy = (PlatformProxy) Platform.INSTANCE; + final PlatformProxy proxy = (PlatformProxy) INSTANCE; if (proxy.platform != null) { throw new IllegalStateException("Platform already set"); } @@ -100,13 +107,19 @@ public FluidRenderer getFluidRenderer() { } @Override - public Optional getContainedFluid(final ItemStack stack) { - return ensureLoaded().getContainedFluid(stack); + public Optional drainContainer(final ItemStack container) { + return ensureLoaded().drainContainer(container); + } + + @Override + public Optional fillContainer(final ItemStack container, + final ResourceAmount resourceAmount) { + return ensureLoaded().fillContainer(container, resourceAmount); } @Override - public Optional convertToBucket(final FluidResource fluidResource) { - return ensureLoaded().convertToBucket(fluidResource); + public Optional getFilledBucket(final FluidResource fluidResource) { + return ensureLoaded().getFilledBucket(fluidResource); } @Override @@ -217,6 +230,30 @@ public void sendPacketToClient(final ServerPlaye ensureLoaded().sendPacketToClient(player, packet); } + @Override + public void saveSavedData(final SavedData savedData, + final File file, + final HolderLookup.Provider provider, + final BiConsumer defaultSaveFunction) { + ensureLoaded().saveSavedData(savedData, file, provider, defaultSaveFunction); + } + + @Nullable + @Override + public NetworkNodeContainerProvider getContainerProvider(final Level level, + final BlockPos pos, + @Nullable final Direction direction) { + return ensureLoaded().getContainerProvider(level, pos, direction); + } + + @Nullable + @Override + public NetworkNodeContainerProvider getContainerProviderSafely(final Level level, + final BlockPos pos, + @Nullable final Direction direction) { + return ensureLoaded().getContainerProviderSafely(level, pos, direction); + } + private Platform ensureLoaded() { if (platform == null) { throw new IllegalStateException("Platform not loaded yet"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java new file mode 100644 index 000000000..8a38b03fb --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java @@ -0,0 +1,576 @@ +package com.refinedmods.refinedstorage.common; + +import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.NetworkBuilder; +import com.refinedmods.refinedstorage.api.network.NetworkComponent; +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.api.network.impl.NetworkBuilderImpl; +import com.refinedmods.refinedstorage.api.network.impl.NetworkFactory; +import com.refinedmods.refinedstorage.api.network.node.NetworkNode; +import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHint; +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHints; +import com.refinedmods.refinedstorage.common.api.grid.GridSynchronizer; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategyFactory; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategyFactory; +import com.refinedmods.refinedstorage.common.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItemHelper; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.api.storage.StorageType; +import com.refinedmods.refinedstorage.common.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.support.energy.EnergyItemHelper; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemHelper; +import com.refinedmods.refinedstorage.common.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage.common.api.support.resource.RecipeModIngredientConverter; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainerInsertStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceProvider; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage.common.api.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage.common.grid.NoopGridSynchronizer; +import com.refinedmods.refinedstorage.common.grid.screen.hint.GridInsertionHintsImpl; +import com.refinedmods.refinedstorage.common.grid.screen.hint.ItemGridInsertionHint; +import com.refinedmods.refinedstorage.common.grid.screen.hint.SingleItemGridInsertionHint; +import com.refinedmods.refinedstorage.common.grid.strategy.CompositeGridExtractionStrategy; +import com.refinedmods.refinedstorage.common.grid.strategy.CompositeGridInsertionStrategy; +import com.refinedmods.refinedstorage.common.grid.strategy.CompositeGridScrollingStrategy; +import com.refinedmods.refinedstorage.common.storage.ClientStorageRepository; +import com.refinedmods.refinedstorage.common.storage.StorageContainerItemHelperImpl; +import com.refinedmods.refinedstorage.common.storage.StorageRepositoryImpl; +import com.refinedmods.refinedstorage.common.storage.StorageTypes; +import com.refinedmods.refinedstorage.common.storagemonitor.CompositeStorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage.common.storagemonitor.CompositeStorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage.common.support.energy.EnergyItemHelperImpl; +import com.refinedmods.refinedstorage.common.support.energy.ItemBlockEnergyStorage; +import com.refinedmods.refinedstorage.common.support.energy.ItemEnergyStorage; +import com.refinedmods.refinedstorage.common.support.network.ConnectionProviderImpl; +import com.refinedmods.refinedstorage.common.support.network.InWorldNetworkNodeContainerBuilder; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeContainerProviderImpl; +import com.refinedmods.refinedstorage.common.support.network.item.NetworkItemHelperImpl; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; +import com.refinedmods.refinedstorage.common.support.packet.s2c.S2CPackets; +import com.refinedmods.refinedstorage.common.support.registry.PlatformRegistryImpl; +import com.refinedmods.refinedstorage.common.support.resource.CompositeRecipeModIngredientConverter; +import com.refinedmods.refinedstorage.common.support.resource.FluidResourceFactory; +import com.refinedmods.refinedstorage.common.support.resource.ItemResourceFactory; +import com.refinedmods.refinedstorage.common.support.slotreference.CompositeSlotReferenceProvider; +import com.refinedmods.refinedstorage.common.support.slotreference.InventorySlotReference; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeRegistryImpl; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; +import com.refinedmods.refinedstorage.common.util.ServerEventQueue; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.CompositeWirelessTransmitterRangeModifier; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.PriorityQueue; +import java.util.Queue; +import java.util.Set; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.saveddata.SavedData; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static java.util.Objects.requireNonNull; + +public class RefinedStorageApiImpl implements RefinedStorageApi { + private final StorageRepository clientStorageRepository = new ClientStorageRepository( + C2SPackets::sendStorageInfoRequest + ); + private final ComponentMapFactory networkComponentMapFactory = + new ComponentMapFactory<>(); + private final NetworkBuilder networkBuilder = + new NetworkBuilderImpl(new NetworkFactory(networkComponentMapFactory)); + private final PlatformRegistry storageTypeRegistry = new PlatformRegistryImpl<>(); + private final PlatformRegistry resourceTypeRegistry = new PlatformRegistryImpl<>(); + private final PlatformRegistry gridSynchronizerRegistry = new PlatformRegistryImpl<>(); + private final PlatformRegistry importerTransferStrategyRegistry = + new PlatformRegistryImpl<>(); + private final PlatformRegistry exporterTransferStrategyRegistry = + new PlatformRegistryImpl<>(); + private final UpgradeRegistry upgradeRegistry = new UpgradeRegistryImpl(); + private final Queue externalStorageProviderFactories = new PriorityQueue<>( + Comparator.comparingInt(PlatformExternalStorageProviderFactory::getPriority) + ); + private final Queue destructorStrategyFactories = new PriorityQueue<>( + Comparator.comparingInt(DestructorStrategyFactory::getPriority) + ); + private final Queue constructorStrategyFactories = new PriorityQueue<>( + Comparator.comparingInt(ConstructorStrategyFactory::getPriority) + ); + private final CompositeStorageMonitorInsertionStrategy storageMonitorInsertionStrategy = + new CompositeStorageMonitorInsertionStrategy(); + private final CompositeStorageMonitorExtractionStrategy storageMonitorExtractionStrategy = + new CompositeStorageMonitorExtractionStrategy(); + private final CompositeRecipeModIngredientConverter ingredientConverter = + new CompositeRecipeModIngredientConverter(); + private final StorageContainerItemHelper storageContainerItemHelper = new StorageContainerItemHelperImpl(); + private final List gridInsertionStrategyFactories = new ArrayList<>(); + private final GridInsertionHintsImpl gridInsertionHints = new GridInsertionHintsImpl( + new ItemGridInsertionHint(), + new SingleItemGridInsertionHint() + ); + private final List gridExtractionStrategyFactories = new ArrayList<>(); + private final List gridScrollingStrategyFactories = new ArrayList<>(); + private final ResourceFactory itemResourceFactory = new ItemResourceFactory(); + private final ResourceFactory fluidResourceFactory = new FluidResourceFactory(); + private final Set resourceFactories = new HashSet<>(); + private final Map, ResourceRendering> resourceRenderingMap = new HashMap<>(); + private final CompositeWirelessTransmitterRangeModifier wirelessTransmitterRangeModifier = + new CompositeWirelessTransmitterRangeModifier(); + private final EnergyItemHelper energyItemHelper = new EnergyItemHelperImpl(); + private final NetworkItemHelper networkItemHelper = new NetworkItemHelperImpl(); + private final PlatformRegistry slotReferenceFactoryRegistry = new PlatformRegistryImpl<>(); + private final CompositeSlotReferenceProvider slotReferenceProvider = new CompositeSlotReferenceProvider(); + private final PlatformRegistry permissionRegistry = new PlatformRegistryImpl<>(); + private final List resourceExtractStrategies = new ArrayList<>(); + + public RefinedStorageApiImpl() { + gridSynchronizerRegistry.register(createIdentifier("off"), NoopGridSynchronizer.INSTANCE); + } + + @Override + public PlatformRegistry getStorageTypeRegistry() { + return storageTypeRegistry; + } + + @Override + public StorageRepository getClientStorageRepository() { + return clientStorageRepository; + } + + @SuppressWarnings("DataFlowIssue") // NeoForge makes null datafixer safe + @Override + public StorageRepository getStorageRepository(final Level level) { + final ServerLevel serverLevel = requireNonNull(level.getServer().getLevel(Level.OVERWORLD)); + return serverLevel.getDataStorage().computeIfAbsent(new SavedData.Factory<>( + StorageRepositoryImpl::new, + StorageRepositoryImpl::new, + null + ), StorageRepositoryImpl.NAME); + } + + @Override + public StorageContainerItemHelper getStorageContainerItemHelper() { + return storageContainerItemHelper; + } + + @Override + public PlatformRegistry getResourceTypeRegistry() { + return resourceTypeRegistry; + } + + @Override + public PlatformRegistry getImporterTransferStrategyRegistry() { + return importerTransferStrategyRegistry; + } + + @Override + public PlatformRegistry getExporterTransferStrategyRegistry() { + return exporterTransferStrategyRegistry; + } + + @Override + public void addExternalStorageProviderFactory(final PlatformExternalStorageProviderFactory factory) { + externalStorageProviderFactories.add(factory); + } + + @Override + public Collection getExternalStorageProviderFactories() { + return externalStorageProviderFactories; + } + + @Override + public Collection getDestructorStrategyFactories() { + return destructorStrategyFactories; + } + + @Override + public void addDestructorStrategyFactory(final DestructorStrategyFactory factory) { + destructorStrategyFactories.add(factory); + } + + @Override + public Collection getConstructorStrategyFactories() { + return constructorStrategyFactories; + } + + @Override + public void addConstructorStrategyFactory(final ConstructorStrategyFactory factory) { + constructorStrategyFactories.add(factory); + } + + @Override + public void addStorageMonitorExtractionStrategy(final StorageMonitorExtractionStrategy strategy) { + storageMonitorExtractionStrategy.addStrategy(strategy); + } + + @Override + public StorageMonitorExtractionStrategy getStorageMonitorExtractionStrategy() { + return storageMonitorExtractionStrategy; + } + + @Override + public void addStorageMonitorInsertionStrategy(final StorageMonitorInsertionStrategy strategy) { + storageMonitorInsertionStrategy.addStrategy(strategy); + } + + @Override + public StorageMonitorInsertionStrategy getStorageMonitorInsertionStrategy() { + return storageMonitorInsertionStrategy; + } + + @Override + public ComponentMapFactory getNetworkComponentMapFactory() { + return networkComponentMapFactory; + } + + @Override + public PlatformRegistry getGridSynchronizerRegistry() { + return gridSynchronizerRegistry; + } + + @Override + public UpgradeRegistry getUpgradeRegistry() { + return upgradeRegistry; + } + + @Override + public NetworkNodeContainerProvider createNetworkNodeContainerProvider() { + return new NetworkNodeContainerProviderImpl(); + } + + @Override + public InWorldNetworkNodeContainer.Builder createNetworkNodeContainer(final BlockEntity blockEntity, + final NetworkNode networkNode) { + return new InWorldNetworkNodeContainerBuilder(blockEntity, networkNode); + } + + @Override + public void initializeNetworkNodeContainer(final InWorldNetworkNodeContainer container, + @Nullable final Level level, + @Nullable final Runnable callback) { + if (level == null || level.isClientSide()) { + return; + } + final ConnectionProviderImpl connectionProvider = new ConnectionProviderImpl(level); + ServerEventQueue.queue(() -> { + // The container could've been removed by the time it has been placed, and by the time the event queue has + // run. In that case, don't initialize the network node because it no longer exists. + // This is a workaround for the "Carry On" mod. The mod places the block (which creates a block entity and + // requests this network node initialization) and then overrides the placed block entity with their own + // block entity. This triggers a new initialization, but then this one can no longer run! + if (container.isRemoved()) { + return; + } + networkBuilder.initialize(container, connectionProvider); + if (callback != null) { + callback.run(); + } + }); + } + + @Override + public void removeNetworkNodeContainer(final InWorldNetworkNodeContainer container, + @Nullable final Level level) { + if (level == null || level.isClientSide()) { + return; + } + // "Carry On" mod places the block (which creates a block entity and requests network node initialization) + // and then overrides the placed block entity with their own information. + // However, when the placed block entity is replaced, the server event queue hasn't run yet and there is + // no network loaded yet, even though the network node initialization was requested. + // Stop continuing here to avoid further code failing due to a missing network. + if (container.getNode().getNetwork() == null) { + return; + } + final ConnectionProviderImpl connectionProvider = new ConnectionProviderImpl(level); + networkBuilder.remove(container, connectionProvider); + } + + @Override + public void updateNetworkNodeContainer(final InWorldNetworkNodeContainer container, + @Nullable final Level level) { + if (level == null || level.isClientSide() || container.getNode().getNetwork() == null) { + return; + } + final ConnectionProviderImpl connectionProvider = new ConnectionProviderImpl(level); + networkBuilder.update(container, connectionProvider); + } + + @Override + public GridInsertionStrategy createGridInsertionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + return new CompositeGridInsertionStrategy( + Platform.INSTANCE.getDefaultGridInsertionStrategyFactory().create( + containerMenu, + player, + grid + ), + gridInsertionStrategyFactories.stream().map(f -> f.create( + containerMenu, + player, + grid + )).toList() + ); + } + + @Override + public void addGridInsertionStrategyFactory(final GridInsertionStrategyFactory insertionStrategyFactory) { + gridInsertionStrategyFactories.add(insertionStrategyFactory); + } + + @Override + public void addResourceContainerInsertStrategy(final ResourceContainerInsertStrategy strategy) { + resourceExtractStrategies.add(strategy); + } + + @Override + public Collection getResourceContainerInsertStrategies() { + return Collections.unmodifiableList(resourceExtractStrategies); + } + + @Override + public void addAlternativeGridInsertionHint(final GridInsertionHint hint) { + gridInsertionHints.addAlternativeHint(hint); + } + + @Override + public GridInsertionHints getGridInsertionHints() { + return gridInsertionHints; + } + + @Override + public GridExtractionStrategy createGridExtractionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + final List strategies = gridExtractionStrategyFactories + .stream() + .map(f -> f.create(containerMenu, player, grid)) + .toList(); + return new CompositeGridExtractionStrategy(strategies); + } + + @Override + public void addGridExtractionStrategyFactory(final GridExtractionStrategyFactory extractionStrategyFactory) { + gridExtractionStrategyFactories.add(extractionStrategyFactory); + } + + @Override + public GridScrollingStrategy createGridScrollingStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + final List strategies = gridScrollingStrategyFactories + .stream() + .map(f -> f.create(containerMenu, player, grid)) + .toList(); + return new CompositeGridScrollingStrategy(strategies); + } + + @Override + public void addGridScrollingStrategyFactory(final GridScrollingStrategyFactory scrollingStrategyFactory) { + gridScrollingStrategyFactories.add(scrollingStrategyFactory); + } + + @Override + public void addResourceFactory(final ResourceFactory factory) { + resourceFactories.add(factory); + } + + @Override + public ResourceFactory getItemResourceFactory() { + return itemResourceFactory; + } + + @Override + public StorageType getItemStorageType() { + return StorageTypes.ITEM; + } + + @Override + public ResourceFactory getFluidResourceFactory() { + return fluidResourceFactory; + } + + @Override + public StorageType getFluidStorageType() { + return StorageTypes.FLUID; + } + + @Override + public Set getAlternativeResourceFactories() { + return resourceFactories; + } + + @Override + public void registerResourceRendering(final Class resourceClass, + final ResourceRendering rendering) { + resourceRenderingMap.put(resourceClass, rendering); + } + + @Override + public ResourceRendering getResourceRendering(final ResourceKey resource) { + return resourceRenderingMap.get(resource.getClass()); + } + + @Override + public void addIngredientConverter(final RecipeModIngredientConverter converter) { + ingredientConverter.addConverter(converter); + } + + @Override + public RecipeModIngredientConverter getIngredientConverter() { + return ingredientConverter; + } + + @Override + public void addWirelessTransmitterRangeModifier(final WirelessTransmitterRangeModifier rangeModifier) { + wirelessTransmitterRangeModifier.addModifier(rangeModifier); + } + + @Override + public WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier() { + return wirelessTransmitterRangeModifier; + } + + @Override + public Optional getEnergyStorage(final ItemStack stack) { + return Platform.INSTANCE.getEnergyStorage(stack); + } + + @Override + public EnergyItemHelper getEnergyItemHelper() { + return energyItemHelper; + } + + @Override + public EnergyStorage asItemEnergyStorage(final EnergyStorage energyStorage, + final ItemStack stack) { + return new ItemEnergyStorage(stack, energyStorage); + } + + @Override + public EnergyStorage asBlockItemEnergyStorage(final EnergyStorage energyStorage, + final ItemStack stack, + final BlockEntityType blockEntityType) { + return new ItemBlockEnergyStorage(energyStorage, stack, blockEntityType); + } + + @Override + public NetworkItemHelper getNetworkItemHelper() { + return networkItemHelper; + } + + @Override + public PlatformRegistry getSlotReferenceFactoryRegistry() { + return slotReferenceFactoryRegistry; + } + + @Override + public void addSlotReferenceProvider(final SlotReferenceProvider provider) { + slotReferenceProvider.addProvider(provider); + } + + @Override + public SlotReference createInventorySlotReference(final Player player, final InteractionHand hand) { + return InventorySlotReference.of(player, hand); + } + + @Override + public void useSlotReferencedItem(final Player player, final Item... items) { + final Set validItems = new HashSet<>(Arrays.asList(items)); + slotReferenceProvider.findForUse(player, items[0], validItems).ifPresent(C2SPackets::sendUseSlotReferencedItem); + } + + @Override + public PlatformRegistry getPermissionRegistry() { + return permissionRegistry; + } + + @Override + public SecurityPolicy createDefaultSecurityPolicy() { + return new SecurityPolicy(permissionRegistry.getAll() + .stream() + .filter(PlatformPermission::isAllowedByDefault) + .collect(Collectors.toSet())); + } + + @Override + public void sendNoPermissionToOpenMessage(final ServerPlayer player, final Component target) { + sendNoPermissionMessage(player, IdentifierUtil.createTranslation("misc", "no_permission.open", target)); + } + + @Override + public void sendNoPermissionMessage(final ServerPlayer player, final Component message) { + S2CPackets.sendNoPermission(player, message); + } + + @Override + public boolean canPlaceNetworkNode(final ServerPlayer player, + final Level level, + final BlockPos pos, + final BlockState state) { + for (final Direction direction : Direction.values()) { + final BlockPos adjacentPos = pos.relative(direction); + final NetworkNodeContainerProvider adjacentProvider = Platform.INSTANCE.getContainerProvider( + level, + adjacentPos, + direction.getOpposite() + ); + if (adjacentProvider == null) { + continue; + } + if (!adjacentProvider.canBuild(player)) { + RefinedStorageApi.INSTANCE.sendNoPermissionMessage( + player, + IdentifierUtil.createTranslation("misc", "no_permission.build.place", state.getBlock().getName()) + ); + return false; + } + } + return true; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/ConfigurationCardItem.java similarity index 94% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItem.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/ConfigurationCardItem.java index 4cf94ebaa..d34df1ed5 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/ConfigurationCardItem.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.configurationcard; +package com.refinedmods.refinedstorage.common.configurationcard; -import com.refinedmods.refinedstorage.platform.api.configurationcard.ConfigurationCardTarget; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.content.DataComponents; +import com.refinedmods.refinedstorage.common.api.configurationcard.ConfigurationCardTarget; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.content.DataComponents; import java.util.List; import java.util.Optional; @@ -28,7 +28,7 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class ConfigurationCardItem extends Item { private static final Component EMPTY_HELP = createTranslation("item", "configuration_card.empty_help"); @@ -113,6 +113,7 @@ private CompoundTag createConfigTag(final ConfigurationCardTarget target, final return tag; } + @SuppressWarnings("resource") private void sendCopiedConfigurationMessage(final Player player, final BlockEntityType configuredType) { if (player.level().isClientSide()) { return; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItemPropertyFunction.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/ConfigurationCardItemPropertyFunction.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItemPropertyFunction.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/ConfigurationCardItemPropertyFunction.java index f1a7e3e40..f2d6ef6f2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItemPropertyFunction.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/ConfigurationCardItemPropertyFunction.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.configurationcard; +package com.refinedmods.refinedstorage.common.configurationcard; import javax.annotation.Nullable; @@ -8,7 +8,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class ConfigurationCardItemPropertyFunction implements ClampedItemPropertyFunction { public static final ResourceLocation NAME = createIdentifier("configuration_card_active"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardState.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/ConfigurationCardState.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardState.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/ConfigurationCardState.java index 974d2cc57..33e3bccfd 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardState.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/ConfigurationCardState.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.configurationcard; +package com.refinedmods.refinedstorage.common.configurationcard; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/package-info.java new file mode 100644 index 000000000..e470edfda --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/configurationcard/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.configurationcard; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractConstructorDestructorBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractConstructorDestructorBlock.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractConstructorDestructorBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractConstructorDestructorBlock.java index 37d2cd2b2..5c66e1589 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractConstructorDestructorBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractConstructorDestructorBlock.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; +package com.refinedmods.refinedstorage.common.constructordestructor; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalCableBlock; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.ColorableBlock; -import com.refinedmods.refinedstorage.platform.common.support.DirectionalCableBlockShapes; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalCableBlock; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.ColorableBlock; +import com.refinedmods.refinedstorage.common.support.DirectionalCableBlockShapes; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractItemConstructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractItemConstructorStrategy.java new file mode 100644 index 000000000..e20a5fe8c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractItemConstructorStrategy.java @@ -0,0 +1,73 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategy; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; + +abstract class AbstractItemConstructorStrategy implements ConstructorStrategy { + protected final ServerLevel level; + protected final BlockPos pos; + protected final Direction direction; + + AbstractItemConstructorStrategy(final ServerLevel level, final BlockPos pos, final Direction direction) { + this.level = level; + this.pos = pos; + this.direction = direction; + } + + protected long getTransferAmount() { + return 1; + } + + @Override + public final boolean apply( + final ResourceKey resource, + final Actor actor, + final Player player, + final Network network + ) { + if (!level.isLoaded(pos)) { + return false; + } + if (!(resource instanceof ItemResource itemResource)) { + return false; + } + final RootStorage rootStorage = network.getComponent(StorageNetworkComponent.class); + final long amount = getTransferAmount(); + final long extractedAmount = rootStorage.extract(itemResource, amount, Action.SIMULATE, actor); + if (extractedAmount == 0) { + return false; + } + final ItemStack itemStack = itemResource.toItemStack(extractedAmount); + final boolean success = apply(itemStack, actor, player); + if (success) { + rootStorage.extract(itemResource, extractedAmount, Action.EXECUTE, actor); + } + return success; + } + + protected abstract boolean apply(ItemStack itemStack, Actor actor, Player actingPlayer); + + protected double getDispensePositionX() { + return pos.getX() + 0.5D; + } + + protected double getDispensePositionY() { + return pos.getY() + (direction == Direction.DOWN ? 0.45D : 0.5D); + } + + protected double getDispensePositionZ() { + return pos.getZ() + 0.5D; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/BlockBreakDestructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/BlockBreakDestructorStrategy.java similarity index 80% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/BlockBreakDestructorStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/BlockBreakDestructorStrategy.java index ced1d2bd1..5ef08d15e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/BlockBreakDestructorStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/BlockBreakDestructorStrategy.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; +package com.refinedmods.refinedstorage.common.constructordestructor; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.filter.Filter; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategy; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.List; import java.util.function.Supplier; @@ -45,7 +45,7 @@ class BlockBreakDestructorStrategy implements DestructorStrategy { public boolean apply(final Filter filter, final Actor actor, final Supplier networkSupplier, - final Player actingPlayer) { + final Player player) { if (!level.isLoaded(pos)) { return false; } @@ -53,8 +53,8 @@ public boolean apply(final Filter filter, final Block block = blockState.getBlock(); if (isFastExit(blockState) || blockState.getDestroySpeed(level, pos) == -1.0 - || !isAllowed(actingPlayer, filter, blockState, block) - || !Platform.INSTANCE.canBreakBlock(level, pos, blockState, actingPlayer)) { + || !isAllowed(player, filter, blockState, block) + || !Platform.INSTANCE.canBreakBlock(level, pos, blockState, player)) { return false; } final List drops = Block.getDrops( @@ -62,19 +62,19 @@ public boolean apply(final Filter filter, level, pos, level.getBlockEntity(pos), - actingPlayer, + player, tool ); - if (!insertDrops(actor, drops, getStorageChannel(networkSupplier), Action.SIMULATE)) { + if (!insertDrops(actor, drops, getRootStorage(networkSupplier), Action.SIMULATE)) { return false; } - block.playerWillDestroy(level, pos, blockState, actingPlayer); + block.playerWillDestroy(level, pos, blockState, player); level.removeBlock(pos, false); - insertDrops(actor, drops, getStorageChannel(networkSupplier), Action.EXECUTE); + insertDrops(actor, drops, getRootStorage(networkSupplier), Action.EXECUTE); return true; } - private static StorageChannel getStorageChannel(final Supplier network) { + private static RootStorage getRootStorage(final Supplier network) { return network.get().getComponent(StorageNetworkComponent.class); } @@ -106,7 +106,7 @@ private boolean isAllowed( private boolean insertDrops( final Actor actor, final List drops, - final StorageChannel storage, + final RootStorage storage, final Action action ) { for (final ItemStack drop : drops) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/BlockBreakDestructorStrategyFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/BlockBreakDestructorStrategyFactory.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/BlockBreakDestructorStrategyFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/BlockBreakDestructorStrategyFactory.java index 33c67f04a..91035a9e9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/BlockBreakDestructorStrategyFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/BlockBreakDestructorStrategyFactory.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; +package com.refinedmods.refinedstorage.common.constructordestructor; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategy; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeItem; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.common.content.Items; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeItem; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.content.Items; import java.util.List; import java.util.Optional; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/CompositeConstructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/CompositeConstructorStrategy.java new file mode 100644 index 000000000..fa605dab6 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/CompositeConstructorStrategy.java @@ -0,0 +1,32 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategy; + +import java.util.Collections; +import java.util.List; + +import net.minecraft.world.entity.player.Player; + +class CompositeConstructorStrategy implements ConstructorStrategy { + private final List strategies; + + CompositeConstructorStrategy(final List strategies) { + this.strategies = Collections.unmodifiableList(strategies); + } + + @Override + public boolean apply(final ResourceKey resource, + final Actor actor, + final Player player, + final Network network) { + for (final ConstructorStrategy strategy : strategies) { + if (strategy.apply(resource, actor, player, network)) { + return true; + } + } + return false; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/CompositeDestructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/CompositeDestructorStrategy.java new file mode 100644 index 000000000..47fc8eb0d --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/CompositeDestructorStrategy.java @@ -0,0 +1,33 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.resource.filter.Filter; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategy; + +import java.util.Collections; +import java.util.List; +import java.util.function.Supplier; + +import net.minecraft.world.entity.player.Player; + +class CompositeDestructorStrategy implements DestructorStrategy { + private final List strategies; + + CompositeDestructorStrategy(final List strategies) { + this.strategies = Collections.unmodifiableList(strategies); + } + + @Override + public boolean apply(final Filter filter, + final Actor actor, + final Supplier networkSupplier, + final Player player) { + for (final DestructorStrategy strategy : strategies) { + if (strategy.apply(filter, actor, networkSupplier, player)) { + return true; + } + } + return false; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlock.java new file mode 100644 index 000000000..f3777361a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlock.java @@ -0,0 +1,49 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ConstructorBlock extends AbstractConstructorDestructorBlock< + ConstructorBlock, ConstructorBlockEntity, BaseBlockItem + > implements BlockItemProvider { + private static final Component HELP = createTranslation("item", "constructor.help"); + + public ConstructorBlock(final DyeColor color, final MutableComponent name) { + super(color, name, new NetworkNodeBlockEntityTicker<>( + BlockEntities.INSTANCE::getConstructor, + ACTIVE + )); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getConstructor(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { + return new ConstructorBlockEntity(blockPos, blockState); + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlockEntity.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlockEntity.java index 5a35a2bfc..d27776517 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; +package com.refinedmods.refinedstorage.common.constructordestructor; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; @@ -7,15 +7,15 @@ import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategy; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategy; +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; import java.util.ArrayList; import java.util.Collection; @@ -54,7 +54,7 @@ public ConstructorBlockEntity(final BlockPos pos, final BlockState state) { new SimpleNetworkNode(Platform.INSTANCE.getConfig().getConstructor().getEnergyUsage()), UpgradeDestinations.CONSTRUCTOR ); - this.actor = new NetworkNodeActor(mainNode); + this.actor = new NetworkNodeActor(mainNetworkNode); } @Override @@ -71,7 +71,8 @@ protected void initialize(final ServerLevel level, final Direction direction) { private ConstructorStrategy createStrategy(final ServerLevel serverLevel, final Direction direction) { final Direction incomingDirection = direction.getOpposite(); final BlockPos sourcePosition = worldPosition.relative(direction); - final Collection factories = PlatformApi.INSTANCE.getConstructorStrategyFactories(); + final Collection factories = RefinedStorageApi.INSTANCE + .getConstructorStrategyFactories(); final List strategies = factories .stream() .flatMap(factory -> factory.create( @@ -88,14 +89,14 @@ private ConstructorStrategy createStrategy(final ServerLevel serverLevel, final @Override public void postDoWork() { if (taskExecutor == null - || mainNode.getNetwork() == null - || !mainNode.isActive() + || mainNetworkNode.getNetwork() == null + || !mainNetworkNode.isActive() || !(level instanceof ServerLevel serverLevel)) { return; } final Player fakePlayer = getFakePlayer(serverLevel); taskExecutor.execute(tasks, new TaskContext( - mainNode.getNetwork(), + mainNetworkNode.getNetwork(), fakePlayer )); } @@ -140,7 +141,7 @@ public AbstractContainerMenu createMenu(final int syncId, final Inventory invent @Override protected void setEnergyUsage(final long upgradeEnergyUsage) { final long baseEnergyUsage = Platform.INSTANCE.getConfig().getConstructor().getEnergyUsage(); - mainNode.setEnergyUsage(baseEnergyUsage + upgradeEnergyUsage); + mainNetworkNode.setEnergyUsage(baseEnergyUsage + upgradeEnergyUsage); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorContainerMenu.java new file mode 100644 index 000000000..2ba899e2b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorContainerMenu.java @@ -0,0 +1,65 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractSchedulingContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; + +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ConstructorContainerMenu extends AbstractSchedulingContainerMenu { + private static final MutableComponent FILTER_HELP = createTranslation("gui", "constructor.filter_help"); + + public ConstructorContainerMenu(final int syncId, + final Inventory playerInventory, + final ResourceContainerData resourceContainerData) { + super( + Menus.INSTANCE.getConstructor(), + syncId, + playerInventory.player, + resourceContainerData, + UpgradeDestinations.CONSTRUCTOR, + FILTER_HELP + ); + } + + ConstructorContainerMenu(final int syncId, + final Player player, + final ConstructorBlockEntity constructor, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { + super( + Menus.INSTANCE.getConstructor(), + syncId, + player, + resourceContainer, + upgradeContainer, + constructor, + FILTER_HELP + ); + } + + @Override + protected void registerClientProperties() { + super.registerClientProperties(); + registerProperty(new ClientProperty<>(ConstructorDestructorPropertyTypes.DROP_ITEMS, false)); + } + + @Override + protected void registerServerProperties(final ConstructorBlockEntity blockEntity) { + super.registerServerProperties(blockEntity); + registerProperty(new ServerProperty<>( + ConstructorDestructorPropertyTypes.DROP_ITEMS, + blockEntity::isDropItems, + blockEntity::setDropItems + )); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDestructorPropertyTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDestructorPropertyTypes.java new file mode 100644 index 000000000..b8c22724e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDestructorPropertyTypes.java @@ -0,0 +1,18 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyType; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +final class ConstructorDestructorPropertyTypes { + static final PropertyType PICKUP_ITEMS = PropertyTypes.createBooleanProperty( + createIdentifier("pickup_items") + ); + static final PropertyType DROP_ITEMS = PropertyTypes.createBooleanProperty( + createIdentifier("drop_items") + ); + + private ConstructorDestructorPropertyTypes() { + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java new file mode 100644 index 000000000..f27231ee6 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java @@ -0,0 +1,22 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractYesNoSideButtonWidget; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class ConstructorDropItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { + ConstructorDropItemsSideButtonWidget(final ClientProperty property) { + super(property, createTranslation("gui", "constructor.drop_items")); + } + + @Override + protected int getXTexture() { + return Boolean.TRUE.equals(property.getValue()) ? 80 : 64; + } + + @Override + protected int getYTexture() { + return 16; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorScreen.java new file mode 100644 index 000000000..d1b35c126 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorScreen.java @@ -0,0 +1,30 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.support.AbstractFilterScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.widget.SchedulingModeSideButtonWidget; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; + +public class ConstructorScreen extends AbstractFilterScreen { + public ConstructorScreen(final ConstructorContainerMenu menu, + final Inventory playerInventory, + final Component text) { + super(menu, playerInventory, text); + } + + @Override + protected void init() { + super.init(); + addSideButton(new FuzzyModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.FUZZY_MODE), + () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK + )); + addSideButton(new SchedulingModeSideButtonWidget(getMenu().getProperty(PropertyTypes.SCHEDULING_MODE))); + addSideButton(new ConstructorDropItemsSideButtonWidget( + getMenu().getProperty(ConstructorDestructorPropertyTypes.DROP_ITEMS) + )); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlock.java new file mode 100644 index 000000000..0fcca8aa1 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlock.java @@ -0,0 +1,48 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; + +public class DestructorBlock extends AbstractConstructorDestructorBlock< + DestructorBlock, DestructorBlockEntity, BaseBlockItem + > implements BlockItemProvider { + private static final Component HELP = IdentifierUtil.createTranslation("item", "destructor.help"); + + public DestructorBlock(final DyeColor color, final MutableComponent name) { + super(color, name, new NetworkNodeBlockEntityTicker<>( + BlockEntities.INSTANCE::getDestructor, + ACTIVE + )); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getDestructor(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { + return new DestructorBlockEntity(blockPos, blockState); + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlockEntity.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlockEntity.java index 205cdebe9..0381141d7 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; +package com.refinedmods.refinedstorage.common.constructordestructor; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage.api.network.node.NetworkNodeActor; @@ -6,19 +6,19 @@ import com.refinedmods.refinedstorage.api.resource.filter.Filter; import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategy; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.FilterModeSettings; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractUpgradeableNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractUpgradeableNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; import java.util.List; import java.util.Set; @@ -57,7 +57,7 @@ public DestructorBlockEntity(final BlockPos pos, final BlockState state) { new SimpleNetworkNode(Platform.INSTANCE.getConfig().getDestructor().getEnergyUsage()), UpgradeDestinations.DESTRUCTOR ); - this.actor = new NetworkNodeActor(mainNode); + this.actor = new NetworkNodeActor(mainNetworkNode); this.filterWithFuzzyMode = FilterWithFuzzyMode.createAndListenForUniqueFilters( ResourceContainerImpl.createForFilter(), this::setChanged, @@ -113,7 +113,7 @@ public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider @Override protected void setEnergyUsage(final long upgradeEnergyUsage) { final long baseEnergyUsage = Platform.INSTANCE.getConfig().getDestructor().getEnergyUsage(); - mainNode.setEnergyUsage(baseEnergyUsage + upgradeEnergyUsage); + mainNetworkNode.setEnergyUsage(baseEnergyUsage + upgradeEnergyUsage); } @Override @@ -147,7 +147,7 @@ public AbstractContainerMenu createMenu(final int syncId, final Inventory invent protected void initialize(final ServerLevel level, final Direction direction) { final BlockPos pos = getBlockPos().relative(direction); final Direction incomingDirection = direction.getOpposite(); - final List strategies = PlatformApi.INSTANCE.getDestructorStrategyFactories() + final List strategies = RefinedStorageApi.INSTANCE.getDestructorStrategyFactories() .stream() .flatMap(factory -> factory.create(level, pos, incomingDirection, upgradeContainer, pickupItems).stream()) .toList(); @@ -157,13 +157,13 @@ protected void initialize(final ServerLevel level, final Direction direction) { @Override public void postDoWork() { if (strategy == null - || mainNode.getNetwork() == null - || !mainNode.isActive() + || mainNetworkNode.getNetwork() == null + || !mainNetworkNode.isActive() || !(level instanceof ServerLevel serverLevel)) { return; } final Player fakePlayer = getFakePlayer(serverLevel); - strategy.apply(filter, actor, mainNode::getNetwork, fakePlayer); + strategy.apply(filter, actor, mainNetworkNode::getNetwork, fakePlayer); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorContainerMenu.java new file mode 100644 index 000000000..3f2b47661 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorContainerMenu.java @@ -0,0 +1,78 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractSimpleFilterContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; + +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class DestructorContainerMenu extends AbstractSimpleFilterContainerMenu { + private static final MutableComponent FILTER_HELP = createTranslation("gui", "destructor.filter_help"); + + public DestructorContainerMenu(final int syncId, + final Inventory playerInventory, + final ResourceContainerData resourceContainerData) { + super( + Menus.INSTANCE.getDestructor(), + syncId, + playerInventory.player, + resourceContainerData, + UpgradeDestinations.DESTRUCTOR, + FILTER_HELP + ); + } + + DestructorContainerMenu(final int syncId, + final Player player, + final DestructorBlockEntity destructor, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { + super( + Menus.INSTANCE.getDestructor(), + syncId, + player, + resourceContainer, + upgradeContainer, + destructor, + FILTER_HELP + ); + } + + @Override + protected void registerClientProperties() { + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + registerProperty(new ClientProperty<>(PropertyTypes.FILTER_MODE, FilterMode.BLOCK)); + registerProperty(new ClientProperty<>(ConstructorDestructorPropertyTypes.PICKUP_ITEMS, false)); + } + + @Override + protected void registerServerProperties(final DestructorBlockEntity blockEntity) { + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + blockEntity::getRedstoneMode, + blockEntity::setRedstoneMode + )); + registerProperty(new ServerProperty<>( + PropertyTypes.FILTER_MODE, + blockEntity::getFilterMode, + blockEntity::setFilterMode + )); + registerProperty(new ServerProperty<>( + ConstructorDestructorPropertyTypes.PICKUP_ITEMS, + blockEntity::isPickupItems, + blockEntity::setPickupItems + )); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java new file mode 100644 index 000000000..3c80a1fc1 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java @@ -0,0 +1,22 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractYesNoSideButtonWidget; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class DestructorPickupItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { + DestructorPickupItemsSideButtonWidget(final ClientProperty property) { + super(property, createTranslation("gui", "destructor.pickup_items")); + } + + @Override + protected int getXTexture() { + return Boolean.TRUE.equals(property.getValue()) ? 64 : 80; + } + + @Override + protected int getYTexture() { + return 0; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorScreen.java new file mode 100644 index 000000000..0aa29c81b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorScreen.java @@ -0,0 +1,29 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.storage.FilterModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.AbstractFilterScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class DestructorScreen extends AbstractFilterScreen { + public DestructorScreen(final DestructorContainerMenu menu, final Inventory playerInventory, final Component text) { + super(menu, playerInventory, text); + } + + @Override + protected void init() { + super.init(); + addSideButton(new FilterModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.FILTER_MODE), + createTranslation("gui", "destructor.filter_mode.allow.help"), + createTranslation("gui", "destructor.filter_mode.block.help") + )); + addSideButton(new DestructorPickupItemsSideButtonWidget( + getMenu().getProperty(ConstructorDestructorPropertyTypes.PICKUP_ITEMS) + )); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/FluidBreakDestructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/FluidBreakDestructorStrategy.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/FluidBreakDestructorStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/FluidBreakDestructorStrategy.java index efee55964..c72321755 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/FluidBreakDestructorStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/FluidBreakDestructorStrategy.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; +package com.refinedmods.refinedstorage.common.constructordestructor; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.filter.Filter; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategy; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.function.Supplier; @@ -35,7 +35,7 @@ class FluidBreakDestructorStrategy implements DestructorStrategy { public boolean apply(final Filter filter, final Actor actor, final Supplier networkSupplier, - final Player actingPlayer) { + final Player player) { if (!level.isLoaded(pos)) { return false; } @@ -49,7 +49,7 @@ public boolean apply(final Filter filter, if (!filter.isAllowed(fluidResource)) { return false; } - return tryInsert(actor, networkSupplier, actingPlayer, blockState, liquidBlock, fluidResource); + return tryInsert(actor, networkSupplier, player, blockState, liquidBlock, fluidResource); } private boolean tryInsert(final Actor actor, @@ -59,7 +59,7 @@ private boolean tryInsert(final Actor actor, final LiquidBlock liquidBlock, final FluidResource fluidResource) { final long amount = Platform.INSTANCE.getBucketAmount(); - final long inserted = getStorageChannel(networkSupplier).insert(fluidResource, amount, Action.SIMULATE, actor); + final long inserted = getRootStorage(networkSupplier).insert(fluidResource, amount, Action.SIMULATE, actor); if (inserted != amount) { return false; } @@ -68,11 +68,11 @@ private boolean tryInsert(final Actor actor, sound -> level.playSound(null, pos, sound, SoundSource.BLOCKS, 1.0F, 1.0F) ); level.gameEvent(actingPlayer, GameEvent.FLUID_PICKUP, pos); - getStorageChannel(networkSupplier).insert(fluidResource, amount, Action.EXECUTE, actor); + getRootStorage(networkSupplier).insert(fluidResource, amount, Action.EXECUTE, actor); return true; } - private StorageChannel getStorageChannel(final Supplier networkSupplier) { + private RootStorage getRootStorage(final Supplier networkSupplier) { return networkSupplier.get().getComponent(StorageNetworkComponent.class); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/FluidBreakDestructorStrategyFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/FluidBreakDestructorStrategyFactory.java new file mode 100644 index 000000000..3b5c54c1e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/FluidBreakDestructorStrategyFactory.java @@ -0,0 +1,22 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; + +import java.util.Optional; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; + +public class FluidBreakDestructorStrategyFactory implements DestructorStrategyFactory { + @Override + public Optional create(final ServerLevel level, + final BlockPos pos, + final Direction direction, + final UpgradeState upgradeState, + final boolean pickupItems) { + return Optional.of(new FluidBreakDestructorStrategy(level, pos)); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemDropConstructorStrategy.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemDropConstructorStrategy.java index 5d531c896..c4b8bf913 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemDropConstructorStrategy.java @@ -1,7 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; +package com.refinedmods.refinedstorage.common.constructordestructor; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -30,12 +29,7 @@ protected long getTransferAmount() { } @Override - protected boolean apply( - final ItemResource itemResource, - final ItemStack itemStack, - final Actor actor, - final Player actingPlayer - ) { + protected boolean apply(final ItemStack itemStack, final Actor actor, final Player actingPlayer) { final Vec3 position = new Vec3( getDispensePositionX(), getDispensePositionY(), diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemDropConstructorStrategyFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemDropConstructorStrategyFactory.java new file mode 100644 index 000000000..10c3be090 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemDropConstructorStrategyFactory.java @@ -0,0 +1,36 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategy; +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.content.Items; + +import java.util.Optional; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; + +public class ItemDropConstructorStrategyFactory implements ConstructorStrategyFactory { + @Override + public Optional create(final ServerLevel level, + final BlockPos pos, + final Direction direction, + final UpgradeState upgradeState, + final boolean dropItems) { + if (!dropItems) { + return Optional.empty(); + } + return Optional.of(new ItemDropConstructorStrategy( + level, + pos, + direction, + upgradeState.has(Items.INSTANCE.getStackUpgrade()) + )); + } + + @Override + public int getPriority() { + return -1; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemPickupDestructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemPickupDestructorStrategy.java new file mode 100644 index 000000000..438d56dd1 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemPickupDestructorStrategy.java @@ -0,0 +1,66 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage.api.resource.filter.Filter; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import java.util.List; +import java.util.function.Supplier; + +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.phys.AABB; + +class ItemPickupDestructorStrategy implements DestructorStrategy { + private final ServerLevel level; + private final BlockPos pos; + + ItemPickupDestructorStrategy(final ServerLevel level, final BlockPos pos) { + this.level = level; + this.pos = pos; + } + + @Override + public boolean apply(final Filter filter, + final Actor actor, + final Supplier networkSupplier, + final Player player) { + if (!level.isLoaded(pos)) { + return false; + } + final RootStorage rootStorage = networkSupplier.get().getComponent(StorageNetworkComponent.class); + final List items = level.getEntitiesOfClass(ItemEntity.class, new AABB(pos)); + for (final ItemEntity itemEntity : items) { + tryInsert(filter, actor, rootStorage, itemEntity); + } + return true; + } + + private void tryInsert(final Filter filter, + final Actor actor, + final RootStorage rootStorage, + final ItemEntity itemEntity) { + if (itemEntity.isRemoved()) { + return; + } + final ItemStack itemStack = itemEntity.getItem(); + final ItemResource itemResource = ItemResource.ofItemStack(itemStack); + if (!filter.isAllowed(itemResource)) { + return; + } + final int amount = itemStack.getCount(); + final long inserted = rootStorage.insert(itemResource, amount, Action.EXECUTE, actor); + itemStack.shrink((int) inserted); + if (itemStack.isEmpty()) { + itemEntity.discard(); + } + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemPickupDestructorStrategyFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemPickupDestructorStrategyFactory.java new file mode 100644 index 000000000..6aebe0ba7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ItemPickupDestructorStrategyFactory.java @@ -0,0 +1,30 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; + +import java.util.Optional; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; + +public class ItemPickupDestructorStrategyFactory implements DestructorStrategyFactory { + @Override + public Optional create(final ServerLevel level, + final BlockPos pos, + final Direction direction, + final UpgradeState upgradeState, + final boolean pickupItems) { + if (!pickupItems) { + return Optional.empty(); + } + return Optional.of(new ItemPickupDestructorStrategy(level, pos)); + } + + @Override + public int getPriority() { + return -1; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/PlaceBlockConstructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/PlaceBlockConstructorStrategy.java new file mode 100644 index 000000000..3d7370ae2 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/PlaceBlockConstructorStrategy.java @@ -0,0 +1,29 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.common.Platform; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.ItemStack; + +public class PlaceBlockConstructorStrategy extends AbstractItemConstructorStrategy { + public PlaceBlockConstructorStrategy( + final ServerLevel level, + final BlockPos pos, + final Direction direction + ) { + super(level, pos, direction); + } + + @Override + protected boolean apply(final ItemStack itemStack, final Actor actor, final Player actingPlayer) { + if (!(itemStack.getItem() instanceof BlockItem)) { + return false; + } + return Platform.INSTANCE.placeBlock(level, pos, direction, actingPlayer, itemStack); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/PlaceFireworksConstructorStrategy.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/PlaceFireworksConstructorStrategy.java index 52477ba8d..20fee8e5e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/PlaceFireworksConstructorStrategy.java @@ -1,7 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; +package com.refinedmods.refinedstorage.common.constructordestructor; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -21,12 +20,7 @@ public PlaceFireworksConstructorStrategy( } @Override - protected boolean apply( - final ItemResource itemResource, - final ItemStack itemStack, - final Actor actor, - final Player actingPlayer - ) { + protected boolean apply(final ItemStack itemStack, final Actor actor, final Player actingPlayer) { if (!(itemStack.getItem() instanceof FireworkRocketItem)) { return false; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/PlaceFluidConstructorStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/PlaceFluidConstructorStrategy.java new file mode 100644 index 000000000..2a5f4523c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/PlaceFluidConstructorStrategy.java @@ -0,0 +1,59 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategy; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.player.Player; + +public class PlaceFluidConstructorStrategy implements ConstructorStrategy { + protected final ServerLevel level; + protected final BlockPos pos; + protected final Direction direction; + + public PlaceFluidConstructorStrategy(final ServerLevel level, final BlockPos pos, final Direction direction) { + this.level = level; + this.pos = pos; + this.direction = direction; + } + + @Override + public boolean apply( + final ResourceKey resource, + final Actor actor, + final Player player, + final Network network + ) { + if (!level.isLoaded(pos)) { + return false; + } + if (!(resource instanceof FluidResource fluidResource)) { + return false; + } + final RootStorage rootStorage = network.getComponent(StorageNetworkComponent.class); + final long bucketAmount = Platform.INSTANCE.getBucketAmount(); + final long extractedAmount = rootStorage.extract( + fluidResource, + bucketAmount, + Action.SIMULATE, + actor + ); + if (bucketAmount != extractedAmount) { + return false; + } + final boolean success = Platform.INSTANCE.placeFluid(level, pos, direction, player, fluidResource); + if (success) { + rootStorage.extract(fluidResource, bucketAmount, Action.EXECUTE, actor); + } + return success; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/package-info.java new file mode 100644 index 000000000..0840bf54f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockColorMap.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockColorMap.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockColorMap.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockColorMap.java index 78903ff2d..1d3c5896d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockColorMap.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockColorMap.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; import java.util.Objects; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockConstants.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockConstants.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockConstants.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockConstants.java index 06eb6bead..d5605fc3a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockConstants.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockConstants.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.state.BlockBehaviour; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockEntities.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockEntities.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java index 668b65a4d..35b5a0801 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockEntities.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java @@ -1,30 +1,30 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.ConstructorBlockEntity; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.DestructorBlockEntity; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.detector.DetectorBlockEntity; -import com.refinedmods.refinedstorage.platform.common.exporter.ExporterBlockEntity; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.grid.GridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.iface.InterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.importer.ImporterBlockEntity; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkReceiverBlockEntity; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterBlockEntity; -import com.refinedmods.refinedstorage.platform.common.networking.RelayBlockEntity; -import com.refinedmods.refinedstorage.platform.common.security.SecurityManagerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.externalstorage.ExternalStorageBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.AbstractPortableGridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.FluidStorageBlockBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.ItemStorageBlockBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.StorageMonitorBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.network.BaseNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.WirelessTransmitterBlockEntity; +import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorBlockEntity; +import com.refinedmods.refinedstorage.common.constructordestructor.DestructorBlockEntity; +import com.refinedmods.refinedstorage.common.controller.ControllerBlockEntity; +import com.refinedmods.refinedstorage.common.detector.DetectorBlockEntity; +import com.refinedmods.refinedstorage.common.exporter.ExporterBlockEntity; +import com.refinedmods.refinedstorage.common.grid.CraftingGridBlockEntity; +import com.refinedmods.refinedstorage.common.grid.GridBlockEntity; +import com.refinedmods.refinedstorage.common.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.importer.ImporterBlockEntity; +import com.refinedmods.refinedstorage.common.networking.NetworkReceiverBlockEntity; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterBlockEntity; +import com.refinedmods.refinedstorage.common.networking.RelayBlockEntity; +import com.refinedmods.refinedstorage.common.security.SecurityManagerBlockEntity; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.storage.externalstorage.ExternalStorageBlockEntity; +import com.refinedmods.refinedstorage.common.storage.portablegrid.AbstractPortableGridBlockEntity; +import com.refinedmods.refinedstorage.common.storage.storageblock.FluidStorageBlockBlockEntity; +import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlockBlockEntity; +import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorBlockEntity; +import com.refinedmods.refinedstorage.common.support.network.BaseNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterBlockEntity; import java.util.EnumMap; import java.util.Map; @@ -50,10 +50,10 @@ public final class BlockEntities { private Supplier> controller; @Nullable private Supplier> creativeController; - private final Map>> - itemStorageBlocks = new EnumMap<>(ItemStorageType.Variant.class); - private final Map>> - fluidStorageBlocks = new EnumMap<>(FluidStorageType.Variant.class); + private final Map>> + itemStorageBlocks = new EnumMap<>(ItemStorageVariant.class); + private final Map>> + fluidStorageBlocks = new EnumMap<>(FluidStorageVariant.class); @Nullable private Supplier> importer; @Nullable @@ -140,21 +140,21 @@ public void setCreativeController(final Supplier> supplier) { itemStorageBlocks.put(variant, supplier); } - public BlockEntityType getItemStorageBlock(final ItemStorageType.Variant variant) { + public BlockEntityType getItemStorageBlock(final ItemStorageVariant variant) { return itemStorageBlocks.get(variant).get(); } - public void setFluidStorageBlock(final FluidStorageType.Variant variant, + public void setFluidStorageBlock(final FluidStorageVariant variant, final Supplier> supplier) { fluidStorageBlocks.put(variant, supplier); } - public BlockEntityType getFluidStorageBlock(final FluidStorageType.Variant variant) { + public BlockEntityType getFluidStorageBlock(final FluidStorageVariant variant) { return fluidStorageBlocks.get(variant).get(); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockEntityTypeFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntityTypeFactory.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockEntityTypeFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntityTypeFactory.java index 215520e30..7241a7550 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockEntityTypeFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntityTypeFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.Block; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockFactory.java similarity index 80% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockFactory.java index b5db3628c..41c0fdf34 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/BlockFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.item.DyeColor; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Blocks.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Blocks.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java index b81e21c95..1ad8a5c1e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Blocks.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java @@ -1,37 +1,37 @@ -package com.refinedmods.refinedstorage.platform.common.content; - -import com.refinedmods.refinedstorage.platform.common.constructordestructor.ConstructorBlock; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.DestructorBlock; -import com.refinedmods.refinedstorage.platform.common.controller.AbstractControllerBlock; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerBlock; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerBlockItem; -import com.refinedmods.refinedstorage.platform.common.controller.CreativeControllerBlock; -import com.refinedmods.refinedstorage.platform.common.controller.CreativeControllerBlockItem; -import com.refinedmods.refinedstorage.platform.common.detector.DetectorBlock; -import com.refinedmods.refinedstorage.platform.common.exporter.ExporterBlock; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridBlock; -import com.refinedmods.refinedstorage.platform.common.grid.GridBlock; -import com.refinedmods.refinedstorage.platform.common.iface.InterfaceBlock; -import com.refinedmods.refinedstorage.platform.common.importer.ImporterBlock; -import com.refinedmods.refinedstorage.platform.common.networking.CableBlock; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkReceiverBlock; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterBlock; -import com.refinedmods.refinedstorage.platform.common.networking.RelayBlock; -import com.refinedmods.refinedstorage.platform.common.security.SecurityManagerBlock; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.DiskDriveBlock; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.DiskInterfaceBlock; -import com.refinedmods.refinedstorage.platform.common.storage.externalstorage.ExternalStorageBlock; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlock; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.FluidStorageBlock; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.ItemStorageBlock; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.StorageMonitorBlock; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.SimpleBlock; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.WirelessTransmitterBlock; +package com.refinedmods.refinedstorage.common.content; + +import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorBlock; +import com.refinedmods.refinedstorage.common.constructordestructor.DestructorBlock; +import com.refinedmods.refinedstorage.common.controller.AbstractControllerBlock; +import com.refinedmods.refinedstorage.common.controller.ControllerBlock; +import com.refinedmods.refinedstorage.common.controller.ControllerBlockEntityTicker; +import com.refinedmods.refinedstorage.common.controller.ControllerBlockItem; +import com.refinedmods.refinedstorage.common.controller.CreativeControllerBlock; +import com.refinedmods.refinedstorage.common.controller.CreativeControllerBlockItem; +import com.refinedmods.refinedstorage.common.detector.DetectorBlock; +import com.refinedmods.refinedstorage.common.exporter.ExporterBlock; +import com.refinedmods.refinedstorage.common.grid.CraftingGridBlock; +import com.refinedmods.refinedstorage.common.grid.GridBlock; +import com.refinedmods.refinedstorage.common.iface.InterfaceBlock; +import com.refinedmods.refinedstorage.common.importer.ImporterBlock; +import com.refinedmods.refinedstorage.common.networking.CableBlock; +import com.refinedmods.refinedstorage.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterBlock; +import com.refinedmods.refinedstorage.common.networking.RelayBlock; +import com.refinedmods.refinedstorage.common.security.SecurityManagerBlock; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.diskdrive.DiskDriveBlock; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.storage.diskinterface.DiskInterfaceBlock; +import com.refinedmods.refinedstorage.common.storage.externalstorage.ExternalStorageBlock; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlock; +import com.refinedmods.refinedstorage.common.storage.storageblock.FluidStorageBlock; +import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlock; +import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorBlock; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.SimpleBlock; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterBlock; import java.util.EnumMap; import java.util.Map; @@ -167,10 +167,10 @@ public final class Blocks { private Supplier diskDrive; @Nullable private Supplier machineCasing; - private final Map> itemStorageBlocks = - new EnumMap<>(ItemStorageType.Variant.class); - private final Map> fluidStorageBlocks = - new EnumMap<>(FluidStorageType.Variant.class); + private final Map> itemStorageBlocks = + new EnumMap<>(ItemStorageVariant.class); + private final Map> fluidStorageBlocks = + new EnumMap<>(FluidStorageVariant.class); @Nullable private Supplier iface; @Nullable @@ -237,20 +237,20 @@ public void setMachineCasing(final Supplier machineCasingSupplier) this.machineCasing = machineCasingSupplier; } - public void setItemStorageBlock(final ItemStorageType.Variant variant, final Supplier supplier) { + public void setItemStorageBlock(final ItemStorageVariant variant, final Supplier supplier) { itemStorageBlocks.put(variant, supplier); } - public ItemStorageBlock getItemStorageBlock(final ItemStorageType.Variant variant) { + public ItemStorageBlock getItemStorageBlock(final ItemStorageVariant variant) { return itemStorageBlocks.get(variant).get(); } - public void setFluidStorageBlock(final FluidStorageType.Variant variant, + public void setFluidStorageBlock(final FluidStorageVariant variant, final Supplier supplier) { fluidStorageBlocks.put(variant, supplier); } - public FluidStorageBlock getFluidStorageBlock(final FluidStorageType.Variant variant) { + public FluidStorageBlock getFluidStorageBlock(final FluidStorageVariant variant) { return fluidStorageBlocks.get(variant).get(); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ColorMap.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ColorMap.java similarity index 97% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ColorMap.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ColorMap.java index f003f4160..e39bfa7b1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ColorMap.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ColorMap.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import java.util.Collection; import java.util.Comparator; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentIds.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentIds.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentIds.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentIds.java index 74091a182..e49c5a4aa 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentIds.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentIds.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; -import com.refinedmods.refinedstorage.platform.common.misc.ProcessorItem; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; +import com.refinedmods.refinedstorage.common.misc.ProcessorItem; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; import net.minecraft.resources.ResourceLocation; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public final class ContentIds { public static final ResourceLocation DISK_DRIVE = createIdentifier("disk_drive"); @@ -67,19 +67,19 @@ public final class ContentIds { private ContentIds() { } - public static ResourceLocation forItemStoragePart(final ItemStorageType.Variant variant) { + public static ResourceLocation forItemStoragePart(final ItemStorageVariant variant) { return createIdentifier(variant.getName() + "_storage_part"); } - public static ResourceLocation forItemStorageBlock(final ItemStorageType.Variant variant) { + public static ResourceLocation forItemStorageBlock(final ItemStorageVariant variant) { return createIdentifier(variant.getName() + "_storage_block"); } - public static ResourceLocation forFluidStoragePart(final FluidStorageType.Variant variant) { + public static ResourceLocation forFluidStoragePart(final FluidStorageVariant variant) { return createIdentifier(variant.getName() + "_fluid_storage_part"); } - public static ResourceLocation forFluidStorageBlock(final FluidStorageType.Variant variant) { + public static ResourceLocation forFluidStorageBlock(final FluidStorageVariant variant) { return createIdentifier(variant.getName() + "_fluid_storage_block"); } @@ -87,11 +87,11 @@ public static ResourceLocation forProcessor(final ProcessorItem.Type type) { return createIdentifier(type.getName() + "_processor"); } - public static ResourceLocation forStorageDisk(final ItemStorageType.Variant variant) { + public static ResourceLocation forStorageDisk(final ItemStorageVariant variant) { return createIdentifier(variant.getName() + "_storage_disk"); } - public static ResourceLocation forFluidStorageDisk(final FluidStorageType.Variant variant) { + public static ResourceLocation forFluidStorageDisk(final FluidStorageVariant variant) { return createIdentifier(variant.getName() + "_fluid_storage_disk"); } } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentNames.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentNames.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentNames.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentNames.java index ec4706e4f..15dbaf974 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentNames.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentNames.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.MOD_ID; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslationKey; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.MOD_ID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslationKey; public final class ContentNames { public static final String MOD_TRANSLATION_KEY = "mod." + MOD_ID; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/CreativeModeTabItems.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/CreativeModeTabItems.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/CreativeModeTabItems.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/CreativeModeTabItems.java index 23d829a47..25c381fca 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/CreativeModeTabItems.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/CreativeModeTabItems.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; -import com.refinedmods.refinedstorage.platform.common.misc.ProcessorItem; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; +import com.refinedmods.refinedstorage.common.misc.ProcessorItem; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; import java.util.Arrays; import java.util.function.Consumer; @@ -42,10 +42,10 @@ private static void appendBlocks(final Consumer consumer) { itemConsumer.accept(Items.INSTANCE.getCreativePortableGrid()); Items.INSTANCE.getDetectors().stream().map(Supplier::get).forEach(itemConsumer); itemConsumer.accept(Blocks.INSTANCE.getInterface()); - Arrays.stream(ItemStorageType.Variant.values()).forEach(variant -> itemConsumer.accept( + Arrays.stream(ItemStorageVariant.values()).forEach(variant -> itemConsumer.accept( Blocks.INSTANCE.getItemStorageBlock(variant) )); - Arrays.stream(FluidStorageType.Variant.values()).forEach(variant -> itemConsumer.accept( + Arrays.stream(FluidStorageVariant.values()).forEach(variant -> itemConsumer.accept( Blocks.INSTANCE.getFluidStorageBlock(variant) )); itemConsumer.accept(Blocks.INSTANCE.getMachineCasing()); @@ -76,19 +76,19 @@ private static void appendItems(final Consumer consumer) { itemConsumer.accept(Items.INSTANCE.getConstructionCore()); itemConsumer.accept(Items.INSTANCE.getDestructionCore()); - Arrays.stream(ItemStorageType.Variant.values()) - .filter(variant -> variant != ItemStorageType.Variant.CREATIVE) + Arrays.stream(ItemStorageVariant.values()) + .filter(variant -> variant != ItemStorageVariant.CREATIVE) .map(Items.INSTANCE::getItemStoragePart) .forEach(itemConsumer); - Arrays.stream(FluidStorageType.Variant.values()) - .filter(variant -> variant != FluidStorageType.Variant.CREATIVE) + Arrays.stream(FluidStorageVariant.values()) + .filter(variant -> variant != FluidStorageVariant.CREATIVE) .map(Items.INSTANCE::getFluidStoragePart) .forEach(itemConsumer); - Arrays.stream(ItemStorageType.Variant.values()).forEach(variant -> itemConsumer.accept( + Arrays.stream(ItemStorageVariant.values()).forEach(variant -> itemConsumer.accept( Items.INSTANCE.getItemStorageDisk(variant) )); - Arrays.stream(FluidStorageType.Variant.values()).forEach(variant -> itemConsumer.accept( + Arrays.stream(FluidStorageVariant.values()).forEach(variant -> itemConsumer.accept( Items.INSTANCE.getFluidStorageDisk(variant) )); itemConsumer.accept(Items.INSTANCE.getStorageHousing()); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/DataComponents.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DataComponents.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/DataComponents.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DataComponents.java index ba8107a77..5f8746eb6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/DataComponents.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DataComponents.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; -import com.refinedmods.refinedstorage.platform.common.configurationcard.ConfigurationCardState; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardBoundPlayer; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardPermissions; -import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeState; +import com.refinedmods.refinedstorage.common.configurationcard.ConfigurationCardState; +import com.refinedmods.refinedstorage.common.security.SecurityCardBoundPlayer; +import com.refinedmods.refinedstorage.common.security.SecurityCardPermissions; +import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeState; import java.util.UUID; import java.util.function.Supplier; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/DefaultEnergyUsage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java similarity index 97% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/DefaultEnergyUsage.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java index be4e752ad..01a3e8648 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/DefaultEnergyUsage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; public final class DefaultEnergyUsage { public static final long CABLE = 0; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/DirectRegistryCallback.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DirectRegistryCallback.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/DirectRegistryCallback.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DirectRegistryCallback.java index a8b3dbe03..9523bcea3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/DirectRegistryCallback.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DirectRegistryCallback.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import java.util.function.Supplier; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ExtendedMenuTypeFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ExtendedMenuTypeFactory.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ExtendedMenuTypeFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ExtendedMenuTypeFactory.java index e1175e812..90a869ede 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ExtendedMenuTypeFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ExtendedMenuTypeFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Items.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Items.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Items.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Items.java index df4f724a3..48d1f51f9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Items.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Items.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage.platform.common.content; - -import com.refinedmods.refinedstorage.platform.api.upgrade.AbstractUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerBlockItem; -import com.refinedmods.refinedstorage.platform.common.controller.CreativeControllerBlockItem; -import com.refinedmods.refinedstorage.platform.common.grid.WirelessGridItem; -import com.refinedmods.refinedstorage.platform.common.misc.ProcessorItem; -import com.refinedmods.refinedstorage.platform.common.security.FallbackSecurityCardItem; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardItem; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; +package com.refinedmods.refinedstorage.common.content; + +import com.refinedmods.refinedstorage.common.api.upgrade.AbstractUpgradeItem; +import com.refinedmods.refinedstorage.common.controller.ControllerBlockItem; +import com.refinedmods.refinedstorage.common.controller.CreativeControllerBlockItem; +import com.refinedmods.refinedstorage.common.grid.WirelessGridItem; +import com.refinedmods.refinedstorage.common.misc.ProcessorItem; +import com.refinedmods.refinedstorage.common.security.FallbackSecurityCardItem; +import com.refinedmods.refinedstorage.common.security.SecurityCardItem; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockItem; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; import java.util.ArrayList; import java.util.Collections; @@ -27,14 +27,14 @@ public final class Items { public static final Items INSTANCE = new Items(); - private final Map> itemStorageParts - = new EnumMap<>(ItemStorageType.Variant.class); - private final Map> fluidStorageParts - = new EnumMap<>(FluidStorageType.Variant.class); - private final Map> itemStorageDisks - = new EnumMap<>(ItemStorageType.Variant.class); - private final Map> fluidStorageDisks - = new EnumMap<>(FluidStorageType.Variant.class); + private final Map> itemStorageParts + = new EnumMap<>(ItemStorageVariant.class); + private final Map> fluidStorageParts + = new EnumMap<>(FluidStorageVariant.class); + private final Map> itemStorageDisks + = new EnumMap<>(ItemStorageVariant.class); + private final Map> fluidStorageDisks + = new EnumMap<>(FluidStorageVariant.class); private final List> allControllers = new ArrayList<>(); private final List> allCreativeControllers = new ArrayList<>(); private final List> allCables = new ArrayList<>(); @@ -107,35 +107,35 @@ public final class Items { private Items() { } - public Item getItemStoragePart(final ItemStorageType.Variant variant) { + public Item getItemStoragePart(final ItemStorageVariant variant) { return itemStorageParts.get(variant).get(); } - public void setItemStoragePart(final ItemStorageType.Variant variant, final Supplier supplier) { + public void setItemStoragePart(final ItemStorageVariant variant, final Supplier supplier) { itemStorageParts.put(variant, supplier); } - public Item getItemStorageDisk(final ItemStorageType.Variant variant) { + public Item getItemStorageDisk(final ItemStorageVariant variant) { return itemStorageDisks.get(variant).get(); } - public void setItemStorageDisk(final ItemStorageType.Variant variant, final Supplier supplier) { + public void setItemStorageDisk(final ItemStorageVariant variant, final Supplier supplier) { itemStorageDisks.put(variant, supplier); } - public Item getFluidStoragePart(final FluidStorageType.Variant type) { + public Item getFluidStoragePart(final FluidStorageVariant type) { return fluidStorageParts.get(type).get(); } - public void setFluidStoragePart(final FluidStorageType.Variant variant, final Supplier supplier) { + public void setFluidStoragePart(final FluidStorageVariant variant, final Supplier supplier) { fluidStorageParts.put(variant, supplier); } - public Item getFluidStorageDisk(final FluidStorageType.Variant variant) { + public Item getFluidStorageDisk(final FluidStorageVariant variant) { return fluidStorageDisks.get(variant).get(); } - public void setFluidStorageDisk(final FluidStorageType.Variant variant, final Supplier supplier) { + public void setFluidStorageDisk(final FluidStorageVariant variant, final Supplier supplier) { fluidStorageDisks.put(variant, supplier); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/KeyMappings.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/KeyMappings.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/KeyMappings.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/KeyMappings.java index 897727fda..ee88ed6ae 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/KeyMappings.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/KeyMappings.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import java.util.Objects; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/LootFunctions.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/LootFunctions.java similarity index 80% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/LootFunctions.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/LootFunctions.java index e31dba985..9f58df1f2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/LootFunctions.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/LootFunctions.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridLootItemFunction; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.StorageBlockLootItemFunction; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyLootItemFunction; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridLootItemFunction; +import com.refinedmods.refinedstorage.common.storage.storageblock.StorageBlockLootItemFunction; +import com.refinedmods.refinedstorage.common.support.energy.EnergyLootItemFunction; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/MenuTypeFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/MenuTypeFactory.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/MenuTypeFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/MenuTypeFactory.java index ec3e58f6a..dea2d7172 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/MenuTypeFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/MenuTypeFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.inventory.AbstractContainerMenu; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Menus.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Menus.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java index c8c132c8f..e314602ff 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Menus.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java @@ -1,30 +1,30 @@ -package com.refinedmods.refinedstorage.platform.common.content; - -import com.refinedmods.refinedstorage.platform.common.constructordestructor.ConstructorContainerMenu; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.DestructorContainerMenu; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerContainerMenu; -import com.refinedmods.refinedstorage.platform.common.detector.DetectorContainerMenu; -import com.refinedmods.refinedstorage.platform.common.exporter.ExporterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.GridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.WirelessGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.iface.InterfaceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.importer.ImporterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.networking.RelayContainerMenu; -import com.refinedmods.refinedstorage.platform.common.security.FallbackSecurityCardContainerMenu; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardContainerMenu; -import com.refinedmods.refinedstorage.platform.common.security.SecurityManagerContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.DiskDriveContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.DiskInterfaceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.externalstorage.ExternalStorageContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlockContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridItemContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.FluidStorageBlockContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.ItemStorageBlockContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.StorageMonitorContainerMenu; -import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeContainerMenu; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.WirelessTransmitterContainerMenu; +package com.refinedmods.refinedstorage.common.content; + +import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorContainerMenu; +import com.refinedmods.refinedstorage.common.constructordestructor.DestructorContainerMenu; +import com.refinedmods.refinedstorage.common.controller.ControllerContainerMenu; +import com.refinedmods.refinedstorage.common.detector.DetectorContainerMenu; +import com.refinedmods.refinedstorage.common.exporter.ExporterContainerMenu; +import com.refinedmods.refinedstorage.common.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.GridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.WirelessGridContainerMenu; +import com.refinedmods.refinedstorage.common.iface.InterfaceContainerMenu; +import com.refinedmods.refinedstorage.common.importer.ImporterContainerMenu; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage.common.networking.RelayContainerMenu; +import com.refinedmods.refinedstorage.common.security.FallbackSecurityCardContainerMenu; +import com.refinedmods.refinedstorage.common.security.SecurityCardContainerMenu; +import com.refinedmods.refinedstorage.common.security.SecurityManagerContainerMenu; +import com.refinedmods.refinedstorage.common.storage.diskdrive.DiskDriveContainerMenu; +import com.refinedmods.refinedstorage.common.storage.diskinterface.DiskInterfaceContainerMenu; +import com.refinedmods.refinedstorage.common.storage.externalstorage.ExternalStorageContainerMenu; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockContainerMenu; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridItemContainerMenu; +import com.refinedmods.refinedstorage.common.storage.storageblock.FluidStorageBlockContainerMenu; +import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlockContainerMenu; +import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorContainerMenu; +import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeContainerMenu; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterContainerMenu; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/RegistryCallback.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/RegistryCallback.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/RegistryCallback.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/RegistryCallback.java index abc5a4d5b..6fb51fce1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/RegistryCallback.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/RegistryCallback.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import java.util.function.Supplier; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Sounds.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Sounds.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Sounds.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Sounds.java index 93e32482c..088de958f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Sounds.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Sounds.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import java.util.Objects; import java.util.function.Supplier; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Tags.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Tags.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Tags.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Tags.java index 7181bd4ab..ce7b848c9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/Tags.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Tags.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.content; +package com.refinedmods.refinedstorage.common.content; import net.minecraft.core.registries.Registries; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public final class Tags { public static final TagKey CABLES = createTag("cables"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/package-info.java new file mode 100644 index 000000000..aac3efdb1 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.content; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/AbstractControllerBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/AbstractControllerBlock.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/AbstractControllerBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/AbstractControllerBlock.java index f3f2cf266..62b54d925 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/AbstractControllerBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/AbstractControllerBlock.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.controller; +package com.refinedmods.refinedstorage.common.controller; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseBlock; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.ColorableBlock; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.MutableComponent; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlock.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlock.java index 4dc5b63bb..0538e354f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlock.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.controller; +package com.refinedmods.refinedstorage.common.controller; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.Blocks; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.item.DyeColor; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntity.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntity.java index f2949e14e..455822a92 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntity.java @@ -1,17 +1,17 @@ -package com.refinedmods.refinedstorage.platform.common.controller; +package com.refinedmods.refinedstorage.common.controller; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyStorageImpl; import com.refinedmods.refinedstorage.api.network.impl.node.controller.ControllerNetworkNode; -import com.refinedmods.refinedstorage.platform.api.support.energy.TransferableBlockEntityEnergy; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.energy.BlockEntityEnergyStorage; -import com.refinedmods.refinedstorage.platform.common.support.energy.CreativeEnergyStorage; -import com.refinedmods.refinedstorage.platform.common.support.energy.ItemBlockEnergyStorage; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.energy.TransferableBlockEntityEnergy; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.energy.BlockEntityEnergyStorage; +import com.refinedmods.refinedstorage.common.support.energy.CreativeEnergyStorage; +import com.refinedmods.refinedstorage.common.support.energy.ItemBlockEnergyStorage; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.google.common.util.concurrent.RateLimiter; import net.minecraft.core.BlockPos; @@ -43,7 +43,7 @@ public ControllerBlockEntity(final ControllerType type, final BlockPos pos, fina super(getBlockEntityType(type), pos, state, new ControllerNetworkNode()); this.type = type; this.energyStorage = createEnergyStorage(type, this); - this.mainNode.setEnergyStorage(energyStorage); + this.mainNetworkNode.setEnergyStorage(energyStorage); } private static EnergyStorage createEnergyStorage(final ControllerType type, final BlockEntity blockEntity) { @@ -64,7 +64,7 @@ private static BlockEntityType getBlockEntityType(final C public void updateEnergyTypeInLevel(final BlockState state) { final ControllerEnergyType currentEnergyType = state.getValue(AbstractControllerBlock.ENERGY_TYPE); - final ControllerEnergyType newEnergyType = ControllerEnergyType.ofState(mainNode.getState()); + final ControllerEnergyType newEnergyType = ControllerEnergyType.ofState(mainNetworkNode.getState()); if (newEnergyType != currentEnergyType && level != null && energyStateChangeRateLimiter.tryAcquire()) { LOGGER.debug( "Energy type state change for controller at {}: {} -> {}", @@ -79,12 +79,12 @@ public void updateEnergyTypeInLevel(final BlockState state) { @Override public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { super.saveAdditional(tag, provider); - ItemBlockEnergyStorage.writeToTag(tag, mainNode.getActualStored()); + ItemBlockEnergyStorage.writeToTag(tag, mainNetworkNode.getActualStored()); saveRenderingInfo(tag); } private void saveRenderingInfo(final CompoundTag tag) { - tag.putLong(TAG_CAPACITY, mainNode.getActualCapacity()); + tag.putLong(TAG_CAPACITY, mainNetworkNode.getActualCapacity()); } @Override @@ -114,11 +114,11 @@ public StreamEncoder getMenuCodec() { } long getActualStored() { - return mainNode.getActualStored(); + return mainNetworkNode.getActualStored(); } long getActualCapacity() { - return mainNode.getActualCapacity(); + return mainNetworkNode.getActualCapacity(); } @Override diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlockEntityTicker.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntityTicker.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlockEntityTicker.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntityTicker.java index 301b0a961..88ca713aa 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlockEntityTicker.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntityTicker.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.controller; +package com.refinedmods.refinedstorage.common.controller; import com.refinedmods.refinedstorage.api.network.impl.node.controller.ControllerNetworkNode; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; import java.util.function.Supplier; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockItem.java new file mode 100644 index 000000000..fa465951c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockItem.java @@ -0,0 +1,70 @@ +package com.refinedmods.refinedstorage.common.controller; + +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyStorageImpl; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.support.energy.AbstractEnergyBlockItem; +import com.refinedmods.refinedstorage.common.content.BlockEntities; + +import java.util.Optional; + +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ControllerBlockItem extends AbstractEnergyBlockItem { + private final Block block; + + ControllerBlockItem(final Block block) { + super(block, new Item.Properties().stacksTo(1), RefinedStorageApi.INSTANCE.getEnergyItemHelper()); + this.block = block; + } + + @Override + public Component getDescription() { + return block.getName(); + } + + @Override + public Component getName(final ItemStack stack) { + return block.getName(); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(createTranslation("item", "controller.help"))); + } + + public EnergyStorage createEnergyStorage(final ItemStack stack) { + final EnergyStorage energyStorage = new EnergyStorageImpl( + Platform.INSTANCE.getConfig().getController().getEnergyCapacity() + ); + return RefinedStorageApi.INSTANCE.asBlockItemEnergyStorage( + energyStorage, + stack, + BlockEntities.INSTANCE.getController() + ); + } + + @Override + protected boolean placeBlock(final BlockPlaceContext ctx, final BlockState state) { + if (ctx.getPlayer() instanceof ServerPlayer serverPlayer && !(RefinedStorageApi.INSTANCE.canPlaceNetworkNode( + serverPlayer, + ctx.getLevel(), + ctx.getClickedPos(), + state)) + ) { + return false; + } + return super.placeBlock(ctx, state); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerContainerMenu.java new file mode 100644 index 000000000..85200a5a2 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerContainerMenu.java @@ -0,0 +1,59 @@ +package com.refinedmods.refinedstorage.common.controller; + +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.energy.EnergyContainerMenu; +import com.refinedmods.refinedstorage.common.support.energy.EnergyInfo; + +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +public class ControllerContainerMenu extends AbstractBaseContainerMenu implements EnergyContainerMenu { + private final EnergyInfo energyInfo; + + public ControllerContainerMenu(final int syncId, + final Inventory playerInventory, + final ControllerData controllerData) { + super(Menus.INSTANCE.getController(), syncId); + addPlayerInventory(playerInventory, 8, 107); + this.energyInfo = EnergyInfo.forClient( + playerInventory.player, + controllerData.stored(), + controllerData.capacity() + ); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + } + + ControllerContainerMenu(final int syncId, + final Inventory playerInventory, + final ControllerBlockEntity controller, + final Player player) { + super(Menus.INSTANCE.getController(), syncId); + this.energyInfo = EnergyInfo.forServer( + player, + controller::getActualStored, + controller::getActualCapacity + ); + addPlayerInventory(playerInventory, 8, 107); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + controller::getRedstoneMode, + controller::setRedstoneMode + )); + } + + @Override + public void broadcastChanges() { + super.broadcastChanges(); + energyInfo.detectChanges(); + } + + @Override + public EnergyInfo getEnergyInfo() { + return energyInfo; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerData.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerData.java index 6ef5837bb..438b059d5 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerData.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.controller; +package com.refinedmods.refinedstorage.common.controller; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerEnergyType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerEnergyType.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerEnergyType.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerEnergyType.java index b42670671..e849c35dd 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerEnergyType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerEnergyType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.controller; +package com.refinedmods.refinedstorage.common.controller; import com.refinedmods.refinedstorage.api.network.impl.node.controller.ControllerEnergyState; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerItemPropertyFunction.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerItemPropertyFunction.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerItemPropertyFunction.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerItemPropertyFunction.java index 846fafaca..e17f34ceb 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerItemPropertyFunction.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerItemPropertyFunction.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.controller; +package com.refinedmods.refinedstorage.common.controller; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import javax.annotation.Nullable; @@ -15,7 +15,7 @@ public float unclampedCall(final ItemStack stack, @Nullable final ClientLevel level, @Nullable final LivingEntity entity, final int seed) { - return PlatformApi.INSTANCE.getEnergyStorage(stack).map(energyStorage -> { + return RefinedStorageApi.INSTANCE.getEnergyStorage(stack).map(energyStorage -> { if (energyStorage.getStored() == 0) { return 1F; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerScreen.java new file mode 100644 index 000000000..52f22ab2e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerScreen.java @@ -0,0 +1,57 @@ +package com.refinedmods.refinedstorage.common.controller; + +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.ProgressWidget; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; + +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ControllerScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/controller.png"); + + @Nullable + private ProgressWidget progressWidget; + + public ControllerScreen(final ControllerContainerMenu menu, final Inventory playerInventory, final Component text) { + super(menu, playerInventory, text); + this.inventoryLabelY = 94; + this.imageWidth = 176; + this.imageHeight = 189; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.REDSTONE_MODE), + createTranslation("gui", "controller.redstone_mode_help") + )); + if (progressWidget == null) { + progressWidget = new ProgressWidget( + leftPos + 80, + topPos + 20, + 16, + 70, + getMenu().getEnergyInfo()::getPercentageFull, + getMenu().getEnergyInfo()::createTooltip + ); + } else { + progressWidget.setX(leftPos + 80); + progressWidget.setY(topPos + 20); + } + addRenderableWidget(progressWidget); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerType.java new file mode 100644 index 000000000..5e3e39bdf --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerType.java @@ -0,0 +1,6 @@ +package com.refinedmods.refinedstorage.common.controller; + +public enum ControllerType { + NORMAL, + CREATIVE +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/CreativeControllerBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/CreativeControllerBlock.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/CreativeControllerBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/CreativeControllerBlock.java index ed951bb4d..22f4f76b9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/CreativeControllerBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/CreativeControllerBlock.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.controller; +package com.refinedmods.refinedstorage.common.controller; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.Blocks; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.item.DyeColor; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/CreativeControllerBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/CreativeControllerBlockItem.java new file mode 100644 index 000000000..364b5a6dc --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/CreativeControllerBlockItem.java @@ -0,0 +1,17 @@ +package com.refinedmods.refinedstorage.common.controller; + +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; + +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class CreativeControllerBlockItem extends NetworkNodeBlockItem { + private static final MutableComponent HELP = createTranslation("item", "creative_controller.help"); + + CreativeControllerBlockItem(final Block block) { + super(block, new Item.Properties().stacksTo(1), HELP); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/package-info.java new file mode 100644 index 000000000..42204e854 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.controller; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlock.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlock.java index c6869cef2..f9945409a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlock.java @@ -1,18 +1,18 @@ -package com.refinedmods.refinedstorage.platform.common.detector; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.ColorableBlock; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.direction.DefaultDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; +package com.refinedmods.refinedstorage.common.detector; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.ColorableBlock; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.direction.DefaultDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -33,7 +33,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class DetectorBlock extends AbstractDirectionalBlock implements ColorableBlock, SimpleWaterloggedBlock, EntityBlock, @@ -90,7 +90,6 @@ public MutableComponent getName() { } @Override - @SuppressWarnings("deprecation") public VoxelShape getShape(final BlockState state, final BlockGetter world, final BlockPos pos, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlockEntity.java new file mode 100644 index 000000000..f3e5606be --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlockEntity.java @@ -0,0 +1,178 @@ +package com.refinedmods.refinedstorage.common.detector; + +import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorAmountStrategy; +import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorAmountStrategyImpl; +import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorMode; +import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorNetworkNode; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.containermenu.SingleAmountData; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; + +import java.util.Optional; +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.core.BlockPos; +import net.minecraft.core.HolderLookup; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.network.codec.StreamEncoder; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DetectorBlockEntity extends AbstractRedstoneModeNetworkNodeContainerBlockEntity + implements NetworkNodeExtendedMenuProvider { + private static final Logger LOGGER = LoggerFactory.getLogger(DetectorBlockEntity.class); + + private static final String TAG_AMOUNT = "amount"; + private static final String TAG_MODE = "mode"; + + private final FilterWithFuzzyMode filter; + private final RateLimiter poweredChangeRateLimiter = RateLimiter.create(1); + + private double amount; + + public DetectorBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getDetector(), pos, state, new DetectorNetworkNode( + Platform.INSTANCE.getConfig().getDetector().getEnergyUsage() + )); + final ResourceContainer resourceContainer = ResourceContainerImpl.createForFilter(1); + this.filter = FilterWithFuzzyMode.createAndListenForFilters( + resourceContainer, + () -> { + propagateAmount(); + setChanged(); + }, + filters -> mainNetworkNode.setConfiguredResource(filters.isEmpty() ? null : filters.getFirst()) + ); + initialize(); + } + + @Override + protected InWorldNetworkNodeContainer createMainContainer(final DetectorNetworkNode networkNode) { + return RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, networkNode) + .connectionStrategy(new DetectorConnectionStrategy(this::getBlockState, getBlockPos())) + .build(); + } + + @Override + public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + super.writeConfiguration(tag, provider); + filter.save(tag, provider); + tag.putDouble(TAG_AMOUNT, amount); + tag.putInt(TAG_MODE, DetectorModeSettings.getDetectorMode(mainNetworkNode.getMode())); + } + + @Override + public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + super.readConfiguration(tag, provider); + filter.load(tag, provider); + if (tag.contains(TAG_AMOUNT)) { + this.amount = tag.getDouble(TAG_AMOUNT); + } + if (tag.contains(TAG_MODE)) { + mainNetworkNode.setMode(DetectorModeSettings.getDetectorMode(tag.getInt(TAG_MODE))); + } + initialize(); + propagateAmount(); + } + + void setAmount(final double amount) { + this.amount = amount; + propagateAmount(); + setChanged(); + } + + private void propagateAmount() { + final PlatformResourceKey configuredResource = filter.getFilterContainer().getResource(0); + final long normalizedAmount = configuredResource == null + ? (long) amount + : configuredResource.getResourceType().normalizeAmount(amount); + LOGGER.debug("Updating detector amount of {} normalized as {}", amount, normalizedAmount); + mainNetworkNode.setAmount(normalizedAmount); + } + + boolean isFuzzyMode() { + return filter.isFuzzyMode(); + } + + void setFuzzyMode(final boolean fuzzyMode) { + filter.setFuzzyMode(fuzzyMode); + initialize(); + } + + void setMode(final DetectorMode mode) { + mainNetworkNode.setMode(mode); + setChanged(); + } + + DetectorMode getMode() { + return mainNetworkNode.getMode(); + } + + private void initialize() { + final DetectorAmountStrategy defaultStrategy = new DetectorAmountStrategyImpl(); + final DetectorAmountStrategy strategy = isFuzzyMode() + ? new FuzzyDetectorAmountStrategy(defaultStrategy) + : defaultStrategy; + mainNetworkNode.setAmountStrategy(strategy); + } + + @Override + public SingleAmountData getMenuData() { + return new SingleAmountData( + Optional.empty(), + amount, + ResourceContainerData.of(filter.getFilterContainer()) + ); + } + + @Override + public StreamEncoder getMenuCodec() { + return SingleAmountData.STREAM_CODEC; + } + + @Override + public Component getDisplayName() { + return ContentNames.DETECTOR; + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new DetectorContainerMenu(syncId, player, this, filter.getFilterContainer()); + } + + @Override + public void updateActiveness(final BlockState state, @Nullable final BooleanProperty activenessProperty) { + super.updateActiveness(state, activenessProperty); + final boolean powered = mainNetworkNode.isActive() && mainNetworkNode.isActivated(); + final boolean needToUpdatePowered = state.getValue(DetectorBlock.POWERED) != powered; + if (level != null && needToUpdatePowered && poweredChangeRateLimiter.tryAcquire()) { + level.setBlockAndUpdate(getBlockPos(), state.setValue(DetectorBlock.POWERED, powered)); + } + } + + @Override + protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, + final BlockState newBlockState) { + return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorConnectionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorConnectionStrategy.java new file mode 100644 index 000000000..55899b739 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorConnectionStrategy.java @@ -0,0 +1,44 @@ +package com.refinedmods.refinedstorage.common.detector; + +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage.common.support.network.ColoredConnectionStrategy; + +import java.util.function.Supplier; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock.tryExtractDirection; + +class DetectorConnectionStrategy extends ColoredConnectionStrategy { + DetectorConnectionStrategy(final Supplier blockStateProvider, final BlockPos origin) { + super(blockStateProvider, origin); + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + final Direction myDirection = tryExtractDirection(blockStateProvider.get()); + if (myDirection == null) { + return; + } + for (final Direction direction : Direction.values()) { + if (direction == myDirection.getOpposite()) { + continue; + } + sink.tryConnectInSameDimension(origin.relative(direction), direction.getOpposite()); + } + } + + @Override + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + if (!colorsAllowConnecting(connectingState)) { + return false; + } + final Direction myDirection = tryExtractDirection(blockStateProvider.get()); + if (myDirection != null) { + return myDirection != incomingDirection.getOpposite(); + } + return true; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorContainerMenu.java new file mode 100644 index 000000000..6a3c21789 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorContainerMenu.java @@ -0,0 +1,59 @@ +package com.refinedmods.refinedstorage.common.detector; + +import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorMode; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractSingleAmountContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.SingleAmountData; + +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class DetectorContainerMenu extends AbstractSingleAmountContainerMenu { + private static final Component FILTER_HELP = createTranslation("gui", "detector.filter_help"); + + @Nullable + private DetectorBlockEntity detector; + + public DetectorContainerMenu(final int syncId, + final Inventory playerInventory, + final SingleAmountData singleAmountData) { + super(Menus.INSTANCE.getDetector(), syncId, playerInventory, singleAmountData, FILTER_HELP); + registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); + registerProperty(new ClientProperty<>(DetectorPropertyTypes.MODE, DetectorMode.EQUAL)); + } + + DetectorContainerMenu(final int syncId, + final Player player, + final DetectorBlockEntity detector, + final ResourceContainer resourceContainer) { + super(Menus.INSTANCE.getDetector(), syncId, player, resourceContainer, FILTER_HELP, null); + this.detector = detector; + registerProperty(new ServerProperty<>( + PropertyTypes.FUZZY_MODE, + detector::isFuzzyMode, + detector::setFuzzyMode + )); + registerProperty(new ServerProperty<>( + DetectorPropertyTypes.MODE, + detector::getMode, + detector::setMode + )); + } + + @Override + public void changeAmountOnServer(final double newAmount) { + if (detector == null) { + return; + } + detector.setAmount(newAmount); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSettings.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSettings.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSettings.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSettings.java index 6fe841c54..daa225600 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSettings.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSettings.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.detector; +package com.refinedmods.refinedstorage.common.detector; import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorMode; @@ -13,7 +13,6 @@ private DetectorModeSettings() { static DetectorMode getDetectorMode(final int detectorMode) { return switch (detectorMode) { case UNDER -> DetectorMode.UNDER; - case EQUAL -> DetectorMode.EQUAL; case ABOVE -> DetectorMode.ABOVE; default -> DetectorMode.EQUAL; }; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSideButtonWidget.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSideButtonWidget.java index b53e05f63..8e9da9084 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSideButtonWidget.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.detector; +package com.refinedmods.refinedstorage.common.detector; import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class DetectorModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "detector.mode"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorPropertyTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorPropertyTypes.java new file mode 100644 index 000000000..d910786e8 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorPropertyTypes.java @@ -0,0 +1,17 @@ +package com.refinedmods.refinedstorage.common.detector; + +import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorMode; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyType; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +final class DetectorPropertyTypes { + static final PropertyType MODE = new PropertyType<>( + createIdentifier("detector_mode"), + DetectorModeSettings::getDetectorMode, + DetectorModeSettings::getDetectorMode + ); + + private DetectorPropertyTypes() { + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorScreen.java new file mode 100644 index 000000000..33b8c5445 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorScreen.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.common.detector; + +import com.refinedmods.refinedstorage.common.support.amount.AbstractSingleAmountScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; + +public class DetectorScreen extends AbstractSingleAmountScreen { + public DetectorScreen(final DetectorContainerMenu menu, final Inventory playerInventory, final Component text) { + super(menu, playerInventory, text, menu.getAmount(), 0); + } + + @Override + protected void init() { + super.init(); + addSideButton(new FuzzyModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.FUZZY_MODE), + () -> FuzzyModeSideButtonWidget.Type.GENERIC + )); + addSideButton(new DetectorModeSideButtonWidget(getMenu().getProperty(DetectorPropertyTypes.MODE))); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/FuzzyDetectorAmountStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/FuzzyDetectorAmountStrategy.java new file mode 100644 index 000000000..f6745d320 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/FuzzyDetectorAmountStrategy.java @@ -0,0 +1,29 @@ +package com.refinedmods.refinedstorage.common.detector; + +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.impl.node.detector.AbstractDetectorAmountStrategy; +import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorAmountStrategy; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.api.storage.root.FuzzyRootStorage; + +class FuzzyDetectorAmountStrategy extends AbstractDetectorAmountStrategy { + private final DetectorAmountStrategy fallback; + + FuzzyDetectorAmountStrategy(final DetectorAmountStrategy fallback) { + this.fallback = fallback; + } + + @Override + public long getAmount(final Network network, final ResourceKey configuredResource) { + final RootStorage rootStorage = getRootStorage(network); + if (!(rootStorage instanceof FuzzyRootStorage fuzzyRootStorage)) { + return fallback.getAmount(network, configuredResource); + } + return fuzzyRootStorage.getFuzzy(configuredResource) + .stream() + .mapToLong(ResourceAmount::getAmount) + .sum(); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/package-info.java new file mode 100644 index 000000000..f9d33bd9a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.detector; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlock.java new file mode 100644 index 000000000..2358a778a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlock.java @@ -0,0 +1,93 @@ +package com.refinedmods.refinedstorage.common.exporter; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalCableBlock; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.ColorableBlock; +import com.refinedmods.refinedstorage.common.support.DirectionalCableBlockShapes; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.VoxelShape; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ExporterBlock extends AbstractDirectionalCableBlock + implements ColorableBlock, EntityBlock, BlockItemProvider { + private static final Component HELP = createTranslation("item", "exporter.help"); + private static final Map SHAPE_CACHE = new HashMap<>(); + private static final AbstractBlockEntityTicker TICKER = + new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getExporter); + private final DyeColor color; + private final MutableComponent name; + + public ExporterBlock(final DyeColor color, final MutableComponent name) { + super(SHAPE_CACHE); + this.color = color; + this.name = name; + } + + @Override + public DyeColor getColor() { + return color; + } + + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new ExporterBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getExporter(); + } + + @Override + protected VoxelShape getExtensionShape(final Direction direction) { + return switch (direction) { + case NORTH -> DirectionalCableBlockShapes.EXPORTER_NORTH; + case EAST -> DirectionalCableBlockShapes.EXPORTER_EAST; + case SOUTH -> DirectionalCableBlockShapes.EXPORTER_SOUTH; + case WEST -> DirectionalCableBlockShapes.EXPORTER_WEST; + case UP -> DirectionalCableBlockShapes.EXPORTER_UP; + case DOWN -> DirectionalCableBlockShapes.EXPORTER_DOWN; + }; + } + + @Override + public MutableComponent getName() { + return name; + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlockEntity.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlockEntity.java index 9b7a162d3..f4f69e761 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlockEntity.java @@ -1,20 +1,20 @@ -package com.refinedmods.refinedstorage.platform.common.exporter; +package com.refinedmods.refinedstorage.common.exporter; import com.refinedmods.refinedstorage.api.network.impl.node.exporter.CompositeExporterTransferStrategy; import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterNetworkNode; import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy; import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; import java.util.List; import java.util.function.LongSupplier; @@ -50,14 +50,14 @@ public ExporterBlockEntity(final BlockPos pos, final BlockState state) { protected void initialize(final ServerLevel level, final Direction direction) { final ExporterTransferStrategy strategy = createStrategy(level, direction); LOGGER.debug("Initialized exporter at {} with strategy {}", worldPosition, strategy); - mainNode.setTransferStrategy(strategy); + mainNetworkNode.setTransferStrategy(strategy); } private ExporterTransferStrategy createStrategy(final ServerLevel serverLevel, final Direction direction) { final Direction incomingDirection = direction.getOpposite(); final BlockPos sourcePosition = worldPosition.relative(direction); final List factories = - PlatformApi.INSTANCE.getExporterTransferStrategyRegistry().getAll(); + RefinedStorageApi.INSTANCE.getExporterTransferStrategyRegistry().getAll(); final List strategies = factories .stream() .map(factory -> factory.create( @@ -75,7 +75,7 @@ private ExporterTransferStrategy createStrategy(final ServerLevel serverLevel, f @Override protected void setEnergyUsage(final long upgradeEnergyUsage) { final long baseEnergyUsage = Platform.INSTANCE.getConfig().getExporter().getEnergyUsage(); - mainNode.setEnergyUsage(baseEnergyUsage + upgradeEnergyUsage); + mainNetworkNode.setEnergyUsage(baseEnergyUsage + upgradeEnergyUsage); } @Override @@ -91,22 +91,24 @@ public AbstractContainerMenu createMenu(final int syncId, final Inventory invent @Override protected void setTaskExecutor(final TaskExecutor taskExecutor) { - mainNode.setTaskExecutor(taskExecutor); + mainNetworkNode.setTaskExecutor(taskExecutor); } @Override protected void setFilters(final List filters) { - mainNode.setFilters(filters); + mainNetworkNode.setFilters(filters); } @Override - public long overrideAmount(final ResourceKey resource, final long amount, final LongSupplier currentAmount) { + public long overrideAmount(final ResourceKey resource, + final long amount, + final LongSupplier currentAmountSupplier) { if (!upgradeContainer.has(Items.INSTANCE.getRegulatorUpgrade())) { return amount; } return upgradeContainer.getRegulatedAmount(resource) .stream() - .map(desiredAmount -> getAmountStillNeeded(amount, currentAmount.getAsLong(), desiredAmount)) + .map(desiredAmount -> getAmountStillNeeded(amount, currentAmountSupplier.getAsLong(), desiredAmount)) .findFirst() .orElse(amount); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterContainerMenu.java new file mode 100644 index 000000000..ed9714e9d --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterContainerMenu.java @@ -0,0 +1,47 @@ +package com.refinedmods.refinedstorage.common.exporter; + +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractSchedulingContainerMenu; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; + +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ExporterContainerMenu extends AbstractSchedulingContainerMenu { + private static final MutableComponent FILTER_HELP = createTranslation("gui", "exporter.filter_help"); + + public ExporterContainerMenu(final int syncId, + final Inventory playerInventory, + final ResourceContainerData resourceContainerData) { + super( + Menus.INSTANCE.getExporter(), + syncId, + playerInventory.player, + resourceContainerData, + UpgradeDestinations.EXPORTER, + FILTER_HELP + ); + } + + ExporterContainerMenu(final int syncId, + final Player player, + final ExporterBlockEntity exporter, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { + super( + Menus.INSTANCE.getExporter(), + syncId, + player, + resourceContainer, + upgradeContainer, + exporter, + FILTER_HELP + ); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterScreen.java new file mode 100644 index 000000000..e0f7bb5c3 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterScreen.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage.common.exporter; + +import com.refinedmods.refinedstorage.common.support.AbstractFilterScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.widget.SchedulingModeSideButtonWidget; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; + +public class ExporterScreen extends AbstractFilterScreen { + public ExporterScreen(final ExporterContainerMenu menu, final Inventory playerInventory, final Component text) { + super(menu, playerInventory, text); + } + + @Override + protected void init() { + super.init(); + addSideButton(new FuzzyModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.FUZZY_MODE), + () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK + )); + addSideButton(new SchedulingModeSideButtonWidget(getMenu().getProperty(PropertyTypes.SCHEDULING_MODE))); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/FuzzyExporterTransferStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/FuzzyExporterTransferStrategy.java new file mode 100644 index 000000000..0c9d5db4c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/FuzzyExporterTransferStrategy.java @@ -0,0 +1,29 @@ +package com.refinedmods.refinedstorage.common.exporter; + +import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterTransferStrategyImpl; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.InsertableStorage; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.api.storage.root.FuzzyRootStorage; + +import java.util.Collection; +import java.util.stream.Collectors; + +public class FuzzyExporterTransferStrategy extends ExporterTransferStrategyImpl { + public FuzzyExporterTransferStrategy(final InsertableStorage destination, final long transferQuota) { + super(destination, transferQuota); + } + + @Override + protected Collection expand(final ResourceKey resource, final RootStorage rootStorage) { + if (rootStorage instanceof FuzzyRootStorage fuzzyRootStorage) { + return fuzzyRootStorage + .getFuzzy(resource) + .stream() + .map(ResourceAmount::getResource) + .collect(Collectors.toSet()); + } + return super.expand(resource, rootStorage); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/package-info.java new file mode 100644 index 000000000..289f50acd --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.exporter; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridBlock.java new file mode 100644 index 000000000..1d215006b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridBlock.java @@ -0,0 +1,30 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.support.AbstractActiveColoredDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.direction.BiDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; + +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.block.EntityBlock; + +public abstract class AbstractGridBlock & BlockItemProvider, I extends BlockItem> + extends AbstractActiveColoredDirectionalBlock implements EntityBlock { + protected AbstractGridBlock(final MutableComponent name, final DyeColor color) { + super(BlockConstants.PROPERTIES, color, name); + } + + @Override + protected DirectionType getDirectionType() { + return BiDirectionType.INSTANCE; + } + + @Override + public boolean canAlwaysConnect() { + return true; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridBlockEntity.java new file mode 100644 index 000000000..dc07da7c7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridBlockEntity.java @@ -0,0 +1,104 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.impl.node.container.NetworkNodeContainerPriorities; +import com.refinedmods.refinedstorage.api.network.impl.node.grid.GridNetworkNode; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.security.PlatformSecurityNetworkComponent; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.network.ColoredConnectionStrategy; + +import java.util.List; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamEncoder; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +import static java.util.Objects.requireNonNull; + +public abstract class AbstractGridBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity + implements Grid, NetworkNodeExtendedMenuProvider { + protected AbstractGridBlockEntity(final BlockEntityType type, + final BlockPos pos, + final BlockState state, + final long energyUsage) { + super(type, pos, state, new GridNetworkNode(energyUsage)); + } + + @Override + protected InWorldNetworkNodeContainer createMainContainer(final GridNetworkNode networkNode) { + return RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, networkNode) + .priority(NetworkNodeContainerPriorities.GRID) + .connectionStrategy(new ColoredConnectionStrategy(this::getBlockState, getBlockPos())) + .build(); + } + + @Override + public GridData getMenuData() { + return GridData.of(this); + } + + @Override + public StreamEncoder getMenuCodec() { + return GridData.STREAM_CODEC; + } + + @Override + public List getResources(final Class actorType) { + return requireNonNull(mainNetworkNode.getNetwork()) + .getComponent(StorageNetworkComponent.class) + .getResources(actorType); + } + + @Override + public GridOperations createOperations(final ResourceType resourceType, final ServerPlayer player) { + final Network network = requireNonNull(mainNetworkNode.getNetwork()); + final RootStorage rootStorage = network.getComponent(StorageNetworkComponent.class); + final PlatformSecurityNetworkComponent security = network.getComponent(PlatformSecurityNetworkComponent.class); + final GridOperations operations = resourceType.createGridOperations(rootStorage, new PlayerActor(player)); + return new SecuredGridOperations(player, security, operations); + } + + @Override + public boolean isGridActive() { + return mainNetworkNode.isActive(); + } + + @Override + public Storage getItemStorage() { + return requireNonNull(mainNetworkNode.getNetwork()).getComponent(StorageNetworkComponent.class); + } + + @Override + public void addWatcher(final GridWatcher watcher, final Class actorType) { + mainNetworkNode.addWatcher(watcher, actorType); + } + + @Override + public void removeWatcher(final GridWatcher watcher) { + mainNetworkNode.removeWatcher(watcher); + } + + @Override + protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, + final BlockState newBlockState) { + return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridContainerMenu.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridContainerMenu.java index 01493deeb..9ef83b6c6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridContainerMenu.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; @@ -12,28 +12,28 @@ import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.GridResourceAttributeKeys; -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; -import com.refinedmods.refinedstorage.platform.common.Config; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.grid.strategy.ClientGridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.common.grid.strategy.ClientGridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.grid.strategy.ClientGridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.common.grid.view.CompositeGridResourceFactory; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.S2CPackets; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; -import com.refinedmods.refinedstorage.platform.common.support.stretching.ScreenSizeListener; +import com.refinedmods.refinedstorage.common.Config; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.GridResourceAttributeKeys; +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.GridSynchronizer; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.grid.strategy.ClientGridExtractionStrategy; +import com.refinedmods.refinedstorage.common.grid.strategy.ClientGridInsertionStrategy; +import com.refinedmods.refinedstorage.common.grid.strategy.ClientGridScrollingStrategy; +import com.refinedmods.refinedstorage.common.grid.view.CompositeGridResourceFactory; +import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.s2c.S2CPackets; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; +import com.refinedmods.refinedstorage.common.support.stretching.ScreenSizeListener; import com.refinedmods.refinedstorage.query.lexer.LexerTokenMappings; import com.refinedmods.refinedstorage.query.parser.ParserOperatorMappings; @@ -109,7 +109,7 @@ protected AbstractGridContainerMenu( this.view = viewBuilder.build(); this.view.setSortingDirection(Platform.INSTANCE.getConfig().getGrid().getSortingDirection()); this.view.setSortingType(Platform.INSTANCE.getConfig().getGrid().getSortingType()); - this.view.setFilterAndSort(filterStorageChannel()); + this.view.setFilterAndSort(filterResourceType()); this.synchronizer = loadSynchronizer(); this.resourceTypeFilter = loadResourceType(); @@ -137,21 +137,18 @@ protected AbstractGridContainerMenu( initStrategies((ServerPlayer) playerInventory.player); } - private Predicate filterStorageChannel() { - return gridResource -> Platform.INSTANCE - .getConfig() - .getGrid() - .getResourceTypeId() - .flatMap(resourceTypeId -> PlatformApi.INSTANCE + private Predicate filterResourceType() { + return gridResource -> Platform.INSTANCE.getConfig().getGrid().getResourceType().flatMap(resourceTypeId -> + RefinedStorageApi.INSTANCE .getResourceTypeRegistry() .get(resourceTypeId) .map(type -> type.isGridResourceBelonging(gridResource)) - ).orElse(true); + ).orElse(true); } private static GridViewBuilder createViewBuilder() { return new GridViewBuilderImpl( - new CompositeGridResourceFactory(PlatformApi.INSTANCE.getResourceTypeRegistry()), + new CompositeGridResourceFactory(RefinedStorageApi.INSTANCE.getResourceTypeRegistry()), GridSortingTypes.NAME, GridSortingTypes.QUANTITY ); @@ -199,7 +196,7 @@ private void registerViewUpdatingListener(final GridSearchBox theSearchBox) { private boolean onSearchTextChanged(final String text) { try { - view.setFilterAndSort(QUERY_PARSER.parse(text).and(filterStorageChannel())); + view.setFilterAndSort(QUERY_PARSER.parse(text).and(filterResourceType())); return true; } catch (GridQueryParserException e) { view.setFilterAndSort(resource -> false); @@ -272,17 +269,17 @@ public void invalidate() { } private void initStrategies(final ServerPlayer player) { - this.insertionStrategy = PlatformApi.INSTANCE.createGridInsertionStrategy( + this.insertionStrategy = RefinedStorageApi.INSTANCE.createGridInsertionStrategy( this, player, requireNonNull(grid) ); - this.extractionStrategy = PlatformApi.INSTANCE.createGridExtractionStrategy( + this.extractionStrategy = RefinedStorageApi.INSTANCE.createGridExtractionStrategy( this, player, requireNonNull(grid) ); - this.scrollingStrategy = PlatformApi.INSTANCE.createGridScrollingStrategy( + this.scrollingStrategy = RefinedStorageApi.INSTANCE.createGridScrollingStrategy( this, player, requireNonNull(grid) @@ -314,7 +311,7 @@ private GridSynchronizer loadSynchronizer() { .getConfig() .getGrid() .getSynchronizer() - .flatMap(id -> PlatformApi.INSTANCE.getGridSynchronizerRegistry().get(id)) + .flatMap(id -> RefinedStorageApi.INSTANCE.getGridSynchronizerRegistry().get(id)) .orElse(NoopGridSynchronizer.INSTANCE); } @@ -323,8 +320,8 @@ private ResourceType loadResourceType() { return Platform.INSTANCE .getConfig() .getGrid() - .getResourceTypeId() - .flatMap(id -> PlatformApi.INSTANCE.getResourceTypeRegistry().get(id)) + .getResourceType() + .flatMap(id -> RefinedStorageApi.INSTANCE.getResourceTypeRegistry().get(id)) .orElse(null); } @@ -338,7 +335,7 @@ public ResourceType getResourceType() { } public void toggleSynchronizer() { - final PlatformRegistry registry = PlatformApi.INSTANCE.getGridSynchronizerRegistry(); + final PlatformRegistry registry = RefinedStorageApi.INSTANCE.getGridSynchronizerRegistry(); final Config.GridEntry config = Platform.INSTANCE.getConfig().getGrid(); final GridSynchronizer newSynchronizer = registry.nextOrNullIfLast(getSynchronizer()); if (newSynchronizer == null) { @@ -350,7 +347,7 @@ public void toggleSynchronizer() { } public void toggleResourceType() { - final PlatformRegistry registry = PlatformApi.INSTANCE.getResourceTypeRegistry(); + final PlatformRegistry registry = RefinedStorageApi.INSTANCE.getResourceTypeRegistry(); final Config.GridEntry config = Platform.INSTANCE.getConfig().getGrid(); final ResourceType newResourceType = resourceTypeFilter == null ? ResourceTypes.ITEM @@ -358,7 +355,7 @@ public void toggleResourceType() { if (newResourceType == null) { config.clearResourceType(); } else { - registry.getId(newResourceType).ifPresent(config::setResourceTypeId); + registry.getId(newResourceType).ifPresent(config::setResourceType); } this.resourceTypeFilter = newResourceType; this.view.sort(); @@ -404,6 +401,7 @@ public boolean onTransfer(final int slotIndex) { throw new UnsupportedOperationException(); } + @SuppressWarnings("resource") @Override public ItemStack quickMoveStack(final Player playerEntity, final int slotIndex) { if (!playerEntity.level().isClientSide() && grid != null && grid.isGridActive()) { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridSynchronizer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridSynchronizer.java new file mode 100644 index 000000000..21490821d --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridSynchronizer.java @@ -0,0 +1,18 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.common.api.grid.GridSynchronizer; +import com.refinedmods.refinedstorage.common.support.TextureIds; + +import net.minecraft.resources.ResourceLocation; + +public abstract class AbstractGridSynchronizer implements GridSynchronizer { + @Override + public ResourceLocation getTextureIdentifier() { + return TextureIds.ICONS; + } + + @Override + public int getYTexture() { + return 96; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/ClientCraftingGridSource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/ClientCraftingGridSource.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/ClientCraftingGridSource.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/ClientCraftingGridSource.java index c059a4652..7a773bf5d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/ClientCraftingGridSource.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/ClientCraftingGridSource.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlock.java new file mode 100644 index 000000000..bf75a94ae --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlock.java @@ -0,0 +1,61 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class CraftingGridBlock extends AbstractGridBlock + implements BlockItemProvider { + private static final Component HELP = createTranslation("item", "crafting_grid.help"); + private static final AbstractBlockEntityTicker TICKER = new NetworkNodeBlockEntityTicker<>( + BlockEntities.INSTANCE::getCraftingGrid, + ACTIVE + ); + + public CraftingGridBlock(final DyeColor color, final MutableComponent name) { + super(name, color); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getCraftingGrid(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new CraftingGridBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlockEntity.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlockEntity.java index 49e5f2cfe..af272ec47 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlockEntity.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.BlockEntityWithDrops; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.util.ContainerUtil; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.util.ContainerUtil; import java.util.Optional; import javax.annotation.Nullable; @@ -141,24 +141,24 @@ public NonNullList getDrops() { } Optional getNetwork() { - if (!mainNode.isActive()) { + if (!mainNetworkNode.isActive()) { return Optional.empty(); } - return Optional.ofNullable(mainNode.getNetwork()); + return Optional.ofNullable(mainNetworkNode.getNetwork()); } - Optional getStorageChannel() { + Optional getRootStorage() { return getNetwork().map(network -> network.getComponent(StorageNetworkComponent.class)); } ItemStack insert(final ItemStack stack, final Player player) { - return getStorageChannel().map(storageChannel -> doInsert(stack, player, storageChannel)).orElse(stack); + return getRootStorage().map(rootStorage -> doInsert(stack, player, rootStorage)).orElse(stack); } private ItemStack doInsert(final ItemStack stack, final Player player, - final StorageChannel storageChannel) { - final long inserted = storageChannel.insert( + final RootStorage rootStorage) { + final long inserted = rootStorage.insert( ItemResource.ofItemStack(stack), stack.getCount(), Action.EXECUTE, @@ -172,7 +172,7 @@ private ItemStack doInsert(final ItemStack stack, } long extract(final ItemResource resource, final Player player) { - return getStorageChannel().map(storageChannel -> storageChannel.extract( + return getRootStorage().map(rootStorage -> rootStorage.extract( resource, 1, Action.EXECUTE, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java index cc6e73b46..fd072e186 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import com.refinedmods.refinedstorage.api.grid.view.GridResource; import com.refinedmods.refinedstorage.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.grid.view.ItemGridResource; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.grid.view.ItemGridResource; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.ArrayList; import java.util.HashSet; @@ -23,6 +23,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; +import org.apiguardian.api.API; public class CraftingGridContainerMenu extends AbstractGridContainerMenu { private static final int Y_OFFSET_BETWEEN_PLAYER_INVENTORY_AND_FIRST_CRAFTING_MATRIX_SLOT = 69; @@ -78,9 +79,12 @@ public boolean canTakeItemForPickAll(final ItemStack stack, final Slot slot) { } @Override + @SuppressWarnings("resource") public ItemStack quickMoveStack(final Player actor, final int slotIndex) { final Slot slot = getSlot(slotIndex); - if (!actor.level().isClientSide() && slot instanceof CraftingGridResultSlot resultSlot) { + if (!actor.level().isClientSide() + && slot instanceof CraftingGridResultSlot resultSlot + && resultSlot.hasItem()) { final ItemStack craftedStack = resultSlot.onQuickCraft(actor); source.acceptQuickCraft(actor, craftedStack); return ItemStack.EMPTY; @@ -117,6 +121,7 @@ public void clear(final boolean toPlayerInventory) { source.clearMatrix(player, toPlayerInventory); } + @API(status = API.Status.INTERNAL) public ResourceList getAvailableListForRecipeTransfer() { final ResourceList available = getView().copyBackingList(); addContainerToList(source.getCraftingMatrix(), available); @@ -142,7 +147,8 @@ public void filterBasedOnCraftingMatrixItems() { final Set craftingMatrixItems = getCraftingMatrixItems(); filterBeforeFilteringBasedOnCraftingMatrixItems = getView().setFilterAndSort( gridResource -> gridResource instanceof ItemGridResource itemGridResource - && craftingMatrixItems.contains(itemGridResource.getResource()) + && itemGridResource.getUnderlyingResource() != null + && craftingMatrixItems.contains((ItemResource) itemGridResource.getUnderlyingResource()) ); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridMatrixCloseBehavior.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridMatrixCloseBehavior.java new file mode 100644 index 000000000..8650b7836 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridMatrixCloseBehavior.java @@ -0,0 +1,7 @@ +package com.refinedmods.refinedstorage.common.grid; + +public enum CraftingGridMatrixCloseBehavior { + NONE, + CLEAR_TO_NETWORK, + CLEAR_TO_INVENTORY +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridRefillContext.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridRefillContext.java new file mode 100644 index 000000000..8ba2f0738 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridRefillContext.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import net.minecraft.world.entity.player.Player; + +interface CraftingGridRefillContext extends AutoCloseable { + boolean extract(ItemResource resource, Player player); + + @Override + void close(); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridRefillContextImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridRefillContextImpl.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridRefillContextImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridRefillContextImpl.java index aa8461f6c..62ef95490 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridRefillContextImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridRefillContextImpl.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import net.minecraft.world.entity.player.Player; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridResultSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridResultSlot.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridResultSlot.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridResultSlot.java index db7c3bb30..4887311c1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridResultSlot.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridResultSlot.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.List; @@ -24,9 +24,6 @@ class CraftingGridResultSlot extends ResultSlot { } public ItemStack onQuickCraft(final Player player) { - if (!hasItem() || player.level().isClientSide()) { - return ItemStack.EMPTY; - } final ItemStack singleResultStack = getItem().copy(); final int maxCrafted = singleResultStack.getMaxStackSize(); int crafted = 0; @@ -40,6 +37,7 @@ public ItemStack onQuickCraft(final Player player) { } @Override + @SuppressWarnings("resource") public void onTake(final Player player, final ItemStack stack) { if (player.level().isClientSide()) { return; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridSource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridSource.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridSource.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridSource.java index dba56eda7..9ed0828fe 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridSource.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridSource.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridSourceImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridSourceImpl.java similarity index 97% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridSourceImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridSourceImpl.java index 29cc2c3db..97632e507 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridSourceImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridSourceImpl.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.list.ResourceList; import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.Comparator; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingMatrix.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingMatrix.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingMatrix.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingMatrix.java index 5ef6b3344..805e53372 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingMatrix.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingMatrix.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingMatrixContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingMatrixContainerMenu.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingMatrixContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingMatrixContainerMenu.java index b8ffb621a..288b9c3e8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingMatrixContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingMatrixContainerMenu.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlock.java new file mode 100644 index 000000000..38b96b665 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlock.java @@ -0,0 +1,61 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class GridBlock extends AbstractGridBlock + implements BlockItemProvider { + private static final Component HELP = createTranslation("item", "grid.help"); + private static final AbstractBlockEntityTicker TICKER = new NetworkNodeBlockEntityTicker<>( + BlockEntities.INSTANCE::getGrid, + ACTIVE + ); + + public GridBlock(final DyeColor color, final MutableComponent name) { + super(name, color); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getGrid(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new GridBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlockEntity.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlockEntity.java index 567277aa9..da2f4aed1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlockEntity.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridContainerMenu.java new file mode 100644 index 000000000..59bff838a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridContainerMenu.java @@ -0,0 +1,27 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; + +import net.minecraft.world.entity.player.Inventory; + +public class GridContainerMenu extends AbstractGridContainerMenu { + public GridContainerMenu(final int syncId, final Inventory playerInventory, final GridData gridData) { + super(Menus.INSTANCE.getGrid(), syncId, playerInventory, gridData); + onScreenReady(0); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + } + + GridContainerMenu(final int syncId, final Inventory playerInventory, final GridBlockEntity grid) { + super(Menus.INSTANCE.getGrid(), syncId, playerInventory, grid); + onScreenReady(0); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + grid::getRedstoneMode, + grid::setRedstoneMode + )); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridData.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridData.java index 1c1489b2d..a5b8b63aa 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridData.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.common.storage.StorageCodecs; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.storage.StorageCodecs; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridSearchBox.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridSearchBox.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridSearchBox.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridSearchBox.java index 8f7f7360c..be4620b64 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridSearchBox.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridSearchBox.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import java.util.function.Consumer; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridSortingTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridSortingTypes.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridSortingTypes.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridSortingTypes.java index fa7201503..9d38f3f33 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridSortingTypes.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridSortingTypes.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import com.refinedmods.refinedstorage.api.grid.view.GridResource; import com.refinedmods.refinedstorage.api.grid.view.GridSortingType; import com.refinedmods.refinedstorage.api.grid.view.GridView; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage.platform.api.grid.view.PlatformGridResource; +import com.refinedmods.refinedstorage.common.api.grid.view.PlatformGridResource; import java.util.Comparator; import java.util.function.Function; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/NoopGridSynchronizer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/NoopGridSynchronizer.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/NoopGridSynchronizer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/NoopGridSynchronizer.java index 6dcd2f096..92accb73c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/NoopGridSynchronizer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/NoopGridSynchronizer.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import javax.annotation.Nullable; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class NoopGridSynchronizer extends AbstractGridSynchronizer { public static final NoopGridSynchronizer INSTANCE = new NoopGridSynchronizer(); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/PortableGridData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/PortableGridData.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/PortableGridData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/PortableGridData.java index c64433452..614b20daa 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/PortableGridData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/PortableGridData.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/SecuredGridOperations.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/SecuredGridOperations.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/SecuredGridOperations.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/SecuredGridOperations.java index 9f89b1324..918741538 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/SecuredGridOperations.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/SecuredGridOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; @@ -6,14 +6,14 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.security.PlatformSecurityNetworkComponent; -import com.refinedmods.refinedstorage.platform.common.security.BuiltinPermission; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.security.PlatformSecurityNetworkComponent; +import com.refinedmods.refinedstorage.common.security.BuiltinPermission; import net.minecraft.network.chat.MutableComponent; import net.minecraft.server.level.ServerPlayer; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class SecuredGridOperations implements GridOperations { private static final MutableComponent CANNOT_EXTRACT_MESSAGE = createTranslation("misc", "no_permission.extract"); @@ -36,7 +36,7 @@ public boolean extract(final ResourceKey resource, final GridExtractMode extractMode, final InsertableStorage destination) { if (!securityNetworkComponent.isAllowed(BuiltinPermission.EXTRACT, player)) { - PlatformApi.INSTANCE.sendNoPermissionMessage(player, CANNOT_EXTRACT_MESSAGE); + RefinedStorageApi.INSTANCE.sendNoPermissionMessage(player, CANNOT_EXTRACT_MESSAGE); return false; } return delegate.extract(resource, extractMode, destination); @@ -46,7 +46,7 @@ public boolean extract(final ResourceKey resource, public boolean insert(final ResourceKey resource, final GridInsertMode insertMode, final ExtractableStorage source) { if (!securityNetworkComponent.isAllowed(BuiltinPermission.INSERT, player)) { - PlatformApi.INSTANCE.sendNoPermissionMessage(player, CANNOT_INSERT_MESSAGE); + RefinedStorageApi.INSTANCE.sendNoPermissionMessage(player, CANNOT_INSERT_MESSAGE); return false; } return delegate.insert(resource, insertMode, source); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/SnapshotCraftingGridRefillContext.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/SnapshotCraftingGridRefillContext.java new file mode 100644 index 000000000..833bfa89c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/SnapshotCraftingGridRefillContext.java @@ -0,0 +1,76 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.resource.list.ResourceList; +import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; + +class SnapshotCraftingGridRefillContext implements CraftingGridRefillContext { + private final PlayerActor playerActor; + private final CraftingGridBlockEntity blockEntity; + private final ResourceList available = new ResourceListImpl(); + private final ResourceList used = new ResourceListImpl(); + + SnapshotCraftingGridRefillContext( + final Player player, + final CraftingGridBlockEntity blockEntity, + final CraftingMatrix craftingMatrix + ) { + this.playerActor = new PlayerActor(player); + this.blockEntity = blockEntity; + addAvailableItems(craftingMatrix); + } + + private void addAvailableItems(final CraftingMatrix craftingMatrix) { + blockEntity.getRootStorage().ifPresent(rootStorage -> { + for (int i = 0; i < craftingMatrix.getContainerSize(); ++i) { + addAvailableItem(craftingMatrix, rootStorage, i); + } + }); + } + + private void addAvailableItem(final CraftingMatrix craftingMatrix, + final RootStorage rootStorage, + final int craftingMatrixSlotIndex) { + final ItemStack craftingMatrixStack = craftingMatrix.getItem(craftingMatrixSlotIndex); + if (craftingMatrixStack.isEmpty()) { + return; + } + addAvailableItem(rootStorage, craftingMatrixStack); + } + + private void addAvailableItem(final RootStorage rootStorage, + final ItemStack craftingMatrixStack) { + final ItemResource craftingMatrixResource = ItemResource.ofItemStack(craftingMatrixStack); + // a single resource can occur multiple times in a recipe, only add it once + if (available.get(craftingMatrixResource).isEmpty()) { + rootStorage.get(craftingMatrixResource).ifPresent(available::add); + } + } + + @Override + public boolean extract(final ItemResource resource, final Player player) { + return blockEntity.getNetwork().map(network -> { + final boolean isAvailable = available.get(resource).isPresent(); + if (isAvailable) { + available.remove(resource, 1); + used.add(resource, 1); + } + return isAvailable; + }).orElse(false); + } + + @Override + public void close() { + blockEntity.getRootStorage().ifPresent(this::extractUsedItems); + } + + private void extractUsedItems(final RootStorage rootStorage) { + used.getAll().forEach(u -> rootStorage.extract(u.getResource(), u.getAmount(), Action.EXECUTE, playerActor)); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGrid.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGrid.java new file mode 100644 index 000000000..c7041aa98 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGrid.java @@ -0,0 +1,96 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.api.grid.operations.NoopGridOperations; +import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher; +import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManager; +import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManagerImpl; +import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.NoopStorage; +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.security.PlatformSecurityNetworkComponent; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemContext; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; + +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +import net.minecraft.server.level.ServerPlayer; + +class WirelessGrid implements Grid { + private final NetworkItemContext context; + private final GridWatcherManager watchers = new GridWatcherManagerImpl(); + + WirelessGrid(final NetworkItemContext context) { + this.context = context; + } + + private Optional getStorage() { + return context.resolveNetwork().map(network -> network.getComponent(StorageNetworkComponent.class)); + } + + private Optional getSecurity() { + return context.resolveNetwork().map(network -> network.getComponent(PlatformSecurityNetworkComponent.class)); + } + + @Override + public void addWatcher(final GridWatcher watcher, final Class actorType) { + context.drainEnergy(Platform.INSTANCE.getConfig().getWirelessGrid().getOpenEnergyUsage()); + context.resolveNetwork().ifPresent(network -> watchers.addWatcher( + watcher, + actorType, + network.getComponent(StorageNetworkComponent.class) + )); + } + + @Override + public void removeWatcher(final GridWatcher watcher) { + context.resolveNetwork().ifPresent(network -> watchers.removeWatcher( + watcher, + network.getComponent(StorageNetworkComponent.class) + )); + } + + @Override + public Storage getItemStorage() { + return getStorage().map(Storage.class::cast).orElseGet(NoopStorage::new); + } + + @Override + public boolean isGridActive() { + final boolean networkActive = context.resolveNetwork().map( + network -> network.getComponent(EnergyNetworkComponent.class).getStored() > 0 + ).orElse(false); + return networkActive && context.isActive(); + } + + @Override + public List getResources(final Class actorType) { + return getStorage().map(storage -> storage.getResources(actorType)).orElse(Collections.emptyList()); + } + + @Override + public GridOperations createOperations(final ResourceType resourceType, final ServerPlayer player) { + return getStorage() + .flatMap(rootStorage -> + getSecurity().map(security -> createGridOperations(resourceType, player, rootStorage, security))) + .map(gridOperations -> (GridOperations) new WirelessGridOperations(gridOperations, context, watchers)) + .orElseGet(NoopGridOperations::new); + } + + private GridOperations createGridOperations(final ResourceType resourceType, + final ServerPlayer player, + final StorageNetworkComponent rootStorage, + final PlatformSecurityNetworkComponent securityNetworkComponent) { + final PlayerActor playerActor = new PlayerActor(player); + final GridOperations operations = resourceType.createGridOperations(rootStorage, playerActor); + return new SecuredGridOperations(player, securityNetworkComponent, operations); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridContainerMenu.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridContainerMenu.java index a7a75ef40..b49be1e0d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridContainerMenu.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.Menus; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.Menus; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridData.java new file mode 100644 index 000000000..c54c5caac --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridData.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; + +public record WirelessGridData(GridData gridData, SlotReference slotReference) { + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + GridData.STREAM_CODEC, WirelessGridData::gridData, + SlotReferenceFactory.STREAM_CODEC, WirelessGridData::slotReference, + WirelessGridData::new + ); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridExtendedMenuProvider.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridExtendedMenuProvider.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridExtendedMenuProvider.java index e8881f5a0..f66f2720c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridExtendedMenuProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridExtendedMenuProvider.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.containermenu.ExtendedMenuProvider; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridItem.java new file mode 100644 index 000000000..16f203208 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridItem.java @@ -0,0 +1,49 @@ +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyStorageImpl; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.security.SecurityHelper; +import com.refinedmods.refinedstorage.common.api.support.energy.AbstractNetworkEnergyItem; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemContext; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.security.BuiltinPermission; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; + +public class WirelessGridItem extends AbstractNetworkEnergyItem { + public WirelessGridItem() { + super( + new Item.Properties().stacksTo(1), + RefinedStorageApi.INSTANCE.getEnergyItemHelper(), + RefinedStorageApi.INSTANCE.getNetworkItemHelper() + ); + } + + public EnergyStorage createEnergyStorage(final ItemStack stack) { + final EnergyStorage energyStorage = new EnergyStorageImpl( + Platform.INSTANCE.getConfig().getWirelessGrid().getEnergyCapacity() + ); + return RefinedStorageApi.INSTANCE.asItemEnergyStorage(energyStorage, stack); + } + + @Override + protected void use(final ServerPlayer player, + final SlotReference slotReference, + final NetworkItemContext context) { + final boolean isAllowed = context.resolveNetwork() + .map(network -> SecurityHelper.isAllowed(player, BuiltinPermission.OPEN, network)) + .orElse(true); // if the network can't be resolved that will be apparent later in the UI. + if (!isAllowed) { + RefinedStorageApi.INSTANCE.sendNoPermissionToOpenMessage(player, ContentNames.WIRELESS_GRID); + return; + } + final Grid grid = new WirelessGrid(context); + Platform.INSTANCE.getMenuOpener().openMenu(player, new WirelessGridExtendedMenuProvider(grid, slotReference)); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridOperations.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridOperations.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridOperations.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridOperations.java index 4e7c4f533..4d00b84c3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridOperations.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; @@ -7,19 +7,19 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage.platform.common.Platform; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemContext; class WirelessGridOperations implements GridOperations { private final GridOperations delegate; - private final NetworkBoundItemSession session; + private final NetworkItemContext context; private final GridWatcherManager watchers; WirelessGridOperations(final GridOperations delegate, - final NetworkBoundItemSession session, + final NetworkItemContext context, final GridWatcherManager watchers) { this.delegate = delegate; - this.session = session; + this.context = context; this.watchers = watchers; } @@ -46,9 +46,9 @@ public boolean insert(final ResourceKey resource, } private void drain(final long amount) { - final boolean wasActive = session.isActive(); - session.drainEnergy(amount); - final boolean isActive = session.isActive(); + final boolean wasActive = context.isActive(); + context.drainEnergy(amount); + final boolean isActive = context.isActive(); if (wasActive != isActive) { watchers.activeChanged(isActive); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/package-info.java new file mode 100644 index 000000000..69ec81607 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.grid; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AbstractGridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AbstractGridScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java index ccecea0d8..165eda4b4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AbstractGridScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java @@ -1,25 +1,24 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; +package com.refinedmods.refinedstorage.common.grid.screen; import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage.api.grid.view.GridResource; import com.refinedmods.refinedstorage.api.grid.view.GridView; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.view.PlatformGridResource; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.NoopGridSynchronizer; -import com.refinedmods.refinedstorage.platform.common.grid.view.ItemGridResource; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.DisabledSlot; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.stretching.AbstractStretchingScreen; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.SmallTextClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.widget.History; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.view.PlatformGridResource; +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.NoopGridSynchronizer; +import com.refinedmods.refinedstorage.common.grid.view.ItemGridResource; +import com.refinedmods.refinedstorage.common.support.containermenu.DisabledSlot; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.stretching.AbstractStretchingScreen; +import com.refinedmods.refinedstorage.common.support.tooltip.SmallTextClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.widget.History; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; import com.refinedmods.refinedstorage.query.lexer.SyntaxHighlighter; import com.refinedmods.refinedstorage.query.lexer.SyntaxHighlighterColors; @@ -29,6 +28,8 @@ import net.minecraft.ChatFormatting; import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; import net.minecraft.client.renderer.RenderType; import net.minecraft.network.chat.Component; @@ -36,10 +37,11 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; +import org.apiguardian.api.API; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; import static java.util.Objects.requireNonNullElse; public abstract class AbstractGridScreen extends AbstractStretchingScreen { @@ -97,7 +99,7 @@ protected void init(final int rows) { addSideButton(new AutoSelectedSideButtonWidget(getMenu())); addSideButton(new ResourceTypeSideButtonWidget(getMenu())); - final boolean onlyHasNoopSynchronizer = PlatformApi.INSTANCE.getGridSynchronizerRegistry() + final boolean onlyHasNoopSynchronizer = RefinedStorageApi.INSTANCE.getGridSynchronizerRegistry() .getAll() .stream() .allMatch(synchronizer -> synchronizer == NoopGridSynchronizer.INSTANCE); @@ -231,7 +233,7 @@ private void renderSlot(final GuiGraphics graphics, renderResourceWithAmount(graphics, slotX, slotY, resource); } if (inBounds && isOverStorageArea(mouseX, mouseY)) { - renderSlotHighlight(graphics, slotX, slotY, 0); + AbstractContainerScreen.renderSlotHighlight(graphics, slotX, slotY, 0); if (resource != null) { currentGridSlotIndex = idx; } @@ -288,7 +290,7 @@ private void renderOverStorageAreaTooltip(final GuiGraphics graphics, final int if (carried.isEmpty()) { return; } - final List hints = PlatformApi.INSTANCE.getGridInsertionHints().getHints(carried); + final List hints = RefinedStorageApi.INSTANCE.getGridInsertionHints().getHints(carried); Platform.INSTANCE.renderTooltip(graphics, hints, x, y); } @@ -354,6 +356,7 @@ private boolean isModifiedJustNow(final LastModified lastModified) { && lastModified.amount() <= MODIFIED_JUST_NOW_MAX_SECONDS; } + @API(status = API.Status.INTERNAL) @Nullable public PlatformGridResource getCurrentGridResource() { if (currentGridSlotIndex < 0) { @@ -366,12 +369,6 @@ public PlatformGridResource getCurrentGridResource() { return (PlatformGridResource) viewList.get(currentGridSlotIndex); } - @Nullable - public PlatformResourceKey getCurrentResource() { - final PlatformGridResource resource = getCurrentGridResource(); - return resource != null ? resource.getUnderlyingResource() : null; - } - @Override public void render(final GuiGraphics graphics, final int mouseX, final int mouseY, final float partialTicks) { super.render(graphics, mouseX, mouseY, partialTicks); @@ -423,7 +420,7 @@ private static GridExtractMode getExtractMode(final int clickedButton) { } private static boolean shouldExtractToCursor() { - return !hasShiftDown(); + return !Screen.hasShiftDown(); } @Override @@ -467,7 +464,7 @@ private void mouseScrolledInGrid(final boolean up, final PlatformGridResource re @Nullable private static GridScrollMode getScrollModeWhenScrollingOnInventoryArea(final boolean up) { - if (hasShiftDown()) { + if (Screen.hasShiftDown()) { return up ? GridScrollMode.INVENTORY_TO_GRID : GridScrollMode.GRID_TO_INVENTORY; } return null; @@ -475,8 +472,8 @@ private static GridScrollMode getScrollModeWhenScrollingOnInventoryArea(final bo @Nullable private static GridScrollMode getScrollModeWhenScrollingOnGridArea(final boolean up) { - final boolean shift = hasShiftDown(); - final boolean ctrl = hasControlDown(); + final boolean shift = Screen.hasShiftDown(); + final boolean ctrl = Screen.hasControlDown(); if (shift && ctrl) { return null; } @@ -509,9 +506,9 @@ public boolean charTyped(final char unknown1, final int unknown2) { @Override public boolean keyPressed(final int key, final int scanCode, final int modifiers) { - // First do the prevent sorting. + // First check if we have to prevent sorting. // Order matters. In auto-selected mode, the search field will swallow the SHIFT key. - if (hasShiftDown() && Platform.INSTANCE.getConfig().getGrid().isPreventSortingWhileShiftIsDown()) { + if (Screen.hasShiftDown() && Platform.INSTANCE.getConfig().getGrid().isPreventSortingWhileShiftIsDown()) { getMenu().getView().setPreventSorting(true); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AutoSelectedSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AutoSelectedSideButtonWidget.java new file mode 100644 index 000000000..754bb73e2 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AutoSelectedSideButtonWidget.java @@ -0,0 +1,52 @@ +package com.refinedmods.refinedstorage.common.grid.screen; + +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; + +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.NO; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.YES; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class AutoSelectedSideButtonWidget extends AbstractSideButtonWidget { + private static final MutableComponent TITLE = createTranslation("gui", "grid.auto_selected"); + private static final Component HELP = createTranslation("gui", "grid.auto_selected.help"); + + private final AbstractGridContainerMenu menu; + + AutoSelectedSideButtonWidget(final AbstractGridContainerMenu menu) { + super(createPressAction(menu)); + this.menu = menu; + } + + private static OnPress createPressAction(final AbstractGridContainerMenu menu) { + return btn -> menu.setAutoSelected(!menu.isAutoSelected()); + } + + @Override + protected int getXTexture() { + return menu.isAutoSelected() ? 16 : 0; + } + + @Override + protected int getYTexture() { + return 96; + } + + @Override + protected MutableComponent getTitle() { + return TITLE; + } + + @Override + protected MutableComponent getSubText() { + return menu.isAutoSelected() ? YES : NO; + } + + @Override + protected Component getHelpText() { + return HELP; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/CraftingGridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/CraftingGridScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java index 6e0a34a76..fdfb4a045 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/CraftingGridScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; +package com.refinedmods.refinedstorage.common.grid.screen; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.KeyMappings; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridMatrixCloseBehavior; -import com.refinedmods.refinedstorage.platform.common.support.widget.HoveredImageButton; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.content.KeyMappings; +import com.refinedmods.refinedstorage.common.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.CraftingGridMatrixCloseBehavior; +import com.refinedmods.refinedstorage.common.support.widget.HoveredImageButton; import javax.annotation.Nullable; @@ -21,8 +21,8 @@ import net.minecraft.world.inventory.ResultContainer; import net.minecraft.world.inventory.Slot; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class CraftingGridScreen extends AbstractGridScreen { private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/crafting_grid.png"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/GridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/GridScreen.java new file mode 100644 index 000000000..58cb19f21 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/GridScreen.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage.common.grid.screen; + +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; + +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public class GridScreen extends AbstractGridScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/grid.png"); + + public GridScreen(final T menu, final Inventory inventory, final Component title) { + super(menu, inventory, title, 99); + this.inventoryLabelY = 75; + this.imageWidth = 193; + this.imageHeight = 176; + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/GridSearchBoxWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/GridSearchBoxWidget.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/GridSearchBoxWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/GridSearchBoxWidget.java index 996556dad..94f5ac1ac 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/GridSearchBoxWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/GridSearchBoxWidget.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; +package com.refinedmods.refinedstorage.common.grid.screen; -import com.refinedmods.refinedstorage.platform.common.grid.GridSearchBox; -import com.refinedmods.refinedstorage.platform.common.support.widget.History; -import com.refinedmods.refinedstorage.platform.common.support.widget.SearchFieldWidget; +import com.refinedmods.refinedstorage.common.grid.GridSearchBox; +import com.refinedmods.refinedstorage.common.support.widget.History; +import com.refinedmods.refinedstorage.common.support.widget.SearchFieldWidget; import com.refinedmods.refinedstorage.query.lexer.Lexer; import com.refinedmods.refinedstorage.query.lexer.LexerException; import com.refinedmods.refinedstorage.query.lexer.LexerTokenMappings; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/LastModified.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/LastModified.java similarity index 94% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/LastModified.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/LastModified.java index f6a27b200..f37d920b9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/LastModified.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/LastModified.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; +package com.refinedmods.refinedstorage.common.grid.screen; record LastModified(Type type, long amount) { private static final long SECOND = 1000; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/ResourceTypeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/ResourceTypeSideButtonWidget.java similarity index 80% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/ResourceTypeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/ResourceTypeSideButtonWidget.java index 7075678c0..bb6295282 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/ResourceTypeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/ResourceTypeSideButtonWidget.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; +package com.refinedmods.refinedstorage.common.grid.screen; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.TextureIds; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class ResourceTypeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.resource_type"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/SortingDirectionSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingDirectionSideButtonWidget.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/SortingDirectionSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingDirectionSideButtonWidget.java index 1bdbec690..d51967514 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/SortingDirectionSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingDirectionSideButtonWidget.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; +package com.refinedmods.refinedstorage.common.grid.screen; import com.refinedmods.refinedstorage.api.grid.view.GridSortingDirection; -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class SortingDirectionSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.sorting.direction"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/SortingTypeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingTypeSideButtonWidget.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/SortingTypeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingTypeSideButtonWidget.java index dd8401fea..b3bfe2f28 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/SortingTypeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingTypeSideButtonWidget.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; +package com.refinedmods.refinedstorage.common.grid.screen; -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.GridSortingTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.GridSortingTypes; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class SortingTypeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.sorting.type"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/SynchronizationSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SynchronizationSideButtonWidget.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/SynchronizationSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SynchronizationSideButtonWidget.java index 22e750947..e1a1b2522 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/SynchronizationSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SynchronizationSideButtonWidget.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; +package com.refinedmods.refinedstorage.common.grid.screen; -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class SynchronizationSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.synchronizer"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/FluidGridInsertionHint.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/FluidGridInsertionHint.java new file mode 100644 index 000000000..8eaa8d5de --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/FluidGridInsertionHint.java @@ -0,0 +1,30 @@ +package com.refinedmods.refinedstorage.common.grid.screen.hint; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHint; +import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage.common.support.tooltip.MouseClientTooltipComponent; + +import java.util.Optional; + +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.world.item.ItemStack; + +public class FluidGridInsertionHint implements GridInsertionHint { + @Override + public Optional getHint(final ItemStack carried) { + return Platform.INSTANCE.drainContainer(carried).map(this::createComponent); + } + + private ClientTooltipComponent createComponent(final FluidOperationResult result) { + return MouseClientTooltipComponent.fluid( + MouseClientTooltipComponent.Type.RIGHT, + (FluidResource) result.fluid(), + result.amount() == Platform.INSTANCE.getBucketAmount() + ? null + : FluidResourceRendering.format(result.amount()) + ); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/GridInsertionHintsImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/GridInsertionHintsImpl.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/GridInsertionHintsImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/GridInsertionHintsImpl.java index 6f40c722b..f6be9f8a7 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/GridInsertionHintsImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/GridInsertionHintsImpl.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen.hint; +package com.refinedmods.refinedstorage.common.grid.screen.hint; -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHints; +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHint; +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHints; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/ItemGridInsertionHint.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/ItemGridInsertionHint.java new file mode 100644 index 000000000..819e6f36a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/ItemGridInsertionHint.java @@ -0,0 +1,21 @@ +package com.refinedmods.refinedstorage.common.grid.screen.hint; + +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHint; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.support.tooltip.MouseClientTooltipComponent; + +import java.util.Optional; + +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.world.item.ItemStack; + +public class ItemGridInsertionHint implements GridInsertionHint { + @Override + public Optional getHint(final ItemStack carried) { + return Optional.of(MouseClientTooltipComponent.item( + MouseClientTooltipComponent.Type.LEFT, + carried, + carried.getCount() == 1 ? null : AmountFormatting.format(carried.getCount()) + )); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/SingleItemGridInsertionHint.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/SingleItemGridInsertionHint.java new file mode 100644 index 000000000..afcf475b0 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/SingleItemGridInsertionHint.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage.common.grid.screen.hint; + +import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHint; +import com.refinedmods.refinedstorage.common.support.tooltip.MouseClientTooltipComponent; + +import java.util.Optional; + +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.world.item.ItemStack; + +public class SingleItemGridInsertionHint implements GridInsertionHint { + @Override + public Optional getHint(final ItemStack carried) { + return Optional.of(MouseClientTooltipComponent.item( + MouseClientTooltipComponent.Type.RIGHT, + carried, + null + )); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/package-info.java new file mode 100644 index 000000000..c8ec48ffa --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.grid.screen.hint; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/package-info.java new file mode 100644 index 000000000..533df2801 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.grid.screen; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/ClientGridExtractionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/ClientGridExtractionStrategy.java new file mode 100644 index 000000000..40f25bc86 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/ClientGridExtractionStrategy.java @@ -0,0 +1,16 @@ +package com.refinedmods.refinedstorage.common.grid.strategy; + +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; + +public class ClientGridExtractionStrategy implements GridExtractionStrategy { + @Override + public boolean onExtract(final PlatformResourceKey resource, + final GridExtractMode extractMode, + final boolean cursor) { + C2SPackets.sendGridExtract(resource, extractMode, cursor); + return true; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/ClientGridInsertionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/ClientGridInsertionStrategy.java new file mode 100644 index 000000000..8a46b53ec --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/ClientGridInsertionStrategy.java @@ -0,0 +1,18 @@ +package com.refinedmods.refinedstorage.common.grid.strategy; + +import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; + +public class ClientGridInsertionStrategy implements GridInsertionStrategy { + @Override + public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { + C2SPackets.sendGridInsert(insertMode, tryAlternatives); + return true; + } + + @Override + public boolean onTransfer(final int slotIndex) { + throw new UnsupportedOperationException(); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/ClientGridScrollingStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/ClientGridScrollingStrategy.java new file mode 100644 index 000000000..fb2d403c1 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/ClientGridScrollingStrategy.java @@ -0,0 +1,14 @@ +package com.refinedmods.refinedstorage.common.grid.strategy; + +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; + +public class ClientGridScrollingStrategy implements GridScrollingStrategy { + @Override + public boolean onScroll(final PlatformResourceKey resource, final GridScrollMode scrollMode, final int slotIndex) { + C2SPackets.sendGridScroll(resource, scrollMode, slotIndex); + return true; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/CompositeGridExtractionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/CompositeGridExtractionStrategy.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/CompositeGridExtractionStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/CompositeGridExtractionStrategy.java index 7c037c2ed..03e89b227 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/CompositeGridExtractionStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/CompositeGridExtractionStrategy.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.grid.strategy; +package com.refinedmods.refinedstorage.common.grid.strategy; import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; import java.util.Collections; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/CompositeGridInsertionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/CompositeGridInsertionStrategy.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/CompositeGridInsertionStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/CompositeGridInsertionStrategy.java index 3054f689d..4761fdcc5 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/CompositeGridInsertionStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/CompositeGridInsertionStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.grid.strategy; +package com.refinedmods.refinedstorage.common.grid.strategy; import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; import java.util.Collections; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/CompositeGridScrollingStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/CompositeGridScrollingStrategy.java new file mode 100644 index 000000000..e9ab9410a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/CompositeGridScrollingStrategy.java @@ -0,0 +1,26 @@ +package com.refinedmods.refinedstorage.common.grid.strategy; + +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; + +import java.util.Collections; +import java.util.List; + +public class CompositeGridScrollingStrategy implements GridScrollingStrategy { + private final List strategies; + + public CompositeGridScrollingStrategy(final List strategies) { + this.strategies = Collections.unmodifiableList(strategies); + } + + @Override + public boolean onScroll(final PlatformResourceKey resource, final GridScrollMode scrollMode, final int slotIndex) { + for (final GridScrollingStrategy strategy : strategies) { + if (strategy.onScroll(resource, scrollMode, slotIndex)) { + return true; + } + } + return false; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/package-info.java new file mode 100644 index 000000000..284474eca --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/strategy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/AbstractFluidGridResourceFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/AbstractFluidGridResourceFactory.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/AbstractFluidGridResourceFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/AbstractFluidGridResourceFactory.java index d19faef65..76083fcfe 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/AbstractFluidGridResourceFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/AbstractFluidGridResourceFactory.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.grid.view; +package com.refinedmods.refinedstorage.common.grid.view; import com.refinedmods.refinedstorage.api.grid.view.GridResource; import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.Optional; import java.util.Set; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/AbstractItemGridResourceFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/AbstractItemGridResourceFactory.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/AbstractItemGridResourceFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/AbstractItemGridResourceFactory.java index 70b1347a8..ad6b897bd 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/AbstractItemGridResourceFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/AbstractItemGridResourceFactory.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.grid.view; +package com.refinedmods.refinedstorage.common.grid.view; import com.refinedmods.refinedstorage.api.grid.view.GridResource; import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.Optional; import java.util.Set; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/CompositeGridResourceFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/CompositeGridResourceFactory.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/CompositeGridResourceFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/CompositeGridResourceFactory.java index 858b7d855..fe82452de 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/CompositeGridResourceFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/CompositeGridResourceFactory.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.grid.view; +package com.refinedmods.refinedstorage.common.grid.view; import com.refinedmods.refinedstorage.api.grid.view.GridResource; import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import java.util.Optional; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java new file mode 100644 index 000000000..bd042f156 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java @@ -0,0 +1,104 @@ +package com.refinedmods.refinedstorage.common.grid.view; + +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.grid.GridResourceAttributeKeys; +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.grid.view.AbstractPlatformGridResource; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage.common.support.tooltip.MouseClientTooltipComponent; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import javax.annotation.Nullable; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.network.chat.Component; +import net.minecraft.world.inventory.tooltip.TooltipComponent; + +public class FluidGridResource extends AbstractPlatformGridResource { + private final FluidResource fluidResource; + private final int id; + + public FluidGridResource(final ResourceAmount resourceAmount, + final String name, + final String modId, + final String modName, + final Set tags, + final String tooltip) { + super(resourceAmount, name, Map.of( + GridResourceAttributeKeys.MOD_ID, Set.of(modId), + GridResourceAttributeKeys.MOD_NAME, Set.of(modName), + GridResourceAttributeKeys.TAGS, tags, + GridResourceAttributeKeys.TOOLTIP, Set.of(tooltip) + )); + this.fluidResource = (FluidResource) resourceAmount.getResource(); + this.id = BuiltInRegistries.FLUID.getId(fluidResource.fluid()); + } + + @Override + public int getRegistryId() { + return id; + } + + @Override + public List getExtractionHints() { + return Platform.INSTANCE.getFilledBucket(fluidResource).map(bucket -> MouseClientTooltipComponent.item( + MouseClientTooltipComponent.Type.LEFT, + bucket, + null + )).stream().toList(); + } + + @Nullable + @Override + public PlatformResourceKey getUnderlyingResource() { + return fluidResource; + } + + @Override + public void onExtract(final GridExtractMode extractMode, + final boolean cursor, + final GridExtractionStrategy extractionStrategy) { + extractionStrategy.onExtract(fluidResource, extractMode, cursor); + } + + @Override + public void onScroll(final GridScrollMode scrollMode, final GridScrollingStrategy scrollingStrategy) { + // no-op + } + + @Override + public void render(final GuiGraphics graphics, final int x, final int y) { + Platform.INSTANCE.getFluidRenderer().render(graphics.pose(), x, y, fluidResource); + } + + @Override + public String getDisplayedAmount() { + return FluidResourceRendering.formatWithUnits(getAmount()); + } + + @Override + public String getAmountInTooltip() { + return FluidResourceRendering.format(getAmount()); + } + + @Override + public List getTooltip() { + return Platform.INSTANCE.getFluidRenderer().getTooltip(fluidResource); + } + + @Override + public Optional getTooltipImage() { + return Optional.empty(); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/ItemGridResource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/ItemGridResource.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java index 95db4aff2..da0b5d98c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/ItemGridResource.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage.platform.common.grid.view; +package com.refinedmods.refinedstorage.common.grid.view; import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.api.grid.GridResourceAttributeKeys; -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.view.AbstractPlatformGridResource; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; +import com.refinedmods.refinedstorage.common.api.grid.GridResourceAttributeKeys; +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.grid.view.AbstractPlatformGridResource; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.tooltip.MouseClientTooltipComponent; import java.util.List; import java.util.Map; @@ -71,14 +71,14 @@ public List getExtractionHints() { final long extractableAmount = Math.min(getAmount(), itemStack.getMaxStackSize()); final long halfExtractionAmount = extractableAmount == 1 ? 1 : extractableAmount / 2; return List.of( - new MouseWithIconClientTooltipComponent( - MouseWithIconClientTooltipComponent.Type.LEFT, - this::render, + MouseClientTooltipComponent.itemWithDecorations( + MouseClientTooltipComponent.Type.LEFT, + itemStack, extractableAmount == 1 ? null : AmountFormatting.format(extractableAmount) ), - new MouseWithIconClientTooltipComponent( - MouseWithIconClientTooltipComponent.Type.RIGHT, - this::render, + MouseClientTooltipComponent.itemWithDecorations( + MouseClientTooltipComponent.Type.RIGHT, + itemStack, halfExtractionAmount == 1 ? null : AmountFormatting.format(halfExtractionAmount) ) ); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/package-info.java new file mode 100644 index 000000000..042dfcbd4 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.grid.view; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/ExportedResourcesContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/ExportedResourcesContainer.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/ExportedResourcesContainer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/ExportedResourcesContainer.java index 29fa88f85..afff56c66 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/ExportedResourcesContainer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/ExportedResourcesContainer.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.iface; +package com.refinedmods.refinedstorage.common.iface; import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceExportState; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.channel.FuzzyStorageChannel; -import com.refinedmods.refinedstorage.platform.api.support.resource.FuzzyModeNormalizer; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.root.FuzzyRootStorage; +import com.refinedmods.refinedstorage.common.api.support.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; import java.util.Collection; import java.util.Collections; @@ -22,8 +22,8 @@ public class ExportedResourcesContainer extends ResourceContainerImpl implements super( size, InterfaceBlockEntity::getTransferQuota, - PlatformApi.INSTANCE.getItemResourceFactory(), - PlatformApi.INSTANCE.getAlternativeResourceFactories() + RefinedStorageApi.INSTANCE.getItemResourceFactory(), + RefinedStorageApi.INSTANCE.getAlternativeResourceFactories() ); this.filter = filter; } @@ -34,15 +34,15 @@ public int getSlots() { } @Override - public Collection expandExportCandidates(final StorageChannel storageChannel, + public Collection expandExportCandidates(final RootStorage rootStorage, final ResourceKey resource) { if (!filter.isFuzzyMode()) { return Collections.singletonList(resource); } - if (!(storageChannel instanceof FuzzyStorageChannel fuzzyStorageChannel)) { + if (!(rootStorage instanceof FuzzyRootStorage fuzzyRootStorage)) { return Collections.singletonList(resource); } - return fuzzyStorageChannel + return fuzzyRootStorage .getFuzzy(resource) .stream() .map(ResourceAmount::getResource) diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlock.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlock.java index 7b4140f49..2f5f0531c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlock.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.iface; +package com.refinedmods.refinedstorage.common.iface; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseBlock; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; @@ -22,7 +22,7 @@ import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BooleanProperty; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class InterfaceBlock extends AbstractBaseBlock implements EntityBlock { private static final Component HELP = createTranslation("item", "interface.help"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlockEntity.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlockEntity.java index d9b59f72e..ddb9fde06 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlockEntity.java @@ -1,21 +1,21 @@ -package com.refinedmods.refinedstorage.platform.common.iface; +package com.refinedmods.refinedstorage.common.iface; import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.iface.externalstorage.InterfaceExternalStorageProvider; import com.refinedmods.refinedstorage.api.network.impl.node.iface.externalstorage.InterfaceExternalStorageProviderImpl; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.BlockEntityWithDrops; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; import javax.annotation.Nullable; @@ -51,21 +51,21 @@ public InterfaceBlockEntity(final BlockPos pos, final BlockState state) { state, new InterfaceNetworkNode(Platform.INSTANCE.getConfig().getInterface().getEnergyUsage()) ); - this.mainNode.setTransferQuotaProvider(InterfaceBlockEntity::getTransferQuota); + this.mainNetworkNode.setTransferQuotaProvider(InterfaceBlockEntity::getTransferQuota); this.filter = FilterWithFuzzyMode.create(createFilterContainer(), this::setChanged); this.exportedResources = createExportedResourcesContainer(filter); this.exportedResources.setListener(this::setChanged); - this.mainNode.setExportState(exportedResources); + this.mainNetworkNode.setExportState(exportedResources); this.exportedResourcesAsContainer = exportedResources.toItemContainer(); - this.externalStorageProvider = new InterfaceExternalStorageProviderImpl(mainNode); + this.externalStorageProvider = new InterfaceExternalStorageProviderImpl(mainNetworkNode); } static ResourceContainer createFilterContainer() { return new ResourceContainerImpl( EXPORT_SLOTS, InterfaceBlockEntity::getTransferQuota, - PlatformApi.INSTANCE.getItemResourceFactory(), - PlatformApi.INSTANCE.getAlternativeResourceFactories() + RefinedStorageApi.INSTANCE.getItemResourceFactory(), + RefinedStorageApi.INSTANCE.getAlternativeResourceFactories() ); } @@ -190,6 +190,6 @@ InterfaceExternalStorageProvider getExternalStorageProvider() { } InterfaceNetworkNode getInterface() { - return mainNode; + return mainNetworkNode; } } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceContainerMenu.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceContainerMenu.java index 938a121d2..7903259b0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceContainerMenu.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage.platform.common.iface; +package com.refinedmods.refinedstorage.common.iface; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlot; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlotType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlotType; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; import net.minecraft.network.chat.Component; import net.minecraft.world.Container; @@ -17,7 +17,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.Slot; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class InterfaceContainerMenu extends AbstractResourceContainerMenu { private static final int EXPORT_CONFIG_SLOT_X = 8; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceData.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceData.java index e731c9e58..e3bbfdf69 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceData.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.iface; +package com.refinedmods.refinedstorage.common.iface; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfacePlatformExternalStorageProviderFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfacePlatformExternalStorageProviderFactory.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfacePlatformExternalStorageProviderFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfacePlatformExternalStorageProviderFactory.java index f0fd2a288..27120e408 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfacePlatformExternalStorageProviderFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfacePlatformExternalStorageProviderFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.iface; +package com.refinedmods.refinedstorage.common.iface; import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.common.api.storage.externalstorage.PlatformExternalStorageProviderFactory; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceProxyExternalStorageProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceProxyExternalStorageProvider.java similarity index 97% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceProxyExternalStorageProvider.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceProxyExternalStorageProvider.java index ba1e7d91d..4bb24e7f3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceProxyExternalStorageProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceProxyExternalStorageProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.iface; +package com.refinedmods.refinedstorage.common.iface; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceScreen.java new file mode 100644 index 000000000..0552383c7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceScreen.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage.common.iface; + +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; + +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public class InterfaceScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/interface.png"); + + public InterfaceScreen(final InterfaceContainerMenu menu, + final Inventory playerInventory, + final Component text) { + super(menu, playerInventory, text); + this.inventoryLabelY = 88; + this.imageWidth = 176; + this.imageHeight = 182; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + addSideButton(new FuzzyModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.FUZZY_MODE), + () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK + )); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/package-info.java new file mode 100644 index 000000000..daf131302 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.iface; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlock.java new file mode 100644 index 000000000..979e08309 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlock.java @@ -0,0 +1,93 @@ +package com.refinedmods.refinedstorage.common.importer; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalCableBlock; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.ColorableBlock; +import com.refinedmods.refinedstorage.common.support.DirectionalCableBlockShapes; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.VoxelShape; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ImporterBlock extends AbstractDirectionalCableBlock implements + ColorableBlock, EntityBlock, BlockItemProvider { + private static final Component HELP = createTranslation("item", "importer.help"); + private static final Map SHAPE_CACHE = new HashMap<>(); + private static final AbstractBlockEntityTicker TICKER = + new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getImporter); + private final DyeColor color; + private final MutableComponent name; + + public ImporterBlock(final DyeColor color, final MutableComponent name) { + super(SHAPE_CACHE); + this.color = color; + this.name = name; + } + + @Override + public DyeColor getColor() { + return color; + } + + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new ImporterBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getImporter(); + } + + @Override + protected VoxelShape getExtensionShape(final Direction direction) { + return switch (direction) { + case NORTH -> DirectionalCableBlockShapes.IMPORTER_NORTH; + case EAST -> DirectionalCableBlockShapes.IMPORTER_EAST; + case SOUTH -> DirectionalCableBlockShapes.IMPORTER_SOUTH; + case WEST -> DirectionalCableBlockShapes.IMPORTER_WEST; + case UP -> DirectionalCableBlockShapes.IMPORTER_UP; + case DOWN -> DirectionalCableBlockShapes.IMPORTER_DOWN; + }; + } + + @Override + public MutableComponent getName() { + return name; + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlockEntity.java new file mode 100644 index 000000000..38ee56e23 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlockEntity.java @@ -0,0 +1,183 @@ +package com.refinedmods.refinedstorage.common.importer; + +import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterNetworkNode; +import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractUpgradeableNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; + +import java.util.List; +import java.util.Set; +import java.util.function.LongSupplier; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.network.codec.StreamEncoder; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.block.state.BlockState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ImporterBlockEntity + extends AbstractUpgradeableNetworkNodeContainerBlockEntity + implements AmountOverride, NetworkNodeExtendedMenuProvider { + private static final Logger LOGGER = LoggerFactory.getLogger(ImporterBlockEntity.class); + + private static final String TAG_FILTER_MODE = "fim"; + + private final FilterWithFuzzyMode filter; + + public ImporterBlockEntity(final BlockPos pos, final BlockState state) { + super( + BlockEntities.INSTANCE.getImporter(), + pos, + state, + new ImporterNetworkNode(0), + UpgradeDestinations.IMPORTER + ); + this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters( + ResourceContainerImpl.createForFilter(), + this::setChanged, + this::setFilters + ); + this.mainNetworkNode.setNormalizer(filter.createNormalizer()); + } + + @Override + protected void initialize(final ServerLevel level, final Direction direction) { + final List strategies = createStrategies(level, direction); + LOGGER.debug("Initialized importer at {} with strategies {}", worldPosition, strategies); + mainNetworkNode.setTransferStrategies(strategies); + } + + private List createStrategies(final ServerLevel serverLevel, final Direction direction) { + final Direction incomingDirection = direction.getOpposite(); + final BlockPos sourcePosition = worldPosition.relative(direction); + final List factories = + RefinedStorageApi.INSTANCE.getImporterTransferStrategyRegistry().getAll(); + return factories + .stream() + .map(factory -> factory.create(serverLevel, sourcePosition, incomingDirection, upgradeContainer, this)) + .toList(); + } + + @Override + public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + super.writeConfiguration(tag, provider); + tag.putInt(TAG_FILTER_MODE, FilterModeSettings.getFilterMode(mainNetworkNode.getFilterMode())); + filter.save(tag, provider); + } + + @Override + public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + super.readConfiguration(tag, provider); + if (tag.contains(TAG_FILTER_MODE)) { + mainNetworkNode.setFilterMode(FilterModeSettings.getFilterMode(tag.getInt(TAG_FILTER_MODE))); + } + filter.load(tag, provider); + } + + void setFilters(final Set filters) { + mainNetworkNode.setFilters(filters); + } + + boolean isFuzzyMode() { + return filter.isFuzzyMode(); + } + + void setFuzzyMode(final boolean fuzzyMode) { + filter.setFuzzyMode(fuzzyMode); + } + + FilterMode getFilterMode() { + return mainNetworkNode.getFilterMode(); + } + + void setFilterMode(final FilterMode mode) { + mainNetworkNode.setFilterMode(mode); + setChanged(); + } + + @Override + protected void setEnergyUsage(final long upgradeEnergyUsage) { + final long baseEnergyUsage = Platform.INSTANCE.getConfig().getImporter().getEnergyUsage(); + mainNetworkNode.setEnergyUsage(baseEnergyUsage + upgradeEnergyUsage); + } + + @Override + public ResourceContainerData getMenuData() { + return ResourceContainerData.of(filter.getFilterContainer()); + } + + @Override + public StreamEncoder getMenuCodec() { + return ResourceContainerData.STREAM_CODEC; + } + + @Override + public Component getDisplayName() { + return ContentNames.IMPORTER; + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new ImporterContainerMenu(syncId, player, this, filter.getFilterContainer(), upgradeContainer); + } + + @Override + public long overrideAmount(final ResourceKey resource, + final long amount, + final LongSupplier currentAmountSupplier) { + if (!upgradeContainer.has(Items.INSTANCE.getRegulatorUpgrade())) { + return amount; + } + return upgradeContainer.getRegulatedAmount(resource) + .stream() + .map(desiredAmount -> getAmountStillAvailableForImport( + amount, + currentAmountSupplier.getAsLong(), + desiredAmount + )) + .findFirst() + .orElse(amount); + } + + private long getAmountStillAvailableForImport(final long amount, + final long currentAmount, + final long desiredAmount) { + final long stillAvailableToImport = currentAmount - desiredAmount; + if (stillAvailableToImport <= 0) { + return 0; + } + return Math.min(stillAvailableToImport, amount); + } + + @Override + protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, + final BlockState newBlockState) { + return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterContainerMenu.java new file mode 100644 index 000000000..eabe0b571 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterContainerMenu.java @@ -0,0 +1,78 @@ +package com.refinedmods.refinedstorage.common.importer; + +import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractSimpleFilterContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; + +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ImporterContainerMenu extends AbstractSimpleFilterContainerMenu { + private static final MutableComponent FILTER_HELP = createTranslation("gui", "importer.filter_help"); + + public ImporterContainerMenu(final int syncId, + final Inventory playerInventory, + final ResourceContainerData resourceContainerData) { + super( + Menus.INSTANCE.getImporter(), + syncId, + playerInventory.player, + resourceContainerData, + UpgradeDestinations.IMPORTER, + FILTER_HELP + ); + } + + ImporterContainerMenu(final int syncId, + final Player player, + final ImporterBlockEntity importer, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { + super( + Menus.INSTANCE.getImporter(), + syncId, + player, + resourceContainer, + upgradeContainer, + importer, + FILTER_HELP + ); + } + + @Override + protected void registerClientProperties() { + registerProperty(new ClientProperty<>(PropertyTypes.FILTER_MODE, FilterMode.BLOCK)); + registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + } + + @Override + protected void registerServerProperties(final ImporterBlockEntity blockEntity) { + registerProperty(new ServerProperty<>( + PropertyTypes.FILTER_MODE, + blockEntity::getFilterMode, + blockEntity::setFilterMode + )); + registerProperty(new ServerProperty<>( + PropertyTypes.FUZZY_MODE, + blockEntity::isFuzzyMode, + blockEntity::setFuzzyMode + )); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + blockEntity::getRedstoneMode, + blockEntity::setRedstoneMode + )); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterScreen.java new file mode 100644 index 000000000..039c5ffd0 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterScreen.java @@ -0,0 +1,31 @@ +package com.refinedmods.refinedstorage.common.importer; + +import com.refinedmods.refinedstorage.common.storage.FilterModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.AbstractFilterScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ImporterScreen extends AbstractFilterScreen { + public ImporterScreen(final ImporterContainerMenu menu, final Inventory playerInventory, final Component text) { + super(menu, playerInventory, text); + } + + @Override + protected void init() { + super.init(); + addSideButton(new FilterModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.FILTER_MODE), + createTranslation("gui", "importer.filter_mode.allow.help"), + createTranslation("gui", "importer.filter_mode.block.help") + )); + addSideButton(new FuzzyModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.FUZZY_MODE), + () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_SOURCE + )); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/package-info.java new file mode 100644 index 000000000..d7891b8c5 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.importer; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/misc/ProcessorItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/misc/ProcessorItem.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/misc/ProcessorItem.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/misc/ProcessorItem.java index 48310f713..2072e425e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/misc/ProcessorItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/misc/ProcessorItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.misc; +package com.refinedmods.refinedstorage.common.misc; import net.minecraft.world.item.Item; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/misc/WrenchItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/misc/WrenchItem.java new file mode 100644 index 000000000..c7d0b5c4d --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/misc/WrenchItem.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage.common.misc; + +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; + +import java.util.Optional; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class WrenchItem extends Item { + private static final Component HELP = createTranslation("item", "wrench.help"); + + public WrenchItem() { + super(new Item.Properties().stacksTo(1)); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(HELP)); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/misc/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/misc/package-info.java new file mode 100644 index 000000000..1a262c36d --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/misc/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.misc; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/CableBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/CableBlock.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/CableBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/CableBlock.java index 7e15780d1..0cb1547c1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/CableBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/CableBlock.java @@ -1,20 +1,20 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractColoredBlock; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.CableBlockSupport; -import com.refinedmods.refinedstorage.platform.common.support.CableShapeCacheKey; -import com.refinedmods.refinedstorage.platform.common.support.ColorableBlock; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.BaseNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractColoredBlock; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.CableBlockSupport; +import com.refinedmods.refinedstorage.common.support.CableShapeCacheKey; +import com.refinedmods.refinedstorage.common.support.ColorableBlock; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.BaseNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; @@ -42,7 +42,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class CableBlock extends AbstractColoredBlock implements ColorableBlock, SimpleWaterloggedBlock, EntityBlock { @@ -65,7 +65,6 @@ public boolean propagatesSkylightDown(final BlockState state, final BlockGetter } @Override - @SuppressWarnings("deprecation") public FluidState getFluidState(final BlockState state) { return Boolean.TRUE.equals(state.getValue(BlockStateProperties.WATERLOGGED)) ? Fluids.WATER.getSource(false) @@ -73,7 +72,6 @@ public FluidState getFluidState(final BlockState state) { } @Override - @SuppressWarnings("deprecation") public BlockState updateShape(final BlockState state, final Direction direction, final BlockState newState, @@ -100,7 +98,6 @@ protected void createBlockStateDefinition(final StateDefinition.Builder lines.add(UNBOUND)); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkCardItemPropertyFunction.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkCardItemPropertyFunction.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkCardItemPropertyFunction.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkCardItemPropertyFunction.java index 516aad278..4a6f42574 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkCardItemPropertyFunction.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkCardItemPropertyFunction.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; import javax.annotation.Nullable; @@ -8,7 +8,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class NetworkCardItemPropertyFunction implements ClampedItemPropertyFunction { public static final ResourceLocation NAME = createIdentifier("network_card_active"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkReceiverBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkReceiverBlock.java new file mode 100644 index 000000000..dbe5bea6c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkReceiverBlock.java @@ -0,0 +1,81 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractColoredBlock; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BooleanProperty; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class NetworkReceiverBlock extends AbstractColoredBlock implements EntityBlock { + public static final BooleanProperty ACTIVE = BooleanProperty.create("active"); + + private static final AbstractBlockEntityTicker TICKER = + new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getNetworkReceiver, ACTIVE); + private static final Component HELP = createTranslation("item", "network_receiver.help"); + + public NetworkReceiverBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES, color, name); + } + + @Override + protected BlockState getDefaultState() { + return super.getDefaultState().setValue(ACTIVE, false); + } + + @Override + protected void createBlockStateDefinition(final StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(ACTIVE); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getNetworkReceiver(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new NetworkReceiverBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } + + @Override + public boolean canAlwaysConnect() { + return true; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkReceiverBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkReceiverBlockEntity.java new file mode 100644 index 000000000..e9c2663dc --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkReceiverBlockEntity.java @@ -0,0 +1,38 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.support.network.BaseNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.network.ColoredConnectionStrategy; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.world.level.block.state.BlockState; + +import static java.util.Objects.requireNonNull; + +public class NetworkReceiverBlockEntity extends BaseNetworkNodeContainerBlockEntity { + public NetworkReceiverBlockEntity(final BlockPos pos, final BlockState state) { + super( + BlockEntities.INSTANCE.getNetworkReceiver(), + pos, + state, + new SimpleNetworkNode(Platform.INSTANCE.getConfig().getNetworkReceiver().getEnergyUsage()) + ); + } + + @Override + protected InWorldNetworkNodeContainer createMainContainer(final SimpleNetworkNode networkNode) { + return RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, networkNode) + .connectionStrategy(new ColoredConnectionStrategy(this::getBlockState, getBlockPos())) + .keyProvider(this::createKey) + .build(); + } + + private NetworkReceiverKey createKey() { + return new NetworkReceiverKey(GlobalPos.of(requireNonNull(level).dimension(), getBlockPos())); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkReceiverKey.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkReceiverKey.java similarity index 94% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkReceiverKey.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkReceiverKey.java index 285839a48..59757b89c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkReceiverKey.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkReceiverKey.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; import net.minecraft.core.BlockPos; import net.minecraft.core.GlobalPos; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlock.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlock.java index f62f18ab1..20d02eb82 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlock.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractColoredBlock; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractColoredBlock; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; import javax.annotation.Nullable; @@ -24,7 +24,7 @@ import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.EnumProperty; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class NetworkTransmitterBlock extends AbstractColoredBlock implements EntityBlock { public static final EnumProperty STATE = EnumProperty.create( diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java index f60dea301..5f32d3502 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java @@ -1,16 +1,19 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionSink; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.BlockEntityWithDrops; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.util.ContainerUtil; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.network.ColoredConnectionStrategy; +import com.refinedmods.refinedstorage.common.util.ContainerUtil; import javax.annotation.Nullable; @@ -33,7 +36,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class NetworkTransmitterBlockEntity extends AbstractRedstoneModeNetworkNodeContainerBlockEntity @@ -68,15 +71,30 @@ public NetworkTransmitterBlockEntity(final BlockPos pos, final BlockState state) if (level != null) { LOGGER.debug("Network card was changed at {}, sending network update", worldPosition); setChanged(); - updateContainers(); + containers.update(level); } }); } + @Override + protected InWorldNetworkNodeContainer createMainContainer(final SimpleNetworkNode networkNode) { + return RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, networkNode) + .connectionStrategy(new ColoredConnectionStrategy(this::getBlockState, getBlockPos()) { + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + super.addOutgoingConnections(sink); + if (receiverKey != null && NetworkTransmitterBlockEntity.this.mainNetworkNode.isActive()) { + sink.tryConnect(receiverKey.pos()); + } + } + }) + .build(); + } + @Override protected void activenessChanged(final boolean newActive) { super.activenessChanged(newActive); - updateContainers(); + containers.update(level); } public void updateStateInLevel(final BlockState state) { @@ -89,13 +107,13 @@ public void updateStateInLevel(final BlockState state) { } private NetworkTransmitterState calculateState() { - if (!mainNode.isActive()) { + if (!mainNetworkNode.isActive()) { return NetworkTransmitterState.INACTIVE; } if (receiverKey == null) { return NetworkTransmitterState.ERROR; } - final Network network = mainNode.getNetwork(); + final Network network = mainNetworkNode.getNetwork(); if (network == null) { return NetworkTransmitterState.ERROR; } @@ -104,8 +122,8 @@ private NetworkTransmitterState calculateState() { } NetworkTransmitterData getStatus() { - final Network network = mainNode.getNetwork(); - if (!mainNode.isActive() || network == null || level == null) { + final Network network = mainNetworkNode.getNetwork(); + if (!mainNetworkNode.isActive() || network == null || level == null) { return INACTIVE; } if (receiverKey == null) { @@ -126,10 +144,10 @@ NetworkTransmitterData getStatus() { @Override public void doWork() { super.doWork(); - if (!mainNode.isActive() || mainNode.getNetwork() == null || receiverKey == null) { + if (!mainNetworkNode.isActive() || mainNetworkNode.getNetwork() == null || receiverKey == null) { return; } - final boolean receiverFound = isReceiverFoundInNetwork(mainNode.getNetwork(), receiverKey); + final boolean receiverFound = isReceiverFoundInNetwork(mainNetworkNode.getNetwork(), receiverKey); if (!receiverFound && networkRebuildRetryRateLimiter.tryAcquire()) { tryReconnectingWithReceiver(); } @@ -141,7 +159,7 @@ private void tryReconnectingWithReceiver() { receiverKey, worldPosition ); - updateContainers(); + containers.update(level); } private static boolean isReceiverFoundInNetwork(final Network network, final NetworkReceiverKey key) { @@ -196,12 +214,4 @@ public Component getDisplayName() { public NonNullList getDrops() { return NonNullList.of(ItemStack.EMPTY, networkCardInventory.getNetworkCard()); } - - @Override - public void addOutgoingConnections(final ConnectionSink sink) { - super.addOutgoingConnections(sink); - if (receiverKey != null && mainNode.isActive()) { - sink.tryConnect(receiverKey.pos()); - } - } } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterBlockEntityTicker.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntityTicker.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterBlockEntityTicker.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntityTicker.java index 1aaf07035..cfb229bcf 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterBlockEntityTicker.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntityTicker.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterContainerMenu.java similarity index 80% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterContainerMenu.java index efb7ef849..33538c0eb 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterContainerMenu.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ValidatedSlot; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.S2CPackets; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.ValidatedSlot; +import com.refinedmods.refinedstorage.common.support.packet.s2c.S2CPackets; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterData.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterData.java index 0b9fe6fc8..3211a3423 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterData.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java index 4cef74c83..a7e208be0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.TextureIds; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class NetworkTransmitterScreen extends AbstractBaseScreen { private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/network_transmitter.png"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterState.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterState.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterState.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterState.java index e42adfd79..a8a151444 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkTransmitterState.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterState.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; import net.minecraft.util.StringRepresentable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlock.java new file mode 100644 index 000000000..b2e8e308b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlock.java @@ -0,0 +1,71 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractActiveColoredDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.direction.DefaultDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class RelayBlock extends AbstractActiveColoredDirectionalBlock + implements EntityBlock, BlockItemProvider { + private static final Component HELP = createTranslation("item", "relay.help"); + private static final AbstractBlockEntityTicker TICKER = new NetworkNodeBlockEntityTicker<>( + BlockEntities.INSTANCE::getRelay, + ACTIVE + ); + + public RelayBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES, color, name); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { + return new RelayBlockEntity(blockPos, blockState); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + protected DirectionType getDirectionType() { + return DefaultDirectionType.FACE_PLAYER; + } + + @Override + public BaseBlockItem createBlockItem() { + return new BaseBlockItem(this, HELP); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getRelay(); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java new file mode 100644 index 000000000..6d8ff6b94 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java @@ -0,0 +1,263 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayComponentType; +import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayInputNetworkNode; +import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayOutputNetworkNode; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage.api.storage.AccessMode; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.storage.AccessModeSettings; +import com.refinedmods.refinedstorage.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; + +import java.util.HashSet; +import java.util.Set; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.network.codec.StreamEncoder; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock.tryExtractDirection; +import static java.util.Objects.requireNonNull; + +public class RelayBlockEntity extends AbstractRedstoneModeNetworkNodeContainerBlockEntity + implements NetworkNodeExtendedMenuProvider { + private static final String TAG_PASS_THROUGH = "passthrough"; + private static final String TAG_PASS_ENERGY = "passenergy"; + private static final String TAG_PASS_SECURITY = "passsecurity"; + private static final String TAG_PASS_STORAGE = "passstorage"; + private static final String TAG_FILTER_MODE = "fim"; + private static final String TAG_ACCESS_MODE = "am"; + private static final String TAG_PRIORITY = "pri"; + + private final FilterWithFuzzyMode filter; + private final RelayOutputNetworkNode outputNode; + + private boolean passThrough = true; + private FilterMode filterMode = FilterMode.BLOCK; + private AccessMode accessMode = AccessMode.INSERT_EXTRACT; + private int priority = 0; + + public RelayBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getRelay(), pos, state, new RelayInputNetworkNode( + Platform.INSTANCE.getConfig().getRelay().getInputNetworkEnergyUsage() + )); + this.outputNode = new RelayOutputNetworkNode( + Platform.INSTANCE.getConfig().getRelay().getOutputNetworkEnergyUsage() + ); + this.mainNetworkNode.setOutputNode(outputNode); + this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters( + ResourceContainerImpl.createForFilter(), + this::setChanged, + this::filterContainerChanged + ); + this.mainNetworkNode.setFilterNormalizer(filter.createNormalizer()); + this.containers.addContainer( + RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, outputNode) + .name("output") + .connectionStrategy(new RelayOutputConnectionStrategy(this)) + .build() + ); + setRedstoneMode(RedstoneMode.LOW); + } + + boolean isFuzzyMode() { + return filter.isFuzzyMode(); + } + + void setFuzzyMode(final boolean fuzzyMode) { + final boolean wasActive = mainNetworkNode.isActive(); + // Updating fuzzy mode will call the filter's listener as the normalizer will yield different outputs. + // However, when updating a filter the storage resets and "self-removes". If the normalizer yields different + // outputs too early, the self-remove operation will partially fail as the expected resources will be different. + // Therefore, we need to deactivate the node, update the fuzzy mode, and then reinitialize the node (ugly hack). + mainNetworkNode.setActive(false); + filter.setFuzzyMode(fuzzyMode); + mainNetworkNode.setActive(wasActive); + } + + private void filterContainerChanged(final Set filters) { + mainNetworkNode.setFilters(filters); + setChanged(); + } + + int getPriority() { + return priority; + } + + void setPriority(final int priority) { + this.priority = priority; + this.mainNetworkNode.setPriority(priority); + setChanged(); + } + + AccessMode getAccessMode() { + return accessMode; + } + + void setAccessMode(final AccessMode accessMode) { + this.accessMode = accessMode; + mainNetworkNode.setAccessMode(accessMode); + setChanged(); + } + + FilterMode getFilterMode() { + return filterMode; + } + + void setFilterMode(final FilterMode filterMode) { + this.filterMode = filterMode; + mainNetworkNode.setFilterMode(filterMode); + setChanged(); + } + + boolean isPassEnergy() { + return mainNetworkNode.hasComponentType(RelayComponentType.ENERGY); + } + + void setPassEnergy(final boolean passEnergy) { + mainNetworkNode.updateComponentType(RelayComponentType.ENERGY, passEnergy); + setChanged(); + } + + boolean isPassStorage() { + return mainNetworkNode.hasComponentType(RelayComponentType.STORAGE); + } + + void setPassStorage(final boolean passStorage) { + mainNetworkNode.updateComponentType(RelayComponentType.STORAGE, passStorage); + setChanged(); + } + + boolean isPassSecurity() { + return mainNetworkNode.hasComponentType(RelayComponentType.SECURITY); + } + + void setPassSecurity(final boolean passSecurity) { + mainNetworkNode.updateComponentType(RelayComponentType.SECURITY, passSecurity); + setChanged(); + } + + boolean isPassThrough() { + return passThrough; + } + + void setPassThrough(final boolean passThrough) { + this.passThrough = passThrough; + this.mainNetworkNode.setComponentTypes(Set.of()); + setChanged(); + containers.update(level); + } + + boolean isActiveInternal() { + return mainNetworkNode.isActive(); + } + + Direction getDirectionInternal() { + return requireNonNull(tryExtractDirection(getBlockState())); + } + + @Override + protected void activenessChanged(final boolean newActive) { + super.activenessChanged(newActive); + outputNode.setActive(newActive); + containers.update(level); + } + + @Override + protected InWorldNetworkNodeContainer createMainContainer(final RelayInputNetworkNode networkNode) { + return RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, networkNode) + .name("input") + .connectionStrategy(new RelayInputConnectionStrategy(this)) + .build(); + } + + @Override + public ResourceContainerData getMenuData() { + return ResourceContainerData.of(filter.getFilterContainer()); + } + + @Override + public StreamEncoder getMenuCodec() { + return ResourceContainerData.STREAM_CODEC; + } + + @Override + public Component getDisplayName() { + return ContentNames.RELAY; + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new RelayContainerMenu(syncId, player, this, filter.getFilterContainer()); + } + + @Override + public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + super.writeConfiguration(tag, provider); + filter.save(tag, provider); + tag.putInt(TAG_FILTER_MODE, FilterModeSettings.getFilterMode(filterMode)); + tag.putBoolean(TAG_PASS_THROUGH, passThrough); + tag.putBoolean(TAG_PASS_ENERGY, mainNetworkNode.hasComponentType(RelayComponentType.ENERGY)); + tag.putBoolean(TAG_PASS_STORAGE, mainNetworkNode.hasComponentType(RelayComponentType.STORAGE)); + tag.putBoolean(TAG_PASS_SECURITY, mainNetworkNode.hasComponentType(RelayComponentType.SECURITY)); + tag.putInt(TAG_ACCESS_MODE, AccessModeSettings.getAccessMode(accessMode)); + tag.putInt(TAG_PRIORITY, priority); + } + + @Override + public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + super.readConfiguration(tag, provider); + filter.load(tag, provider); + if (tag.contains(TAG_FILTER_MODE)) { + filterMode = FilterModeSettings.getFilterMode(tag.getInt(TAG_FILTER_MODE)); + } + mainNetworkNode.setFilterMode(filterMode); + if (tag.contains(TAG_PASS_THROUGH)) { + passThrough = tag.getBoolean(TAG_PASS_THROUGH); + } + mainNetworkNode.setComponentTypes(getComponentTypes(tag)); + if (tag.contains(TAG_ACCESS_MODE)) { + accessMode = AccessModeSettings.getAccessMode(tag.getInt(TAG_ACCESS_MODE)); + } + mainNetworkNode.setAccessMode(accessMode); + if (tag.contains(TAG_PRIORITY)) { + priority = tag.getInt(TAG_PRIORITY); + } + mainNetworkNode.setPriority(priority); + } + + private Set getComponentTypes(final CompoundTag tag) { + final Set types = new HashSet<>(); + if (tag.getBoolean(TAG_PASS_ENERGY)) { + types.add(RelayComponentType.ENERGY); + } + if (tag.getBoolean(TAG_PASS_SECURITY)) { + types.add(RelayComponentType.SECURITY); + } + if (tag.getBoolean(TAG_PASS_STORAGE)) { + types.add(RelayComponentType.STORAGE); + } + return types; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayContainerMenu.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayContainerMenu.java index 02465c1ab..d56e2f116 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayContainerMenu.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.AccessMode; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.storage.StoragePropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSimpleFilterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.storage.StoragePropertyTypes; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractSimpleFilterContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; import javax.annotation.Nullable; @@ -18,7 +18,7 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class RelayContainerMenu extends AbstractSimpleFilterContainerMenu { private static final MutableComponent FILTER_HELP = createTranslation("gui", "relay.filter_help"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayInputConnectionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayInputConnectionStrategy.java new file mode 100644 index 000000000..cdea3d7fa --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayInputConnectionStrategy.java @@ -0,0 +1,34 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionStrategy; + +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; + +class RelayInputConnectionStrategy implements ConnectionStrategy { + private final RelayBlockEntity blockEntity; + + RelayInputConnectionStrategy(final RelayBlockEntity blockEntity) { + this.blockEntity = blockEntity; + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + final Direction direction = blockEntity.getDirectionInternal(); + for (final Direction otherDirection : Direction.values()) { + if (otherDirection != direction || (blockEntity.isPassThrough() && blockEntity.isActiveInternal())) { + sink.tryConnectInSameDimension( + blockEntity.getBlockPos().relative(otherDirection), + otherDirection.getOpposite() + ); + } + } + } + + @Override + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + return incomingDirection != blockEntity.getDirectionInternal() + || (blockEntity.isPassThrough() && blockEntity.isActiveInternal()); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayOutputConnectionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayOutputConnectionStrategy.java new file mode 100644 index 000000000..bee740f40 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayOutputConnectionStrategy.java @@ -0,0 +1,34 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionStrategy; + +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; + +class RelayOutputConnectionStrategy implements ConnectionStrategy { + private final RelayBlockEntity blockEntity; + + RelayOutputConnectionStrategy(final RelayBlockEntity blockEntity) { + this.blockEntity = blockEntity; + } + + // The output network node container must always have an outgoing and incoming connection. + // If not, network node containers after the output network node container may end up without a network + // because the graph algorithm won't be able to work properly and won't be able to reassign a new network. + // The output network node container *never* provides a connection with the input network node container. + // The input network node container controls whether the output network node container is connected. + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + final Direction direction = blockEntity.getDirectionInternal(); + sink.tryConnectInSameDimension( + blockEntity.getBlockPos().relative(direction), + direction.getOpposite() + ); + } + + @Override + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + return incomingDirection == blockEntity.getDirectionInternal(); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassEnergySideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassEnergySideButtonWidget.java new file mode 100644 index 000000000..177a22d92 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassEnergySideButtonWidget.java @@ -0,0 +1,36 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractYesNoSideButtonWidget; + +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class RelayPassEnergySideButtonWidget extends AbstractYesNoSideButtonWidget { + private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_energy"); + private static final MutableComponent HELP = createTranslation("gui", "relay.pass_energy.help"); + + RelayPassEnergySideButtonWidget(final ClientProperty property) { + super(property, TITLE); + } + + @Override + protected int getXTexture() { + return Boolean.TRUE.equals(property.getValue()) ? 128 : 144; + } + + @Override + protected int getYTexture() { + return 0; + } + + @Nullable + @Override + protected Component getHelpText() { + return HELP; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassSecuritySideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassSecuritySideButtonWidget.java new file mode 100644 index 000000000..0c920d309 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassSecuritySideButtonWidget.java @@ -0,0 +1,36 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractYesNoSideButtonWidget; + +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class RelayPassSecuritySideButtonWidget extends AbstractYesNoSideButtonWidget { + private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_security"); + private static final MutableComponent HELP = createTranslation("gui", "relay.pass_security.help"); + + RelayPassSecuritySideButtonWidget(final ClientProperty property) { + super(property, TITLE); + } + + @Override + protected int getXTexture() { + return Boolean.TRUE.equals(property.getValue()) ? 128 : 144; + } + + @Override + protected int getYTexture() { + return 32; + } + + @Nullable + @Override + protected Component getHelpText() { + return HELP; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassStorageSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassStorageSideButtonWidget.java new file mode 100644 index 000000000..a472a33a0 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassStorageSideButtonWidget.java @@ -0,0 +1,36 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractYesNoSideButtonWidget; + +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class RelayPassStorageSideButtonWidget extends AbstractYesNoSideButtonWidget { + private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_storage"); + private static final MutableComponent HELP = createTranslation("gui", "relay.pass_storage.help"); + + RelayPassStorageSideButtonWidget(final ClientProperty property) { + super(property, TITLE); + } + + @Override + protected int getXTexture() { + return Boolean.TRUE.equals(property.getValue()) ? 128 : 144; + } + + @Override + protected int getYTexture() { + return 16; + } + + @Nullable + @Override + protected Component getHelpText() { + return HELP; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassThroughSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassThroughSideButtonWidget.java new file mode 100644 index 000000000..dde6d2149 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassThroughSideButtonWidget.java @@ -0,0 +1,36 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractYesNoSideButtonWidget; + +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class RelayPassThroughSideButtonWidget extends AbstractYesNoSideButtonWidget { + private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_through"); + private static final MutableComponent HELP = createTranslation("gui", "relay.pass_through.help"); + + RelayPassThroughSideButtonWidget(final ClientProperty property) { + super(property, TITLE); + } + + @Override + protected int getXTexture() { + return Boolean.TRUE.equals(property.getValue()) ? 96 : 112; + } + + @Override + protected int getYTexture() { + return 0; + } + + @Nullable + @Override + protected Component getHelpText() { + return HELP; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPropertyTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPropertyTypes.java new file mode 100644 index 000000000..d39d23bd7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPropertyTypes.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyType; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +final class RelayPropertyTypes { + static final PropertyType PASS_THROUGH = PropertyTypes.createBooleanProperty( + createIdentifier("pass_through") + ); + static final PropertyType PASS_ENERGY = PropertyTypes.createBooleanProperty( + createIdentifier("pass_energy") + ); + static final PropertyType PASS_STORAGE = PropertyTypes.createBooleanProperty( + createIdentifier("pass_storage") + ); + static final PropertyType PASS_SECURITY = PropertyTypes.createBooleanProperty( + createIdentifier("pass_security") + ); + + private RelayPropertyTypes() { + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayScreen.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayScreen.java index b88c74bf3..7fc06e1d4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayScreen.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.networking; +package com.refinedmods.refinedstorage.common.networking; -import com.refinedmods.refinedstorage.platform.common.storage.AccessModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.storage.FilterModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.storage.PrioritySideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.storage.StoragePropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.AbstractFilterScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.storage.AccessModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.storage.FilterModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.storage.PrioritySideButtonWidget; +import com.refinedmods.refinedstorage.common.storage.StoragePropertyTypes; +import com.refinedmods.refinedstorage.common.support.AbstractFilterScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; import javax.annotation.Nullable; @@ -15,7 +15,7 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.entity.player.Inventory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class RelayScreen extends AbstractFilterScreen implements RelayContainerMenu.PassThroughListener { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/package-info.java new file mode 100644 index 000000000..35bc5c3aa --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.networking; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/package-info.java new file mode 100644 index 000000000..28c9e092a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardContainerMenu.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardContainerMenu.java index 8c1e864d4..49f272ded 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardContainerMenu.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; -import com.refinedmods.refinedstorage.platform.common.support.stretching.ScreenSizeListener; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; +import com.refinedmods.refinedstorage.common.support.stretching.ScreenSizeListener; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardExtendedMenuProvider.java new file mode 100644 index 000000000..16a19677f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardExtendedMenuProvider.java @@ -0,0 +1,36 @@ +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.support.containermenu.ExtendedMenuProvider; + +import java.util.List; +import java.util.Set; + +abstract class AbstractSecurityCardExtendedMenuProvider implements ExtendedMenuProvider { + private final SecurityPolicy securityPolicy; + private final Set dirtyPermissions; + + AbstractSecurityCardExtendedMenuProvider(final SecurityPolicy securityPolicy, + final Set dirtyPermissions) { + this.securityPolicy = securityPolicy; + this.dirtyPermissions = dirtyPermissions; + } + + protected final List getDataPermissions() { + return RefinedStorageApi.INSTANCE.getPermissionRegistry() + .getAll() + .stream() + .map(this::toDataPermission) + .toList(); + } + + private SecurityCardData.Permission toDataPermission(final PlatformPermission permission) { + return new SecurityCardData.Permission( + permission, + securityPolicy.isAllowed(permission), + dirtyPermissions.contains(permission) + ); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardItem.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardItem.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardItem.java index 4431ace77..9315f03b6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardItem.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import com.refinedmods.refinedstorage.api.network.security.Permission; import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.security.SecurityPolicyContainerItem; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.DataComponents; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.security.SecurityPolicyContainerItem; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.DataComponents; import java.util.HashSet; import java.util.List; @@ -27,7 +27,7 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; abstract class AbstractSecurityCardItem extends Item implements SecurityPolicyContainerItem { protected AbstractSecurityCardItem(final Properties properties) { @@ -46,7 +46,7 @@ public void appendHoverText(final ItemStack stack, private void appendHoverText(final List lines, final SecurityPolicy policy, final Set dirtyPermissions) { - final List allPermissions = PlatformApi.INSTANCE.getPermissionRegistry().getAll(); + final List allPermissions = RefinedStorageApi.INSTANCE.getPermissionRegistry().getAll(); allPermissions.forEach(permission -> { final boolean allowed = policy.isAllowed(permission); final boolean dirty = dirtyPermissions.contains(permission); @@ -79,7 +79,7 @@ private void doUse(final InteractionHand hand, final ServerPlayer player, final final Set dirtyPermissions = getDirtyPermissions(stack); Platform.INSTANCE.getMenuOpener().openMenu(player, createMenuProvider( player.server, - PlatformApi.INSTANCE.createInventorySlotReference(player, hand), + RefinedStorageApi.INSTANCE.createInventorySlotReference(player, hand), policy, dirtyPermissions, stack @@ -107,14 +107,14 @@ public Optional getPolicy(final ItemStack stack) { } final SecurityCardPermissions permissions = stack.get(DataComponents.INSTANCE.getSecurityCardPermissions()); if (permissions == null) { - return Optional.of(PlatformApi.INSTANCE.createDefaultSecurityPolicy()); + return Optional.of(RefinedStorageApi.INSTANCE.createDefaultSecurityPolicy()); } return Optional.of(createPolicy(permissions)); } private SecurityPolicy createPolicy(final SecurityCardPermissions permissions) { final Set allowedPermissions = new HashSet<>(); - for (final PlatformPermission permission : PlatformApi.INSTANCE.getPermissionRegistry().getAll()) { + for (final PlatformPermission permission : RefinedStorageApi.INSTANCE.getPermissionRegistry().getAll()) { final boolean dirty = permissions.isDirty(permission); final boolean didExplicitlyAllow = dirty && permissions.isAllowed(permission); final boolean isAllowedByDefault = !dirty && permission.isAllowedByDefault(); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardScreen.java similarity index 94% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardScreen.java index 98697e556..381c51cff 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardScreen.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.common.support.stretching.AbstractStretchingScreen; -import com.refinedmods.refinedstorage.platform.common.support.widget.CustomCheckboxWidget; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.support.stretching.AbstractStretchingScreen; +import com.refinedmods.refinedstorage.common.support.widget.CustomCheckboxWidget; import java.util.ArrayList; import java.util.List; @@ -17,8 +17,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public abstract class AbstractSecurityCardScreen extends AbstractStretchingScreen { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/BuiltinPermission.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/BuiltinPermission.java new file mode 100644 index 000000000..9fb09b55c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/BuiltinPermission.java @@ -0,0 +1,71 @@ +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.content.ContentNames; + +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public enum BuiltinPermission implements PlatformPermission { + /** + * Whether the player can insert resources into a network. + */ + INSERT("insert"), + /** + * Whether the player can extract resources from a network. + */ + EXTRACT("extract"), + /** + * Whether the player can start, cancel or view an autocrafting task. + */ + AUTOCRAFTING("autocrafting"), + /** + * Whether the player can open network device GUIs. + */ + OPEN("open"), + /** + * Whether the player can add or remove network devices. + */ + BUILD("build"), + /** + * Whether the player can manage the security options for a network. + */ + SECURITY("security"); + + private final ResourceLocation id; + private final Component name; + private final Component description; + + BuiltinPermission(final String id) { + this.id = createIdentifier(id); + this.name = createTranslation("permission", id); + this.description = createTranslation("permission", id + ".description"); + } + + public ResourceLocation getId() { + return id; + } + + @Override + public Component getName() { + return name; + } + + @Override + public Component getDescription() { + return description; + } + + @Override + public Component getOwnerName() { + return ContentNames.MOD; + } + + @Override + public boolean isAllowedByDefault() { + return true; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardContainerMenu.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardContainerMenu.java index 436114180..a7756c8a9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardContainerMenu.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.Menus; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.Menus; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardExtendedMenuProvider.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardExtendedMenuProvider.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardExtendedMenuProvider.java index bd8270107..6559f4408 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardExtendedMenuProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardExtendedMenuProvider.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.ContentNames; import java.util.Set; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardItem.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardItem.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardItem.java index dcb4dcb8a..05d452800 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardItem.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import com.refinedmods.refinedstorage.api.network.security.SecurityActor; import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.Platform; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; import java.util.Optional; import java.util.Set; @@ -16,7 +16,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class FallbackSecurityCardItem extends AbstractSecurityCardItem { private static final Component HELP = createTranslation("item", "fallback_security_card.help"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardScreen.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardScreen.java index 5453190a2..45cd51f2b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardScreen.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/PlatformSecurityNetworkComponentImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/PlatformSecurityNetworkComponentImpl.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/PlatformSecurityNetworkComponentImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/PlatformSecurityNetworkComponentImpl.java index 9eb55463d..ef962bb51 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/PlatformSecurityNetworkComponentImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/PlatformSecurityNetworkComponentImpl.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import com.refinedmods.refinedstorage.api.network.impl.security.SecurityNetworkComponentImpl; import com.refinedmods.refinedstorage.api.network.security.Permission; import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.platform.api.security.PlatformSecurityNetworkComponent; +import com.refinedmods.refinedstorage.common.api.security.PlatformSecurityNetworkComponent; import com.mojang.authlib.GameProfile; import net.minecraft.server.MinecraftServer; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/PlayerBoundSecurityCardData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/PlayerBoundSecurityCardData.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/PlayerBoundSecurityCardData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/PlayerBoundSecurityCardData.java index e01a774fb..1f6dd235a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/PlayerBoundSecurityCardData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/PlayerBoundSecurityCardData.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/PlayerSecurityActor.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/PlayerSecurityActor.java new file mode 100644 index 000000000..8e2086b70 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/PlayerSecurityActor.java @@ -0,0 +1,8 @@ +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.api.network.security.SecurityActor; + +import java.util.UUID; + +public record PlayerSecurityActor(UUID playerId) implements SecurityActor { +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardBoundPlayer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardBoundPlayer.java similarity index 95% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardBoundPlayer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardBoundPlayer.java index 448731dd0..439ce4ae2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardBoundPlayer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardBoundPlayer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import java.util.UUID; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardContainerMenu.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardContainerMenu.java index a16f66548..67122220e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardContainerMenu.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; -import com.refinedmods.refinedstorage.platform.common.support.stretching.ScreenSizeListener; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; +import com.refinedmods.refinedstorage.common.support.stretching.ScreenSizeListener; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardData.java new file mode 100644 index 000000000..4ec823502 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardData.java @@ -0,0 +1,32 @@ +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; + +public record SecurityCardData(SlotReference slotReference, List permissions) { + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + SlotReferenceFactory.STREAM_CODEC, SecurityCardData::slotReference, + ByteBufCodecs.collection( + ArrayList::new, + StreamCodec.composite( + RefinedStorageApi.INSTANCE.getPermissionRegistry().streamCodec(), Permission::permission, + ByteBufCodecs.BOOL, Permission::allowed, + ByteBufCodecs.BOOL, Permission::dirty, + Permission::new + ) + ), SecurityCardData::permissions, + SecurityCardData::new + ); + + record Permission(PlatformPermission permission, boolean allowed, boolean dirty) { + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardExtendedMenuProvider.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardExtendedMenuProvider.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardExtendedMenuProvider.java index 04800ccca..20c98b8a3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardExtendedMenuProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardExtendedMenuProvider.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.ContentNames; import java.util.Set; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItem.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItem.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItem.java index b0de34657..2feabe88b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItem.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import com.refinedmods.refinedstorage.api.network.security.SecurityActor; import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.DataComponents; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.DataComponents; import java.util.List; import java.util.Optional; @@ -25,7 +25,7 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; import static java.util.Objects.requireNonNull; public class SecurityCardItem extends AbstractSecurityCardItem { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItemPropertyFunction.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItemPropertyFunction.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItemPropertyFunction.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItemPropertyFunction.java index 27ed5fe87..3ae9aa49b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItemPropertyFunction.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItemPropertyFunction.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import javax.annotation.Nullable; @@ -8,7 +8,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class SecurityCardItemPropertyFunction implements ClampedItemPropertyFunction { public static final ResourceLocation NAME = createIdentifier("security_card_active"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardPermissions.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardPermissions.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardPermissions.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardPermissions.java index 8285fc94f..26143f3fa 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardPermissions.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardPermissions.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; import java.util.Collections; import java.util.HashMap; @@ -16,7 +16,7 @@ public record SecurityCardPermissions(Map permissio public static final SecurityCardPermissions EMPTY = new SecurityCardPermissions(Collections.emptyMap()); public static final Codec CODEC = Codec.unboundedMap( - PlatformApi.INSTANCE.getPermissionRegistry().codec(), + RefinedStorageApi.INSTANCE.getPermissionRegistry().codec(), Codec.BOOL ).xmap(SecurityCardPermissions::new, SecurityCardPermissions::permissions); @@ -24,7 +24,7 @@ public record SecurityCardPermissions(Map permissio .composite( ByteBufCodecs.map( HashMap::new, - PlatformApi.INSTANCE.getPermissionRegistry().streamCodec(), + RefinedStorageApi.INSTANCE.getPermissionRegistry().streamCodec(), ByteBufCodecs.BOOL ), SecurityCardPermissions::permissions, SecurityCardPermissions::new diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardScreen.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardScreen.java index 67ddaf511..6cbb6fef1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardScreen.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.security; +package com.refinedmods.refinedstorage.common.security; import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.Component; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlock.java new file mode 100644 index 000000000..ab5646f33 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlock.java @@ -0,0 +1,75 @@ +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractActiveColoredDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage.common.support.direction.HorizontalDirection; +import com.refinedmods.refinedstorage.common.support.direction.HorizontalDirectionType; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class SecurityManagerBlock + extends AbstractActiveColoredDirectionalBlock + implements BlockItemProvider, EntityBlock { + private static final MutableComponent HELP = createTranslation("block", "security_manager.help"); + private static final AbstractBlockEntityTicker TICKER = + new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getSecurityManager, ACTIVE); + + public SecurityManagerBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES, color, name); + } + + @Override + protected DirectionType getDirectionType() { + return HorizontalDirectionType.INSTANCE; + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getSecurityManager(); + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new SecurityManagerBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + public boolean canAlwaysConnect() { + return true; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlockEntity.java new file mode 100644 index 000000000..0efa12921 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlockEntity.java @@ -0,0 +1,181 @@ +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode; +import com.refinedmods.refinedstorage.api.network.impl.security.SecurityDecisionProviderImpl; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.security.SecurityHelper; +import com.refinedmods.refinedstorage.common.api.security.SecurityPolicyContainerItem; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage.common.support.FilteredContainer; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeContainerProviderImpl; +import com.refinedmods.refinedstorage.common.util.ContainerUtil; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.NonNullList; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.BlockState; + +public class SecurityManagerBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity + implements BlockEntityWithDrops, NetworkNodeMenuProvider { + static final int CARD_AMOUNT = 18; + + private static final String TAG_SECURITY_CARDS = "sc"; + private static final String TAG_FALLBACK_SECURITY_CARD = "fsc"; + + private final FilteredContainer securityCards = new FilteredContainer( + CARD_AMOUNT, + SecurityManagerBlockEntity::isValidSecurityCard + ); + private final FilteredContainer fallbackSecurityCard = new FilteredContainer( + 1, + SecurityManagerBlockEntity::isValidFallbackSecurityCard + ); + + private final SecurityDecisionProviderImpl securityDecisionProvider = new SecurityDecisionProviderImpl(); + + public SecurityManagerBlockEntity(final BlockPos pos, final BlockState state) { + super( + BlockEntities.INSTANCE.getSecurityManager(), + pos, + state, + new SecurityDecisionProviderProxyNetworkNode( + Platform.INSTANCE.getConfig().getSecurityManager().getEnergyUsage() + ) + ); + securityCards.addListener(card -> invalidate()); + fallbackSecurityCard.addListener(card -> invalidate()); + mainNetworkNode.setDelegate(securityDecisionProvider); + } + + @Override + protected NetworkNodeContainerProvider createContainerProvider() { + return new NetworkNodeContainerProviderImpl() { + @Override + public boolean canBuild(final ServerPlayer player) { + return super.canBuild(player) || isPlacedBy(player.getGameProfile().getId()); + } + }; + } + + @Override + protected InWorldNetworkNodeContainer createMainContainer( + final SecurityDecisionProviderProxyNetworkNode networkNode) { + return RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, networkNode) + .connectionStrategy(new SecurityManagerConnectionStrategy(this::getBlockState, getBlockPos())) + .build(); + } + + private void invalidate() { + if (level != null) { + setChanged(); + } + securityDecisionProvider.clearPolicies(); + long energyUsage = Platform.INSTANCE.getConfig().getSecurityManager().getEnergyUsage(); + for (int i = 0; i < securityCards.getContainerSize(); ++i) { + final ItemStack securityCard = securityCards.getItem(i); + if (!(securityCard.getItem() instanceof SecurityPolicyContainerItem securityPolicyContainerItem)) { + continue; + } + energyUsage += securityPolicyContainerItem.getEnergyUsage(); + securityPolicyContainerItem.getPolicy(securityCard).ifPresent( + policy -> securityPolicyContainerItem.getActor(securityCard).ifPresent( + actor -> securityDecisionProvider.setPolicy(actor, policy))); + } + energyUsage += updateDefaultPolicyAndGetEnergyUsage(); + mainNetworkNode.setEnergyUsage(energyUsage); + } + + private long updateDefaultPolicyAndGetEnergyUsage() { + final ItemStack fallbackSecurityCardStack = fallbackSecurityCard.getItem(0); + if (fallbackSecurityCardStack.getItem() instanceof SecurityPolicyContainerItem securityPolicyContainerItem) { + securityPolicyContainerItem.getPolicy(fallbackSecurityCardStack).ifPresentOrElse( + securityDecisionProvider::setDefaultPolicy, + () -> securityDecisionProvider.setDefaultPolicy(null) + ); + return securityPolicyContainerItem.getEnergyUsage(); + } + securityDecisionProvider.setDefaultPolicy(null); + return 0; + } + + @Override + public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { + if (tag.contains(TAG_SECURITY_CARDS)) { + ContainerUtil.read(tag.getCompound(TAG_SECURITY_CARDS), securityCards, provider); + } + if (tag.contains(TAG_FALLBACK_SECURITY_CARD)) { + ContainerUtil.read(tag.getCompound(TAG_FALLBACK_SECURITY_CARD), fallbackSecurityCard, provider); + } + super.loadAdditional(tag, provider); + } + + @Override + public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { + super.saveAdditional(tag, provider); + tag.put(TAG_SECURITY_CARDS, ContainerUtil.write(securityCards, provider)); + tag.put(TAG_FALLBACK_SECURITY_CARD, ContainerUtil.write(fallbackSecurityCard, provider)); + } + + @Override + public NonNullList getDrops() { + final NonNullList drops = NonNullList.create(); + for (int i = 0; i < securityCards.getContainerSize(); ++i) { + drops.add(securityCards.getItem(i)); + } + drops.add(fallbackSecurityCard.getItem(0)); + return drops; + } + + FilteredContainer getSecurityCards() { + return securityCards; + } + + FilteredContainer getFallbackSecurityCard() { + return fallbackSecurityCard; + } + + static boolean isValidSecurityCard(final ItemStack stack) { + return stack.getItem() instanceof SecurityPolicyContainerItem securityPolicyContainerItem + && securityPolicyContainerItem.isValid(stack) + && !(stack.getItem() instanceof FallbackSecurityCardItem); + } + + static boolean isValidFallbackSecurityCard(final ItemStack stack) { + return stack.getItem() instanceof FallbackSecurityCardItem; + } + + @Override + public Component getDisplayName() { + return ContentNames.SECURITY_MANAGER; + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new SecurityManagerContainerMenu(syncId, inventory, this); + } + + @Override + public boolean canOpen(final ServerPlayer player) { + final boolean isAllowedViaSecuritySystem = NetworkNodeMenuProvider.super.canOpen(player) + && SecurityHelper.isAllowed(player, BuiltinPermission.SECURITY, containers.getContainers()); + return isAllowedViaSecuritySystem || isPlacedBy(player.getGameProfile().getId()); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerConnectionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerConnectionStrategy.java new file mode 100644 index 000000000..ff3c70486 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerConnectionStrategy.java @@ -0,0 +1,34 @@ +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage.common.support.network.ColoredConnectionStrategy; + +import java.util.function.Supplier; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; + +class SecurityManagerConnectionStrategy extends ColoredConnectionStrategy { + SecurityManagerConnectionStrategy(final Supplier blockStateProvider, final BlockPos origin) { + super(blockStateProvider, origin); + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + for (final Direction direction : Direction.values()) { + if (direction == Direction.UP) { + continue; + } + sink.tryConnectInSameDimension(origin.relative(direction), direction.getOpposite()); + } + } + + @Override + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + if (!colorsAllowConnecting(connectingState)) { + return false; + } + return incomingDirection != Direction.UP; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerContainerMenu.java new file mode 100644 index 000000000..cd194ec04 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerContainerMenu.java @@ -0,0 +1,71 @@ +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage.common.support.FilteredContainer; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.ValidatedSlot; + +import javax.annotation.Nullable; + +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.inventory.Slot; + +public class SecurityManagerContainerMenu extends AbstractBaseContainerMenu { + @Nullable + private Slot fallbackSecurityCardSlot; + + public SecurityManagerContainerMenu(final int syncId, final Inventory playerInventory) { + super(Menus.INSTANCE.getSecurityManager(), syncId); + addSlots( + playerInventory, + new FilteredContainer(SecurityManagerBlockEntity.CARD_AMOUNT, + SecurityManagerBlockEntity::isValidSecurityCard), + new FilteredContainer(1, SecurityManagerBlockEntity::isValidFallbackSecurityCard) + ); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + } + + SecurityManagerContainerMenu(final int syncId, + final Inventory playerInventory, + final SecurityManagerBlockEntity securityManager) { + super(Menus.INSTANCE.getSecurityManager(), syncId); + addSlots(playerInventory, securityManager.getSecurityCards(), securityManager.getFallbackSecurityCard()); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + securityManager::getRedstoneMode, + securityManager::setRedstoneMode + )); + } + + private void addSlots(final Inventory playerInventory, + final FilteredContainer securityCards, + final FilteredContainer fallbackSecurityCard) { + for (int i = 0; i < SecurityManagerBlockEntity.CARD_AMOUNT; ++i) { + final int column = i % 9; + final int x = 8 + (column * 18); + final int row = i / 9; + final int y = 20 + (row * 18); + addSlot(new ValidatedSlot(securityCards, i, x, y, SecurityManagerBlockEntity::isValidSecurityCard)); + } + fallbackSecurityCardSlot = new ValidatedSlot( + fallbackSecurityCard, + 0, + 174, + 20, + SecurityManagerBlockEntity::isValidFallbackSecurityCard + ); + addSlot(fallbackSecurityCardSlot); + addPlayerInventory(playerInventory, 8, 72); + transferManager.addBiTransfer(playerInventory, securityCards); + transferManager.addBiTransfer(playerInventory, fallbackSecurityCard); + } + + @Nullable + Slot getFallbackSecurityCardSlot() { + return fallbackSecurityCardSlot; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerScreen.java new file mode 100644 index 000000000..e51363359 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerScreen.java @@ -0,0 +1,61 @@ +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.tooltip.HelpClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; + +import java.util.List; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class SecurityManagerScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/security_manager.png"); + + public SecurityManagerScreen(final SecurityManagerContainerMenu menu, + final Inventory playerInventory, + final Component text) { + super(menu, playerInventory, text); + this.inventoryLabelY = 59; + this.imageWidth = 197; + this.imageHeight = 154; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.REDSTONE_MODE), + createTranslation("gui", "security_manager.redstone_mode_help") + )); + } + + @Override + protected void renderTooltip(final GuiGraphics graphics, final int x, final int y) { + if (hoveredSlot != null && hoveredSlot == menu.getFallbackSecurityCardSlot() && !hoveredSlot.hasItem()) { + Platform.INSTANCE.renderTooltip(graphics, List.of( + ClientTooltipComponent.create( + createTranslation("gui", "security_manager.fallback_security_card_slot_hint").getVisualOrderText() + ), + HelpClientTooltipComponent.create( + createTranslation("gui", "security_manager.no_fallback_security_card_consequence") + ) + ), x, y); + return; + } + super.renderTooltip(graphics, x, y); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/package-info.java new file mode 100644 index 000000000..986655370 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.security; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractDiskContainerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractDiskContainerBlockEntity.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractDiskContainerBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractDiskContainerBlockEntity.java index 317562c9d..d56946f89 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractDiskContainerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractDiskContainerBlockEntity.java @@ -1,17 +1,17 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractStorageContainerNetworkNode; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.BlockEntityWithDrops; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.FilteredContainer; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage.platform.common.util.ContainerUtil; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.FilteredContainer; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.util.ContainerUtil; import java.util.Set; import java.util.function.UnaryOperator; @@ -51,17 +51,22 @@ protected AbstractDiskContainerBlockEntity(final BlockEntityType type, final BlockState state, final T node) { super(type, pos, state, node); - this.diskInventory = new DiskInventory((inventory, slot) -> onDiskChanged(slot), mainNode.getSize()); + this.diskInventory = new DiskInventory((inventory, slot) -> onDiskChanged(slot), mainNetworkNode.getSize()); this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters( ResourceContainerImpl.createForFilter(), this::setChanged, this::setFilters ); - this.mainNode.setListener(diskStateListener); + this.mainNetworkNode.setListener(diskStateListener); setNormalizer(filter.createNormalizer()); + } + + @Override + protected void containerInitialized() { + super.containerInitialized(); // It's important to sync here as the initial update packet might have failed as the network // could possibly be not initialized yet. - this.initializationCallback = diskStateListener::immediateUpdate; + diskStateListener.immediateUpdate(); } protected abstract void setFilters(Set filters); @@ -113,8 +118,8 @@ public void setChanged() { } private void initialize(final Level level) { - diskInventory.setStorageRepository(PlatformApi.INSTANCE.getStorageRepository(level)); - mainNode.setProvider(diskInventory); + diskInventory.setStorageRepository(RefinedStorageApi.INSTANCE.getStorageRepository(level)); + mainNetworkNode.setProvider(diskInventory); } @Override @@ -158,11 +163,11 @@ private void onDiskChanged(final int slot) { // Level will not yet be present final boolean isJustPlacedIntoLevelOrLoading = level == null || level.isClientSide(); // Level will be present, but network not yet - final boolean isPlacedThroughDismantlingMode = mainNode.getNetwork() == null; + final boolean isPlacedThroughDismantlingMode = mainNetworkNode.getNetwork() == null; if (isJustPlacedIntoLevelOrLoading || isPlacedThroughDismantlingMode) { return; } - mainNode.onStorageChanged(slot); + mainNetworkNode.onStorageChanged(slot); diskStateListener.immediateUpdate(); setChanged(); } @@ -188,10 +193,10 @@ public Packet getUpdatePacket() { public CompoundTag getUpdateTag(final HolderLookup.Provider provider) { final CompoundTag tag = new CompoundTag(); // This null check is important. #getUpdateTag() can be called before the node's network is initialized! - if (mainNode.getNetwork() == null) { + if (mainNetworkNode.getNetwork() == null) { return tag; } - tag.put(TAG_DISKS, diskInventory.toSyncTag(mainNode::getState)); + tag.put(TAG_DISKS, diskInventory.toSyncTag(mainNetworkNode::getState)); return tag; } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractProgressStorageScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractProgressStorageScreen.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractProgressStorageScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractProgressStorageScreen.java index 27305545f..ab13cec1c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractProgressStorageScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractProgressStorageScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; -import com.refinedmods.refinedstorage.platform.common.support.widget.ProgressWidget; +import com.refinedmods.refinedstorage.common.support.widget.ProgressWidget; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractStorageContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageContainerMenu.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractStorageContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageContainerMenu.java index 9403de774..e1a01a0b8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractStorageContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageContainerMenu.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.AccessMode; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.MenuType; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractStorageScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractStorageScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java index 4e47d7910..3ea7a7ea6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AbstractStorageScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java @@ -1,17 +1,17 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; import javax.annotation.Nullable; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public abstract class AbstractStorageScreen extends AbstractBaseScreen { private static final Component ALLOW_FILTER_MODE_HELP = createTranslation("gui", "storage.filter_mode.allow.help"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AccessModeSettings.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSettings.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AccessModeSettings.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSettings.java index bcfcecc41..6e481c012 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AccessModeSettings.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSettings.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.storage.AccessMode; @@ -12,7 +12,6 @@ private AccessModeSettings() { public static AccessMode getAccessMode(final int accessMode) { return switch (accessMode) { - case INSERT_EXTRACT -> AccessMode.INSERT_EXTRACT; case INSERT -> AccessMode.INSERT; case EXTRACT -> AccessMode.EXTRACT; default -> AccessMode.INSERT_EXTRACT; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AccessModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSideButtonWidget.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AccessModeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSideButtonWidget.java index 450550cfd..3692dde22 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/AccessModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSideButtonWidget.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.storage.AccessMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class AccessModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "access_mode"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/BucketPlayerInventoryInsertableStorage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/BucketPlayerInventoryInsertableStorage.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/BucketPlayerInventoryInsertableStorage.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/BucketPlayerInventoryInsertableStorage.java index febd4abd6..48fab8ce3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/BucketPlayerInventoryInsertableStorage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/BucketPlayerInventoryInsertableStorage.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; @@ -37,7 +37,7 @@ public long insert(final ResourceKey resource, final long amount, final Action a if (amount != Platform.INSTANCE.getBucketAmount()) { return 0; } - return Platform.INSTANCE.convertToBucket(fluidResource).map( + return Platform.INSTANCE.getFilledBucket(fluidResource).map( filledBucketStack -> insert(filledBucketStack, amount, action, actor) ).orElse(0L); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/ClientStorageRepository.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepository.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/ClientStorageRepository.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepository.java index 9bf3eba78..5eaf0826d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/ClientStorageRepository.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepository.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.core.CoreValidations; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/Disk.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/Disk.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/Disk.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/Disk.java index e42f6cab7..7ed682445 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/Disk.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/Disk.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.storage.StorageState; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/DiskContainerBlockEntityTicker.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/DiskContainerBlockEntityTicker.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/DiskContainerBlockEntityTicker.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/DiskContainerBlockEntityTicker.java index afb35e97b..3bf70a0b6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/DiskContainerBlockEntityTicker.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/DiskContainerBlockEntityTicker.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractStorageContainerNetworkNode; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/DiskInventory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/DiskInventory.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/DiskInventory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/DiskInventory.java index 991515b3f..fd32dd4ca 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/DiskInventory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/DiskInventory.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractStorageContainerNetworkNode; import com.refinedmods.refinedstorage.api.storage.Storage; import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItem; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.common.support.FilteredContainer; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItem; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.support.FilteredContainer; import java.util.Optional; import java.util.function.IntFunction; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/DiskStateChangeListener.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/DiskStateChangeListener.java similarity index 95% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/DiskStateChangeListener.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/DiskStateChangeListener.java index 3e2cc9dc7..2661a9c43 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/DiskStateChangeListener.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/DiskStateChangeListener.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/FilterModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FilterModeSideButtonWidget.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/FilterModeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FilterModeSideButtonWidget.java index b85acaf6e..c67ebc4ae 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/FilterModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FilterModeSideButtonWidget.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class FilterModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "filter_mode"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FluidStorageVariant.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FluidStorageVariant.java new file mode 100644 index 000000000..91b7698b0 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FluidStorageVariant.java @@ -0,0 +1,43 @@ +package com.refinedmods.refinedstorage.common.storage; + +import com.refinedmods.refinedstorage.common.Platform; + +import javax.annotation.Nullable; + +public enum FluidStorageVariant { + SIXTY_FOUR_B("64b", 64L), + TWO_HUNDRED_FIFTY_SIX_B("256b", 256L), + THOUSAND_TWENTY_FOUR_B("1024b", 1024L), + FOUR_THOUSAND_NINETY_SIX_B("4096b", 4096L), + CREATIVE("creative", null); + + private final String name; + @Nullable + private final Long capacityInBuckets; + + FluidStorageVariant(final String name, @Nullable final Long capacityInBuckets) { + this.name = name; + this.capacityInBuckets = capacityInBuckets; + } + + public String getName() { + return name; + } + + @Nullable + public Long getCapacityInBuckets() { + return capacityInBuckets; + } + + @Nullable + public Long getCapacity() { + if (capacityInBuckets == null) { + return null; + } + return capacityInBuckets * Platform.INSTANCE.getBucketAmount(); + } + + public boolean hasCapacity() { + return capacityInBuckets != null; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ItemStorageVariant.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ItemStorageVariant.java new file mode 100644 index 000000000..ae0d5a8b1 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ItemStorageVariant.java @@ -0,0 +1,33 @@ +package com.refinedmods.refinedstorage.common.storage; + +import javax.annotation.Nullable; + +public enum ItemStorageVariant { + ONE_K("1k", 1024L), + FOUR_K("4k", 1024 * 4L), + SIXTEEN_K("16k", 1024 * 4 * 4L), + SIXTY_FOUR_K("64k", 1024 * 4 * 4 * 4L), + CREATIVE("creative", null); + + private final String name; + @Nullable + private final Long capacity; + + ItemStorageVariant(final String name, @Nullable final Long capacity) { + this.name = name; + this.capacity = capacity; + } + + public String getName() { + return name; + } + + @Nullable + public Long getCapacity() { + return capacity; + } + + public boolean hasCapacity() { + return capacity != null; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/LimitedPlatformStorage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/LimitedPlatformStorage.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/LimitedPlatformStorage.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/LimitedPlatformStorage.java index f2c6e92b1..f5f3ce565 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/LimitedPlatformStorage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/LimitedPlatformStorage.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorage; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageRepository; -import com.refinedmods.refinedstorage.platform.api.storage.StorageType; +import com.refinedmods.refinedstorage.common.api.storage.StorageType; class LimitedPlatformStorage extends PlatformStorage implements LimitedStorage { private final LimitedStorageImpl limitedStorage; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/PlatformStorage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PlatformStorage.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/PlatformStorage.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PlatformStorage.java index 380b88bdd..c2d86433f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/PlatformStorage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PlatformStorage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceKey; @@ -9,9 +9,9 @@ import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorage; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageRepository; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageType; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageType; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/PrioritySideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PrioritySideButtonWidget.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/PrioritySideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PrioritySideButtonWidget.java index a6d6ad780..b8be92e20 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/PrioritySideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PrioritySideButtonWidget.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; -import com.refinedmods.refinedstorage.platform.common.support.amount.PriorityScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.amount.PriorityScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.Screen; @@ -10,7 +10,7 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.entity.player.Inventory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class PrioritySideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "priority"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/SameTypeStorageType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/SameTypeStorageType.java new file mode 100644 index 000000000..f571efe2a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/SameTypeStorageType.java @@ -0,0 +1,78 @@ +package com.refinedmods.refinedstorage.common.storage; + +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; +import com.refinedmods.refinedstorage.api.storage.tracked.InMemoryTrackedStorageRepository; +import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl; +import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageRepository; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageType; + +import java.util.function.Function; +import java.util.function.Predicate; +import javax.annotation.Nullable; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; + +public class SameTypeStorageType implements StorageType { + private final Codec codec; + private final Predicate valid; + private final Function caster; + private final long diskInterfaceTransferQuota; + private final long diskInterfaceTransferQuotaWithStackUpgrade; + + public SameTypeStorageType(final Codec codec, + final Predicate valid, + final Function caster, + final long diskInterfaceTransferQuota, + final long diskInterfaceTransferQuotaWithStackUpgrade) { + this.codec = codec; + this.valid = valid; + this.caster = caster; + this.diskInterfaceTransferQuota = diskInterfaceTransferQuota; + this.diskInterfaceTransferQuotaWithStackUpgrade = diskInterfaceTransferQuotaWithStackUpgrade; + } + + @Override + public SerializableStorage create(@Nullable final Long capacity, final Runnable listener) { + return createStorage(StorageCodecs.StorageData.empty(capacity), listener); + } + + @Override + public MapCodec getMapCodec(final Runnable listener) { + return StorageCodecs.sameTypeStorageData(codec).xmap( + storageData -> createStorage(storageData, listener), + storage -> StorageCodecs.StorageData.ofSameTypeStorage(storage, valid, caster) + ); + } + + @Override + public boolean isAllowed(final ResourceKey resource) { + return valid.test(resource); + } + + @Override + public long getDiskInterfaceTransferQuota(final boolean stackUpgrade) { + if (stackUpgrade) { + return diskInterfaceTransferQuotaWithStackUpgrade; + } + return diskInterfaceTransferQuota; + } + + private SerializableStorage createStorage(final StorageCodecs.StorageData data, final Runnable listener) { + final TrackedStorageRepository trackingRepository = new InMemoryTrackedStorageRepository(); + final TrackedStorageImpl tracked = new TrackedStorageImpl( + new InMemoryStorageImpl(), + trackingRepository, + System::currentTimeMillis + ); + final PlatformStorage storage = data.capacity().map(capacity -> { + final LimitedStorageImpl limited = new LimitedStorageImpl(tracked, capacity); + return (PlatformStorage) new LimitedPlatformStorage(limited, this, trackingRepository, listener); + }).orElseGet(() -> new PlatformStorage(tracked, this, trackingRepository, listener)); + data.resources().forEach(storage::load); + return storage; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageAccessor.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageAccessor.java new file mode 100644 index 000000000..4e13b411e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageAccessor.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage.common.storage; + +public interface StorageAccessor { + long getStored(); + + long getCapacity(); + + double getProgress(); + + boolean hasCapacity(); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageCodecs.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageCodecs.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageCodecs.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageCodecs.java index 217938b6e..9ec837f8f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageCodecs.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageCodecs.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; @@ -6,7 +6,7 @@ import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorage; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorage; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; import java.util.List; import java.util.Optional; @@ -40,7 +40,7 @@ public final class StorageCodecs { private StorageCodecs() { } - static MapCodec> homogeneousStorageData(final Codec resourceCodec) { + static MapCodec> sameTypeStorageData(final Codec resourceCodec) { final Codec> storageResourceCodec = RecordCodecBuilder.create(instance -> instance.group( resourceCodec.fieldOf("resource").forGetter(StorageResource::resource), Codec.LONG.fieldOf("amount").forGetter(StorageResource::amount), @@ -58,7 +58,7 @@ static StorageData empty(@Nullable final Long capacit return new StorageData<>(Optional.ofNullable(capacity), List.of()); } - static StorageData ofHomogeneousStorage( + static StorageData ofSameTypeStorage( final Storage storage, final Predicate valid, final Function caster diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageConfigurationContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageConfigurationContainer.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageConfigurationContainer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageConfigurationContainer.java index 7abf7a563..1ddf6fa8f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageConfigurationContainer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageConfigurationContainer.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.AccessMode; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; public interface StorageConfigurationContainer { int getPriority(); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageConfigurationContainerImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageConfigurationContainerImpl.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageConfigurationContainerImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageConfigurationContainerImpl.java index 6f3788250..e544a6ba0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageConfigurationContainerImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageConfigurationContainerImpl.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.network.impl.storage.StorageConfiguration; import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.AccessMode; -import com.refinedmods.refinedstorage.platform.common.support.FilterModeSettings; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; import java.util.function.Consumer; import java.util.function.Supplier; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageContainerItemHelperImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerItemHelperImpl.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageContainerItemHelperImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerItemHelperImpl.java index a073710b0..891288483 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageContainerItemHelperImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerItemHelperImpl.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageBlockEntity; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItemHelper; -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.common.content.DataComponents; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageBlockEntity; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItemHelper; +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.content.DataComponents; import java.util.Collections; import java.util.HashMap; @@ -81,7 +81,7 @@ public InteractionResultHolder tryDisassembly(final Level level, } return storageId - .flatMap(id -> PlatformApi.INSTANCE.getStorageRepository(level).removeIfEmpty(id)) + .flatMap(id -> RefinedStorageApi.INSTANCE.getStorageRepository(level).removeIfEmpty(id)) .map(disk -> returnByproducts(level, player, primaryByproduct, secondaryByproduct)) .orElseGet(() -> InteractionResultHolder.fail(stack)); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StoragePropertyTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StoragePropertyTypes.java new file mode 100644 index 000000000..a388d1c6e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StoragePropertyTypes.java @@ -0,0 +1,26 @@ +package com.refinedmods.refinedstorage.common.storage; + +import com.refinedmods.refinedstorage.api.storage.AccessMode; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyType; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public final class StoragePropertyTypes { + public static final PropertyType PRIORITY = PropertyTypes.createIntegerProperty( + createIdentifier("priority") + ); + + public static final PropertyType ACCESS_MODE = new PropertyType<>( + createIdentifier("access_mode"), + AccessModeSettings::getAccessMode, + AccessModeSettings::getAccessMode + ); + + public static final PropertyType VOID_EXCESS = PropertyTypes.createBooleanProperty( + createIdentifier("void_excess") + ); + + private StoragePropertyTypes() { + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageRepositoryImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageRepositoryImpl.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageRepositoryImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageRepositoryImpl.java index 9cfb1055d..5a1d50769 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageRepositoryImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageRepositoryImpl.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.core.CoreValidations; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.common.support.AbstractSafeSavedData; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.support.AbstractPlatformSavedData; import java.util.HashMap; import java.util.Map; @@ -17,7 +17,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.NbtOps; -public class StorageRepositoryImpl extends AbstractSafeSavedData implements StorageRepository { +public class StorageRepositoryImpl extends AbstractPlatformSavedData implements StorageRepository { public static final String NAME = "refinedstorage_storages"; private final Codec> codec = Codec.unboundedMap( diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageTooltipHelper.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageTooltipHelper.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageTooltipHelper.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageTooltipHelper.java index 7b7041aef..32b0277f7 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageTooltipHelper.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageTooltipHelper.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; import java.util.List; import java.util.function.LongFunction; @@ -6,7 +6,7 @@ import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; final class StorageTooltipHelper { private StorageTooltipHelper() { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageTypes.java new file mode 100644 index 000000000..e3f0deb8c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageTypes.java @@ -0,0 +1,27 @@ +package com.refinedmods.refinedstorage.common.storage; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.storage.StorageType; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; + +public final class StorageTypes { + public static final StorageType ITEM = new SameTypeStorageType<>( + ResourceCodecs.ITEM_CODEC, + ItemResource.class::isInstance, + ItemResource.class::cast, + 1, + 64 + ); + public static final StorageType FLUID = new SameTypeStorageType<>( + ResourceCodecs.FLUID_CODEC, + FluidResource.class::isInstance, + FluidResource.class::cast, + Platform.INSTANCE.getBucketAmount(), + Platform.INSTANCE.getBucketAmount() * 16 + ); + + private StorageTypes() { + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/VoidExcessSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/VoidExcessSideButtonWidget.java new file mode 100644 index 000000000..20a3174b6 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/VoidExcessSideButtonWidget.java @@ -0,0 +1,46 @@ +package com.refinedmods.refinedstorage.common.storage; + +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractYesNoSideButtonWidget; + +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class VoidExcessSideButtonWidget extends AbstractYesNoSideButtonWidget { + private static final Component HELP = createTranslation("gui", "void_excess.help"); + private static final Component ALLOWLIST_WARNING = createTranslation( + "gui", + "void_excess.allowlist_warning" + ); + + public VoidExcessSideButtonWidget(final ClientProperty property) { + super(property, createTranslation("gui", "void_excess")); + } + + public void setWarningVisible(final boolean visible) { + if (visible) { + setWarning(ALLOWLIST_WARNING); + } else { + setWarning(null); + } + } + + @Override + protected int getXTexture() { + return Boolean.TRUE.equals(property.getValue()) ? 16 : 0; + } + + @Override + protected int getYTexture() { + return 240 - 15; + } + + @Override + @Nullable + protected Component getHelpText() { + return HELP; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java index 9a8f940e2..d315ff0e7 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskdrive; +package com.refinedmods.refinedstorage.common.storage.diskdrive; import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.storage.AbstractDiskContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.StorageConfigurationContainerImpl; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.storage.AbstractDiskContainerBlockEntity; +import com.refinedmods.refinedstorage.common.storage.StorageConfigurationContainerImpl; import java.util.Set; import java.util.function.UnaryOperator; @@ -32,7 +32,7 @@ protected AbstractDiskDriveBlockEntity(final BlockPos pos, final BlockState stat AMOUNT_OF_DISKS )); this.configContainer = new StorageConfigurationContainerImpl( - mainNode.getStorageConfiguration(), + mainNetworkNode.getStorageConfiguration(), filter, this::setChanged, this::getRedstoneMode, @@ -42,12 +42,12 @@ protected AbstractDiskDriveBlockEntity(final BlockPos pos, final BlockState stat @Override protected void setFilters(final Set filters) { - mainNode.getStorageConfiguration().setFilters(filters); + mainNetworkNode.getStorageConfiguration().setFilters(filters); } @Override protected void setNormalizer(final UnaryOperator normalizer) { - mainNode.getStorageConfiguration().setNormalizer(normalizer); + mainNetworkNode.getStorageConfiguration().setNormalizer(normalizer); } @Override diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java index edf5fdb2c..2b4c58cc0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskdrive; +package com.refinedmods.refinedstorage.common.storage.diskdrive; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.render.AbstractDiskLedBlockEntityRenderer; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.render.AbstractDiskLedBlockEntityRenderer; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/DiskDriveBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/DiskDriveBlock.java new file mode 100644 index 000000000..cbf567f88 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/DiskDriveBlock.java @@ -0,0 +1,59 @@ +package com.refinedmods.refinedstorage.common.storage.diskdrive; + +import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.storage.DiskContainerBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.direction.BiDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; + +import java.util.function.BiFunction; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class DiskDriveBlock extends AbstractDirectionalBlock implements EntityBlock { + private static final Component HELP = createTranslation("item", "disk_drive.help"); + private static final DiskContainerBlockEntityTicker TICKER = + new DiskContainerBlockEntityTicker<>(BlockEntities.INSTANCE::getDiskDrive); + + private final BiFunction blockEntityFactory; + + public DiskDriveBlock(final BiFunction blockEntityFactory) { + super(BlockConstants.PROPERTIES); + this.blockEntityFactory = blockEntityFactory; + } + + @Override + protected DirectionType getDirectionType() { + return BiDirectionType.INSTANCE; + } + + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return blockEntityFactory.apply(pos, state); + } + + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState state, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + public BlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/DiskDriveContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/DiskDriveContainerMenu.java new file mode 100644 index 000000000..9c354940a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/DiskDriveContainerMenu.java @@ -0,0 +1,137 @@ +package com.refinedmods.refinedstorage.common.storage.diskdrive; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItem; +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.storage.AbstractStorageContainerMenu; +import com.refinedmods.refinedstorage.common.storage.StorageAccessor; +import com.refinedmods.refinedstorage.common.storage.StorageConfigurationContainer; +import com.refinedmods.refinedstorage.common.support.FilteredContainer; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlotType; +import com.refinedmods.refinedstorage.common.support.containermenu.ValidatedSlot; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.Slot; +import net.minecraft.world.item.ItemStack; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class DiskDriveContainerMenu extends AbstractStorageContainerMenu implements StorageAccessor { + private static final int DISK_SLOT_X = 61; + private static final int DISK_SLOT_Y = 54; + + private static final int FILTER_SLOT_X = 8; + private static final int FILTER_SLOT_Y = 20; + + private final StorageDiskInfoAccessor storageInfoAccessor; + + private final List diskSlots = new ArrayList<>(); + + public DiskDriveContainerMenu(final int syncId, + final Inventory playerInventory, + final ResourceContainerData resourceContainerData) { + super(Menus.INSTANCE.getDiskDrive(), syncId); + this.storageInfoAccessor = new StorageDiskInfoAccessorImpl( + RefinedStorageApi.INSTANCE.getClientStorageRepository() + ); + addSlots( + playerInventory.player, + new FilteredContainer( + AbstractDiskDriveBlockEntity.AMOUNT_OF_DISKS, + StorageContainerItem.stackValidator() + ), + ResourceContainerImpl.createForFilter(resourceContainerData) + ); + } + + DiskDriveContainerMenu(final int syncId, + final Player player, + final FilteredContainer diskInventory, + final ResourceContainer filterContainer, + final StorageConfigurationContainer configContainer, + final StorageDiskInfoAccessor storageInfoAccessor) { + super(Menus.INSTANCE.getDiskDrive(), syncId, player, configContainer); + this.storageInfoAccessor = storageInfoAccessor; + addSlots(player, diskInventory, filterContainer); + } + + private void addSlots(final Player player, + final FilteredContainer diskInventory, + final ResourceContainer filterContainer) { + for (int i = 0; i < diskInventory.getContainerSize(); ++i) { + diskSlots.add(addSlot(createDiskSlot(diskInventory, i))); + } + for (int i = 0; i < filterContainer.size(); ++i) { + addSlot(createFilterSlot(filterContainer, i)); + } + addPlayerInventory(player.getInventory(), 8, 141); + + transferManager.addBiTransfer(player.getInventory(), diskInventory); + transferManager.addFilterTransfer(player.getInventory()); + } + + private Slot createFilterSlot(final ResourceContainer filterContainer, final int i) { + final int x = FILTER_SLOT_X + (18 * i); + return new ResourceSlot( + filterContainer, + i, + createTranslation("gui", "storage.filter_help"), + x, + FILTER_SLOT_Y, + ResourceSlotType.FILTER + ); + } + + private Slot createDiskSlot(final FilteredContainer diskInventory, final int i) { + final int x = DISK_SLOT_X + ((i % 2) * 18); + final int y = DISK_SLOT_Y + Math.floorDiv(i, 2) * 18; + return ValidatedSlot.forStorageContainer(diskInventory, i, x, y); + } + + @Override + public boolean hasCapacity() { + return getStorageDiskInfo().allMatch(info -> info.capacity() > 0); + } + + @Override + public double getProgress() { + if (!hasCapacity()) { + return 0; + } + return (double) getStored() / (double) getCapacity(); + } + + @Override + public long getCapacity() { + return getStorageDiskInfo().mapToLong(StorageInfo::capacity).sum(); + } + + @Override + public long getStored() { + return getStorageDiskInfo().mapToLong(StorageInfo::stored).sum(); + } + + private Stream getDiskStacks() { + return diskSlots + .stream() + .map(Slot::getItem) + .filter(stack -> !stack.isEmpty()); + } + + private Stream getStorageDiskInfo() { + return getDiskStacks() + .map(storageInfoAccessor::getInfo) + .flatMap(Optional::stream); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/DiskDriveScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/DiskDriveScreen.java new file mode 100644 index 000000000..465414a1c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/DiskDriveScreen.java @@ -0,0 +1,32 @@ +package com.refinedmods.refinedstorage.common.storage.diskdrive; + +import com.refinedmods.refinedstorage.common.storage.AbstractProgressStorageScreen; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class DiskDriveScreen extends AbstractProgressStorageScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/disk_drive.png"); + private static final MutableComponent DISKS_TEXT = createTranslation("gui", "disk_drive.disks"); + + public DiskDriveScreen(final DiskDriveContainerMenu menu, final Inventory playerInventory, final Component text) { + super(menu, playerInventory, text, 99); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } + + @Override + protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { + super.renderLabels(graphics, mouseX, mouseY); + graphics.drawString(font, DISKS_TEXT, 60, 42, 4210752, false); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/EmptyStorageDiskInfoAccessor.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/EmptyStorageDiskInfoAccessor.java new file mode 100644 index 000000000..a51fb0736 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/EmptyStorageDiskInfoAccessor.java @@ -0,0 +1,14 @@ +package com.refinedmods.refinedstorage.common.storage.diskdrive; + +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; + +import java.util.Optional; + +import net.minecraft.world.item.ItemStack; + +class EmptyStorageDiskInfoAccessor implements StorageDiskInfoAccessor { + @Override + public Optional getInfo(final ItemStack stack) { + return Optional.empty(); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/StorageDiskInfoAccessor.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/StorageDiskInfoAccessor.java new file mode 100644 index 000000000..84c350adf --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/StorageDiskInfoAccessor.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage.common.storage.diskdrive; + +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; + +import java.util.Optional; + +import net.minecraft.world.item.ItemStack; + +interface StorageDiskInfoAccessor { + Optional getInfo(ItemStack stack); +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/StorageDiskInfoAccessorImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/StorageDiskInfoAccessorImpl.java new file mode 100644 index 000000000..de6d576ab --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/StorageDiskInfoAccessorImpl.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage.common.storage.diskdrive; + +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItem; +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; + +import java.util.Optional; + +import net.minecraft.world.item.ItemStack; + +class StorageDiskInfoAccessorImpl implements StorageDiskInfoAccessor { + private final StorageRepository storageRepository; + + StorageDiskInfoAccessorImpl(final StorageRepository storageRepository) { + this.storageRepository = storageRepository; + } + + @Override + public Optional getInfo(final ItemStack stack) { + if (stack.getItem() instanceof StorageContainerItem storageContainerItem) { + return storageContainerItem.getInfo(storageRepository, stack); + } + return Optional.empty(); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/package-info.java new file mode 100644 index 000000000..9d9f45875 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.storage.diskdrive; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java index 86002c063..29e6cada4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java @@ -1,21 +1,21 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskinterface; +package com.refinedmods.refinedstorage.common.storage.diskinterface; import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferListener; import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferMode; import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferNetworkNode; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.storage.AbstractDiskContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.FilterModeSettings; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage.platform.common.util.ContainerUtil; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.storage.AbstractDiskContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.util.ContainerUtil; import java.util.List; import java.util.Set; @@ -54,11 +54,11 @@ protected AbstractDiskInterfaceBlockEntity(final BlockPos pos, final BlockState )); this.upgradeContainer = new UpgradeContainer( UpgradeDestinations.DISK_INTERFACE, - PlatformApi.INSTANCE.getUpgradeRegistry(), + RefinedStorageApi.INSTANCE.getUpgradeRegistry(), this::upgradeContainerChanged ); - this.mainNode.setListener(this); - this.mainNode.setTransferQuotaProvider(storage -> { + this.mainNetworkNode.setListener(this); + this.mainNetworkNode.setTransferQuotaProvider(storage -> { if (storage instanceof SerializableStorage serializableStorage) { return serializableStorage.getType().getDiskInterfaceTransferQuota( upgradeContainer.has(Items.INSTANCE.getStackUpgrade()) @@ -72,7 +72,7 @@ private void upgradeContainerChanged() { final int amountOfSpeedUpgrades = upgradeContainer.getAmount(Items.INSTANCE.getSpeedUpgrade()); this.workTickRate = 9 - (amountOfSpeedUpgrades * 2); final long baseEnergyUsage = Platform.INSTANCE.getConfig().getDiskInterface().getEnergyUsage(); - mainNode.setEnergyUsage(baseEnergyUsage + upgradeContainer.getEnergyUsage()); + mainNetworkNode.setEnergyUsage(baseEnergyUsage + upgradeContainer.getEnergyUsage()); setChanged(); } @@ -85,12 +85,12 @@ public final void doWork() { @Override protected void setFilters(final Set filters) { - mainNode.setFilters(filters); + mainNetworkNode.setFilters(filters); } @Override protected void setNormalizer(final UnaryOperator normalizer) { - mainNode.setNormalizer(normalizer); + mainNetworkNode.setNormalizer(normalizer); } @Override @@ -105,24 +105,24 @@ public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider pr public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { super.saveAdditional(tag, provider); tag.put(TAG_UPGRADES, ContainerUtil.write(upgradeContainer, provider)); - tag.putInt(TAG_FILTER_MODE, FilterModeSettings.getFilterMode(mainNode.getFilterMode())); + tag.putInt(TAG_FILTER_MODE, FilterModeSettings.getFilterMode(mainNetworkNode.getFilterMode())); } @Override public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { super.readConfiguration(tag, provider); if (tag.contains(TAG_TRANSFER_MODE)) { - mainNode.setMode(TransferModeSettings.getTransferMode(tag.getInt(TAG_TRANSFER_MODE))); + mainNetworkNode.setMode(TransferModeSettings.getTransferMode(tag.getInt(TAG_TRANSFER_MODE))); } if (tag.contains(TAG_FILTER_MODE)) { - mainNode.setFilterMode(FilterModeSettings.getFilterMode(tag.getInt(TAG_FILTER_MODE))); + mainNetworkNode.setFilterMode(FilterModeSettings.getFilterMode(tag.getInt(TAG_FILTER_MODE))); } } @Override public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { super.writeConfiguration(tag, provider); - tag.putInt(TAG_TRANSFER_MODE, TransferModeSettings.getTransferMode(mainNode.getMode())); + tag.putInt(TAG_TRANSFER_MODE, TransferModeSettings.getTransferMode(mainNetworkNode.getMode())); } @Override @@ -171,20 +171,20 @@ void setFuzzyMode(final boolean fuzzyMode) { } FilterMode getFilterMode() { - return mainNode.getFilterMode(); + return mainNetworkNode.getFilterMode(); } void setFilterMode(final FilterMode mode) { - mainNode.setFilterMode(mode); + mainNetworkNode.setFilterMode(mode); setChanged(); } public StorageTransferMode getTransferMode() { - return mainNode.getMode(); + return mainNetworkNode.getMode(); } public void setTransferMode(final StorageTransferMode mode) { - mainNode.setMode(mode); + mainNetworkNode.setMode(mode); setChanged(); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntityRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntityRenderer.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntityRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntityRenderer.java index 2c6a45601..83f7c22e1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntityRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntityRenderer.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskinterface; +package com.refinedmods.refinedstorage.common.storage.diskinterface; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.render.AbstractDiskLedBlockEntityRenderer; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.render.AbstractDiskLedBlockEntityRenderer; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfaceBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfaceBlock.java new file mode 100644 index 000000000..83f1f66eb --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfaceBlock.java @@ -0,0 +1,83 @@ +package com.refinedmods.refinedstorage.common.storage.diskinterface; + +import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferNetworkNode; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.storage.DiskContainerBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractActiveColoredDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.direction.BiDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; + +import java.util.function.BiFunction; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class DiskInterfaceBlock + extends AbstractActiveColoredDirectionalBlock + implements EntityBlock, BlockItemProvider { + private static final Component HELP = createTranslation("item", "disk_interface.help"); + private static final DiskContainerBlockEntityTicker + TICKER = new DiskContainerBlockEntityTicker<>(BlockEntities.INSTANCE::getDiskInterface, ACTIVE); + + private final BiFunction blockEntityFactory; + + public DiskInterfaceBlock(final DyeColor color, + final MutableComponent name, + final BiFunction + blockEntityFactory) { + super(BlockConstants.PROPERTIES, color, name); + this.blockEntityFactory = blockEntityFactory; + } + + @Override + protected DirectionType getDirectionType() { + return BiDirectionType.INSTANCE; + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { + return blockEntityFactory.apply(blockPos, blockState); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getDiskInterface(); + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } + + @Override + public boolean canAlwaysConnect() { + return true; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfaceContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfaceContainerMenu.java new file mode 100644 index 000000000..facd010d9 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfaceContainerMenu.java @@ -0,0 +1,128 @@ +package com.refinedmods.refinedstorage.common.storage.diskinterface; + +import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferMode; +import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItem; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.storage.DiskInventory; +import com.refinedmods.refinedstorage.common.support.FilteredContainer; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlotType; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.ValidatedSlot; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeSlot; + +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.Slot; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class DiskInterfaceContainerMenu extends AbstractResourceContainerMenu { + private static final int DISK_SLOT_X1 = 44; + private static final int DISK_SLOT_X2 = 116; + private static final int DISK_SLOT_Y = 57; + + private static final int FILTER_SLOT_X = 8; + private static final int FILTER_SLOT_Y = 20; + + DiskInterfaceContainerMenu(final int syncId, + final Player player, + final AbstractDiskInterfaceBlockEntity blockEntity, + final DiskInventory diskInventory, + final ResourceContainer filterContainer, + final UpgradeContainer upgradeContainer) { + super(Menus.INSTANCE.getDiskInterface(), syncId, player); + addSlots(player, diskInventory, filterContainer, upgradeContainer); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + blockEntity::getRedstoneMode, + blockEntity::setRedstoneMode + )); + registerProperty(new ServerProperty<>( + PropertyTypes.FUZZY_MODE, + blockEntity::isFuzzyMode, + blockEntity::setFuzzyMode + )); + registerProperty(new ServerProperty<>( + PropertyTypes.FILTER_MODE, + blockEntity::getFilterMode, + blockEntity::setFilterMode + )); + registerProperty(new ServerProperty<>( + DiskInterfacePropertyTypes.TRANSFER_MODE, + blockEntity::getTransferMode, + blockEntity::setTransferMode + )); + } + + public DiskInterfaceContainerMenu(final int syncId, + final Inventory playerInventory, + final ResourceContainerData resourceContainerData) { + super(Menus.INSTANCE.getDiskInterface(), syncId); + addSlots( + playerInventory.player, + new FilteredContainer( + AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS, + StorageContainerItem.stackValidator() + ), + ResourceContainerImpl.createForFilter(resourceContainerData), + new UpgradeContainer(UpgradeDestinations.DISK_INTERFACE, RefinedStorageApi.INSTANCE.getUpgradeRegistry()) + ); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); + registerProperty(new ClientProperty<>(PropertyTypes.FILTER_MODE, FilterMode.BLOCK)); + registerProperty(new ClientProperty<>( + DiskInterfacePropertyTypes.TRANSFER_MODE, + StorageTransferMode.INSERT_INTO_NETWORK + )); + } + + private void addSlots(final Player player, + final FilteredContainer diskInventory, + final ResourceContainer filterContainer, + final UpgradeContainer upgradeContainer) { + for (int i = 0; i < diskInventory.getContainerSize(); ++i) { + addSlot(createDiskSlot(diskInventory, i)); + } + for (int i = 0; i < filterContainer.size(); ++i) { + addSlot(createFilterSlot(filterContainer, i)); + } + for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { + addSlot(new UpgradeSlot(upgradeContainer, i, 187, 6 + (i * 18))); + } + addPlayerInventory(player.getInventory(), 8, 129); + + transferManager.addBiTransfer(player.getInventory(), upgradeContainer); + transferManager.addBiTransfer(player.getInventory(), diskInventory); + transferManager.addFilterTransfer(player.getInventory()); + } + + private Slot createFilterSlot(final ResourceContainer filterContainer, final int i) { + final int x = FILTER_SLOT_X + (18 * i); + return new ResourceSlot( + filterContainer, + i, + createTranslation("gui", "disk_interface.filter_help"), + x, + FILTER_SLOT_Y, + ResourceSlotType.FILTER + ); + } + + private Slot createDiskSlot(final FilteredContainer diskInventory, final int i) { + final int x = i < 3 ? DISK_SLOT_X1 : DISK_SLOT_X2; + final int y = DISK_SLOT_Y + ((i % 3) * 18); + return ValidatedSlot.forStorageContainer(diskInventory, i, x, y); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfacePropertyTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfacePropertyTypes.java new file mode 100644 index 000000000..5bf477228 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfacePropertyTypes.java @@ -0,0 +1,17 @@ +package com.refinedmods.refinedstorage.common.storage.diskinterface; + +import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferMode; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyType; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +class DiskInterfacePropertyTypes { + public static final PropertyType TRANSFER_MODE = new PropertyType<>( + createIdentifier("transfer_mode"), + TransferModeSettings::getTransferMode, + TransferModeSettings::getTransferMode + ); + + private DiskInterfacePropertyTypes() { + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfaceScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfaceScreen.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfaceScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfaceScreen.java index 4ee3aa644..db31dce5b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfaceScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/DiskInterfaceScreen.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskinterface; +package com.refinedmods.refinedstorage.common.storage.diskinterface; import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferMode; -import com.refinedmods.refinedstorage.platform.common.storage.FilterModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.storage.FilterModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; @@ -13,8 +13,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class DiskInterfaceScreen extends AbstractBaseScreen { private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/disk_interface.png"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSettings.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSettings.java new file mode 100644 index 000000000..50630c045 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSettings.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage.common.storage.diskinterface; + +import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferMode; + +class TransferModeSettings { + private static final int INSERT_INTO_NETWORK = 0; + private static final int EXTRACT_FROM_NETWORK = 1; + + private TransferModeSettings() { + } + + static StorageTransferMode getTransferMode(final int transferMode) { + if (transferMode == EXTRACT_FROM_NETWORK) { + return StorageTransferMode.EXTRACT_FROM_NETWORK; + } + return StorageTransferMode.INSERT_INTO_NETWORK; + } + + static int getTransferMode(final StorageTransferMode transferMode) { + return switch (transferMode) { + case INSERT_INTO_NETWORK -> INSERT_INTO_NETWORK; + case EXTRACT_FROM_NETWORK -> EXTRACT_FROM_NETWORK; + }; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSideButtonWidget.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSideButtonWidget.java index 35193b01a..f497c1db6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSideButtonWidget.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskinterface; +package com.refinedmods.refinedstorage.common.storage.diskinterface; import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class TransferModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "disk_interface.transfer_mode"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/package-info.java new file mode 100644 index 000000000..76f3eff74 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.storage.diskinterface; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlock.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlock.java index 08b98f9a2..73c7a47aa 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlock.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage.platform.common.storage.externalstorage; +package com.refinedmods.refinedstorage.common.storage.externalstorage; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalCableBlock; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.ColorableBlock; -import com.refinedmods.refinedstorage.platform.common.support.DirectionalCableBlockShapes; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalCableBlock; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.ColorableBlock; +import com.refinedmods.refinedstorage.common.support.DirectionalCableBlockShapes; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; import java.util.HashMap; import java.util.Map; @@ -33,7 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class ExternalStorageBlock extends AbstractDirectionalCableBlock implements ColorableBlock, EntityBlock, BlockItemProvider { @@ -71,7 +71,6 @@ public BlockEntityTicker getTicker(final Level level, } @Override - @SuppressWarnings("deprecation") public void neighborChanged(final BlockState state, final Level level, final BlockPos pos, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlockEntity.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlockEntity.java index 40f7fb483..580c8ea61 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlockEntity.java @@ -1,17 +1,17 @@ -package com.refinedmods.refinedstorage.platform.common.storage.externalstorage; +package com.refinedmods.refinedstorage.common.storage.externalstorage; import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageNetworkNode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.storage.StorageConfigurationContainerImpl; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.storage.StorageConfigurationContainerImpl; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; import javax.annotation.Nullable; @@ -30,6 +30,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock.tryExtractDirection; import static java.util.Objects.requireNonNull; public class ExternalStorageBlockEntity @@ -53,12 +54,12 @@ public ExternalStorageBlockEntity(final BlockPos pos, final BlockState state) { this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters( ResourceContainerImpl.createForFilter(), this::setChanged, - mainNode.getStorageConfiguration()::setFilters + mainNetworkNode.getStorageConfiguration()::setFilters ); - mainNode.getStorageConfiguration().setNormalizer(filter.createNormalizer()); - mainNode.setTrackingRepository(trackedStorageRepository); + mainNetworkNode.getStorageConfiguration().setNormalizer(filter.createNormalizer()); + mainNetworkNode.setTrackingRepository(trackedStorageRepository); this.configContainer = new StorageConfigurationContainerImpl( - mainNode.getStorageConfiguration(), + mainNetworkNode.getStorageConfiguration(), filter, this::setChanged, this::getRedstoneMode, @@ -67,7 +68,6 @@ public ExternalStorageBlockEntity(final BlockPos pos, final BlockState state) { } @Override - @SuppressWarnings("deprecation") public void setBlockState(final BlockState newBlockState) { super.setBlockState(newBlockState); if (level instanceof ServerLevel serverLevel) { @@ -87,15 +87,15 @@ protected void activenessChanged(final boolean newActive) { } void loadStorage(final ServerLevel serverLevel) { - final Direction direction = getDirection(); + final Direction direction = tryExtractDirection(getBlockState()); LOGGER.debug("Loading storage for external storage with direction {} @ {}", direction, worldPosition); if (direction == null) { return; } - mainNode.initialize(() -> { + mainNetworkNode.initialize(() -> { final Direction incomingDirection = direction.getOpposite(); final BlockPos sourcePosition = worldPosition.relative(direction); - return PlatformApi.INSTANCE + return RefinedStorageApi.INSTANCE .getExternalStorageProviderFactories() .stream() .flatMap(factory -> factory.create(serverLevel, sourcePosition, incomingDirection).stream()) @@ -107,7 +107,7 @@ void loadStorage(final ServerLevel serverLevel) { public void doWork() { super.doWork(); if (workRate.canDoWork()) { - final boolean hasChanges = mainNode.detectChanges(); + final boolean hasChanges = mainNetworkNode.detectChanges(); if (hasChanges) { LOGGER.debug("External storage @ {} has changed!", worldPosition); workRate.faster(); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageContainerMenu.java new file mode 100644 index 000000000..ca4f9b5e8 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageContainerMenu.java @@ -0,0 +1,57 @@ +package com.refinedmods.refinedstorage.common.storage.externalstorage; + +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.storage.AbstractStorageContainerMenu; +import com.refinedmods.refinedstorage.common.storage.StorageConfigurationContainer; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlotType; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; + +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.Slot; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ExternalStorageContainerMenu extends AbstractStorageContainerMenu { + private static final int FILTER_SLOT_X = 8; + private static final int FILTER_SLOT_Y = 20; + + public ExternalStorageContainerMenu(final int syncId, + final Inventory playerInventory, + final ResourceContainerData resourceContainerData) { + super(Menus.INSTANCE.getExternalStorage(), syncId); + addSlots(playerInventory.player, ResourceContainerImpl.createForFilter(resourceContainerData)); + } + + ExternalStorageContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { + super(Menus.INSTANCE.getExternalStorage(), syncId, player, configContainer); + addSlots(player, resourceContainer); + } + + private void addSlots(final Player player, + final ResourceContainer resourceContainer) { + for (int i = 0; i < resourceContainer.size(); ++i) { + addSlot(createFilterSlot(resourceContainer, i)); + } + addPlayerInventory(player.getInventory(), 8, 55); + transferManager.addFilterTransfer(player.getInventory()); + } + + private Slot createFilterSlot(final ResourceContainer resourceContainer, final int i) { + final int x = FILTER_SLOT_X + (18 * i); + return new ResourceSlot( + resourceContainer, + i, + createTranslation("gui", "storage.filter_help"), + x, + FILTER_SLOT_Y, + ResourceSlotType.FILTER + ); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageScreen.java new file mode 100644 index 000000000..abb6475ac --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageScreen.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.common.storage.externalstorage; + +import com.refinedmods.refinedstorage.common.storage.AbstractStorageScreen; +import com.refinedmods.refinedstorage.common.support.AbstractFilterScreen; + +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +public class ExternalStorageScreen extends AbstractStorageScreen { + public ExternalStorageScreen(final ExternalStorageContainerMenu menu, + final Inventory inventory, + final Component title) { + super(menu, inventory, title); + this.inventoryLabelY = 42; + this.imageWidth = 210; + this.imageHeight = 137; + } + + @Override + protected ResourceLocation getTexture() { + return AbstractFilterScreen.TEXTURE; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageTrackedStorageRepository.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageTrackedStorageRepository.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageTrackedStorageRepository.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageTrackedStorageRepository.java index dfd5d593c..96df4231b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageTrackedStorageRepository.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageTrackedStorageRepository.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.storage.externalstorage; +package com.refinedmods.refinedstorage.common.storage.externalstorage; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.tracked.InMemoryTrackedStorageRepository; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; import java.util.Collections; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageWorkRate.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageWorkRate.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageWorkRate.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageWorkRate.java index d57bb780f..99f46938e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageWorkRate.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageWorkRate.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage.externalstorage; +package com.refinedmods.refinedstorage.common.storage.externalstorage; import com.google.common.util.concurrent.RateLimiter; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/package-info.java new file mode 100644 index 000000000..3c7f8a2d8 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.storage.externalstorage; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/package-info.java new file mode 100644 index 000000000..8bfa9e24d --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.storage; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/AbstractPortableGridBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntity.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/AbstractPortableGridBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntity.java index 0ce0e8c66..b00adf832 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/AbstractPortableGridBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntity.java @@ -1,27 +1,27 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyStorageImpl; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.configurationcard.ConfigurationCardTarget; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.support.energy.TransferableBlockEntityEnergy; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.GridData; -import com.refinedmods.refinedstorage.platform.common.grid.PortableGridData; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.DiskInventory; -import com.refinedmods.refinedstorage.platform.common.storage.DiskStateChangeListener; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneModeSettings; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.energy.BlockEntityEnergyStorage; -import com.refinedmods.refinedstorage.platform.common.support.energy.CreativeEnergyStorage; -import com.refinedmods.refinedstorage.platform.common.support.energy.ItemBlockEnergyStorage; -import com.refinedmods.refinedstorage.platform.common.util.ContainerUtil; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.configurationcard.ConfigurationCardTarget; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.support.energy.TransferableBlockEntityEnergy; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.GridData; +import com.refinedmods.refinedstorage.common.grid.PortableGridData; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.DiskInventory; +import com.refinedmods.refinedstorage.common.storage.DiskStateChangeListener; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.RedstoneModeSettings; +import com.refinedmods.refinedstorage.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.energy.BlockEntityEnergyStorage; +import com.refinedmods.refinedstorage.common.support.energy.CreativeEnergyStorage; +import com.refinedmods.refinedstorage.common.support.energy.ItemBlockEnergyStorage; +import com.refinedmods.refinedstorage.common.util.ContainerUtil; import java.util.Optional; import javax.annotation.Nullable; @@ -151,7 +151,7 @@ public void setLevel(final Level level) { } private void initialize(final Level level) { - diskInventory.setStorageRepository(PlatformApi.INSTANCE.getStorageRepository(level)); + diskInventory.setStorageRepository(RefinedStorageApi.INSTANCE.getStorageRepository(level)); grid.updateStorage(); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/AbstractPortableGridBlockEntityRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntityRenderer.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/AbstractPortableGridBlockEntityRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntityRenderer.java index 2b0a87407..066100e74 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/AbstractPortableGridBlockEntityRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntityRenderer.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.render.AbstractDiskLedBlockEntityRenderer; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.render.AbstractDiskLedBlockEntityRenderer; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridContainerMenu.java new file mode 100644 index 000000000..328e62c64 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridContainerMenu.java @@ -0,0 +1,83 @@ +package com.refinedmods.refinedstorage.common.storage.portablegrid; + +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItem; +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.grid.PortableGridData; +import com.refinedmods.refinedstorage.common.storage.DiskInventory; +import com.refinedmods.refinedstorage.common.support.FilteredContainer; +import com.refinedmods.refinedstorage.common.support.containermenu.ValidatedSlot; +import com.refinedmods.refinedstorage.common.support.energy.EnergyContainerMenu; +import com.refinedmods.refinedstorage.common.support.energy.EnergyInfo; + +import javax.annotation.Nullable; + +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.inventory.Slot; + +public abstract class AbstractPortableGridContainerMenu extends AbstractGridContainerMenu + implements EnergyContainerMenu { + private final FilteredContainer diskInventory; + private final EnergyInfo energyInfo; + + @Nullable + private Slot diskSlot; + + AbstractPortableGridContainerMenu( + final MenuType menuType, + final int syncId, + final Inventory playerInventory, + final PortableGridData portableGridData + ) { + super(menuType, syncId, playerInventory, portableGridData.gridData()); + this.diskInventory = new FilteredContainer(1, StorageContainerItem.stackValidator()); + this.energyInfo = EnergyInfo.forClient( + playerInventory.player, + portableGridData.stored(), + portableGridData.capacity() + ); + } + + AbstractPortableGridContainerMenu( + final MenuType menuType, + final int syncId, + final Inventory playerInventory, + final DiskInventory diskInventory, + final Grid grid, + final EnergyStorage energyStorage + ) { + super(menuType, syncId, playerInventory, grid); + this.diskInventory = diskInventory; + this.energyInfo = EnergyInfo.forServer( + playerInventory.player, + energyStorage::getStored, + energyStorage::getCapacity + ); + } + + @Override + public void broadcastChanges() { + super.broadcastChanges(); + energyInfo.detectChanges(); + } + + @Override + protected boolean canTransferSlot(final Slot slot) { + return slot != diskSlot; + } + + @Override + public void onScreenReady(final int playerInventoryY) { + super.onScreenReady(playerInventoryY); + diskSlot = ValidatedSlot.forStorageContainer(diskInventory, 0, -19, 8); + addSlot(diskSlot); + transferManager.addBiTransfer(playerInventory, diskInventory); + } + + @Override + public EnergyInfo getEnergyInfo() { + return energyInfo; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/InWorldPortableGrid.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/InWorldPortableGrid.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/InWorldPortableGrid.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/InWorldPortableGrid.java index b03248594..9606011b8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/InWorldPortableGrid.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/InWorldPortableGrid.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage; -import com.refinedmods.refinedstorage.platform.common.storage.DiskInventory; +import com.refinedmods.refinedstorage.common.storage.DiskInventory; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGrid.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGrid.java new file mode 100644 index 000000000..22e2c6dde --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGrid.java @@ -0,0 +1,122 @@ +package com.refinedmods.refinedstorage.common.storage.portablegrid; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.api.grid.operations.NoopGridOperations; +import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher; +import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManager; +import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManagerImpl; +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.NoopStorage; +import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage; +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageState; +import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.storage.DiskInventory; + +import java.util.Collections; +import java.util.List; +import javax.annotation.Nullable; + +import net.minecraft.server.level.ServerPlayer; + +class PortableGrid implements Grid { + private final EnergyStorage energyStorage; + private final DiskInventory diskInventory; + private final GridWatcherManager watchers = new GridWatcherManagerImpl(); + private final StateTrackedStorage.Listener diskListener; + @Nullable + private PortableGridStorage storage; + + PortableGrid(final EnergyStorage energyStorage, + final DiskInventory diskInventory, + final StateTrackedStorage.Listener diskListener) { + this.energyStorage = energyStorage; + this.diskInventory = diskInventory; + this.diskListener = diskListener; + } + + void updateStorage() { + if (storage != null) { + watchers.detachAll(storage.getRootStorage()); + } + + this.storage = diskInventory.resolve(0) + .map(diskStorage -> new StateTrackedStorage(diskStorage, diskListener)) + .map(PortableGridStorage::new) + .orElse(null); + + watchers.attachAll(getRootStorage()); + } + + void activeChanged(final boolean active) { + watchers.activeChanged(active); + } + + StorageState getStorageState() { + if (storage == null) { + return StorageState.NONE; + } + if (!isGridActive()) { + return StorageState.INACTIVE; + } + return storage.getState(); + } + + @Override + public void addWatcher(final GridWatcher watcher, final Class actorType) { + energyStorage.extract(Platform.INSTANCE.getConfig().getPortableGrid().getOpenEnergyUsage(), Action.EXECUTE); + watchers.addWatcher(watcher, actorType, getRootStorage()); + } + + @Override + public void removeWatcher(final GridWatcher watcher) { + watchers.removeWatcher(watcher, getRootStorage()); + } + + @Nullable + private RootStorage getRootStorage() { + return storage != null ? storage.getRootStorage() : null; + } + + @Override + public Storage getItemStorage() { + if (storage == null) { + return new NoopStorage(); + } + return storage.getRootStorage(); + } + + @Override + public boolean isGridActive() { + return energyStorage.getStored() > 0 && storage != null; + } + + @Override + public List getResources(final Class actorType) { + if (storage == null) { + return Collections.emptyList(); + } + final RootStorage rootStorage = storage.getRootStorage(); + return rootStorage.getAll().stream().map(resource -> new TrackedResourceAmount( + resource, + rootStorage.findTrackedResourceByActorType(resource.getResource(), actorType).orElse(null) + )).toList(); + } + + @Override + public GridOperations createOperations(final ResourceType resourceType, final ServerPlayer player) { + if (storage == null) { + return new NoopGridOperations(); + } + final RootStorage rootStorage = this.storage.getRootStorage(); + final GridOperations operations = resourceType.createGridOperations(rootStorage, new PlayerActor(player)); + return new PortableGridOperations(operations, energyStorage); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlock.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlock.java index ff77977c4..e855c833a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlock.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.direction.BiDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; import java.util.function.BiFunction; @@ -61,7 +61,6 @@ protected DirectionType getDirectionType() { } @Override - @SuppressWarnings("deprecation") public VoxelShape getShape(final BlockState state, final BlockGetter level, final BlockPos pos, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockContainerMenu.java new file mode 100644 index 000000000..380eb8eb4 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockContainerMenu.java @@ -0,0 +1,39 @@ +package com.refinedmods.refinedstorage.common.storage.portablegrid; + +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.grid.PortableGridData; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; + +import net.minecraft.world.entity.player.Inventory; + +public class PortableGridBlockContainerMenu extends AbstractPortableGridContainerMenu { + public PortableGridBlockContainerMenu(final int syncId, + final Inventory playerInventory, + final PortableGridData portableGridData) { + super(Menus.INSTANCE.getPortableGridBlock(), syncId, playerInventory, portableGridData); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + this.onScreenReady(0); + } + + PortableGridBlockContainerMenu(final int syncId, + final Inventory playerInventory, + final AbstractPortableGridBlockEntity portableGrid) { + super( + Menus.INSTANCE.getPortableGridBlock(), + syncId, + playerInventory, + portableGrid.getDiskInventory(), + portableGrid.getGrid(), + portableGrid.getEnergyStorage() + ); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + portableGrid::getRedstoneMode, + portableGrid::setRedstoneMode + )); + this.onScreenReady(0); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockEntityTicker.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockEntityTicker.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockEntityTicker.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockEntityTicker.java index 5c581f95e..06cf00e4a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockEntityTicker.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockEntityTicker.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; import java.util.function.Supplier; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItem.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItem.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItem.java index 1d72f81c1..5ce20f07b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; @@ -6,18 +6,18 @@ import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyStorageImpl; import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage; import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItem; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.support.energy.AbstractEnergyBlockItem; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceHandlerItem; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.DiskInventory; -import com.refinedmods.refinedstorage.platform.common.support.energy.CreativeEnergyStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItem; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.support.energy.AbstractEnergyBlockItem; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceHandlerItem; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.DiskInventory; +import com.refinedmods.refinedstorage.common.support.energy.CreativeEnergyStorage; import java.util.Optional; import javax.annotation.Nullable; @@ -37,7 +37,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class PortableGridBlockItem extends AbstractEnergyBlockItem implements SlotReferenceHandlerItem { private static final Component HELP = createTranslation("item", "portable_grid.help"); @@ -45,7 +45,7 @@ public class PortableGridBlockItem extends AbstractEnergyBlockItem implements Sl private final PortableGridType type; public PortableGridBlockItem(final Block block, final PortableGridType type) { - super(block, new Item.Properties().stacksTo(1), PlatformApi.INSTANCE.getEnergyItemHelper()); + super(block, new Item.Properties().stacksTo(1), RefinedStorageApi.INSTANCE.getEnergyItemHelper()); this.type = type; } @@ -73,7 +73,7 @@ private static StorageState getState(final ItemStack diskStack, final boolean ac if (!active) { return StorageState.INACTIVE; } - final StorageRepository storageRepository = PlatformApi.INSTANCE.getClientStorageRepository(); + final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getClientStorageRepository(); return storageContainerItem.getInfo(storageRepository, diskStack) .map(storageInfo -> StateTrackedStorage.computeState(storageInfo.capacity(), storageInfo.stored())) .orElse(StorageState.INACTIVE); @@ -105,7 +105,7 @@ public static EnergyStorage createEnergyStorage(final ItemStack stack) { final EnergyStorage energyStorage = new EnergyStorageImpl( Platform.INSTANCE.getConfig().getPortableGrid().getEnergyCapacity() ); - return PlatformApi.INSTANCE.asBlockItemEnergyStorage( + return RefinedStorageApi.INSTANCE.asBlockItemEnergyStorage( energyStorage, stack, BlockEntities.INSTANCE.getPortableGrid() @@ -116,7 +116,7 @@ public static EnergyStorage createEnergyStorage(final ItemStack stack) { public InteractionResultHolder use(final Level level, final Player player, final InteractionHand hand) { final ItemStack stack = player.getItemInHand(hand); if (player instanceof ServerPlayer serverPlayer && level.getServer() != null) { - final SlotReference slotReference = PlatformApi.INSTANCE.createInventorySlotReference(player, hand); + final SlotReference slotReference = RefinedStorageApi.INSTANCE.createInventorySlotReference(player, hand); slotReference.resolve(player).ifPresent(s -> use(serverPlayer, s, slotReference)); } return InteractionResultHolder.consume(stack); @@ -128,7 +128,7 @@ public void use(final ServerPlayer player, final ItemStack stack, final SlotRefe final Level level = player.serverLevel(); final DiskInventoryListenerImpl listener = new DiskInventoryListenerImpl(stack, level.registryAccess()); final DiskInventory diskInventory = createDiskInventory(stack, listener, level.registryAccess()); - diskInventory.setStorageRepository(PlatformApi.INSTANCE.getStorageRepository(level)); + diskInventory.setStorageRepository(RefinedStorageApi.INSTANCE.getStorageRepository(level)); final PortableGrid portableGrid = new PortableGrid( energyStorage, diskInventory, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItemRenderInfo.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItemRenderInfo.java new file mode 100644 index 000000000..edbdb11ca --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItemRenderInfo.java @@ -0,0 +1,6 @@ +package com.refinedmods.refinedstorage.common.storage.portablegrid; + +import com.refinedmods.refinedstorage.common.storage.Disk; + +public record PortableGridBlockItemRenderInfo(boolean active, Disk disk) { +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemContainerMenu.java new file mode 100644 index 000000000..83dbff994 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemContainerMenu.java @@ -0,0 +1,38 @@ +package com.refinedmods.refinedstorage.common.storage.portablegrid; + +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.grid.PortableGridData; +import com.refinedmods.refinedstorage.common.storage.DiskInventory; + +import net.minecraft.world.entity.player.Inventory; + +public class PortableGridItemContainerMenu extends AbstractPortableGridContainerMenu { + public PortableGridItemContainerMenu(final int syncId, + final Inventory playerInventory, + final PortableGridData portableGridData) { + super(Menus.INSTANCE.getPortableGridItem(), syncId, playerInventory, portableGridData); + this.disabledSlot = portableGridData.slotReference().orElse(null); + this.onScreenReady(0); + } + + PortableGridItemContainerMenu(final int syncId, + final Inventory playerInventory, + final DiskInventory diskInventory, + final Grid grid, + final EnergyStorage energyStorage, + final SlotReference slotReference) { + super( + Menus.INSTANCE.getPortableGridItem(), + syncId, + playerInventory, + diskInventory, + grid, + energyStorage + ); + this.disabledSlot = slotReference; + this.onScreenReady(0); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java index 3ec8e8479..362cb3939 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.grid.GridData; -import com.refinedmods.refinedstorage.platform.common.grid.PortableGridData; -import com.refinedmods.refinedstorage.platform.common.storage.DiskInventory; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.grid.GridData; +import com.refinedmods.refinedstorage.common.grid.PortableGridData; +import com.refinedmods.refinedstorage.common.storage.DiskInventory; +import com.refinedmods.refinedstorage.common.support.containermenu.ExtendedMenuProvider; import java.util.Optional; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridLootItemFunction.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridLootItemFunction.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridLootItemFunction.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridLootItemFunction.java index be3e5310e..cbfe2f4f9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridLootItemFunction.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridLootItemFunction.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; -import com.refinedmods.refinedstorage.platform.common.content.LootFunctions; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyLootItemFunction; +import com.refinedmods.refinedstorage.common.content.LootFunctions; +import com.refinedmods.refinedstorage.common.support.energy.EnergyLootItemFunction; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridOperations.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridOperations.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridOperations.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridOperations.java index 617de242a..a4c090d4f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridOperations.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; @@ -8,7 +8,7 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage.platform.common.Platform; +import com.refinedmods.refinedstorage.common.Platform; class PortableGridOperations implements GridOperations { private final GridOperations delegate; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridScreen.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridScreen.java index df505d25a..914ded857 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridScreen.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; +package com.refinedmods.refinedstorage.common.storage.portablegrid; -import com.refinedmods.refinedstorage.platform.common.grid.screen.AbstractGridScreen; -import com.refinedmods.refinedstorage.platform.common.support.widget.ProgressWidget; +import com.refinedmods.refinedstorage.common.grid.screen.AbstractGridScreen; +import com.refinedmods.refinedstorage.common.support.widget.ProgressWidget; import javax.annotation.Nullable; @@ -11,7 +11,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class PortableGridScreen extends AbstractGridScreen { private static final int DISK_SLOT_WIDTH = 30; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridStorage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridStorage.java new file mode 100644 index 000000000..c586579c0 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridStorage.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage.common.storage.portablegrid; + +import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage; +import com.refinedmods.refinedstorage.api.storage.StorageState; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.api.storage.root.RootStorageImpl; + +class PortableGridStorage { + private final RootStorage rootStorage; + private final StateTrackedStorage diskStorage; + + PortableGridStorage(final StateTrackedStorage diskStorage) { + this.rootStorage = new RootStorageImpl(); + this.diskStorage = diskStorage; + this.rootStorage.addSource(diskStorage); + } + + StorageState getState() { + return diskStorage.getState(); + } + + RootStorage getRootStorage() { + return rootStorage; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridType.java new file mode 100644 index 000000000..46fb4756f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridType.java @@ -0,0 +1,6 @@ +package com.refinedmods.refinedstorage.common.storage.portablegrid; + +public enum PortableGridType { + NORMAL, + CREATIVE +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/package-info.java new file mode 100644 index 000000000..7cc89c12e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.storage.portablegrid; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlock.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlock.java index 052ec053d..f70618188 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlock.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; +package com.refinedmods.refinedstorage.common.storage.storageblock; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseBlock; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlockBlockEntity.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlockBlockEntity.java index c8d16fc78..1b5e2cb82 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlockBlockEntity.java @@ -1,20 +1,20 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; +package com.refinedmods.refinedstorage.common.storage.storageblock; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractStorageContainerNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageBlockEntity; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; -import com.refinedmods.refinedstorage.platform.common.storage.StorageConfigurationContainerImpl; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageBlockEntity; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.storage.StorageConfigurationContainerImpl; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; import java.util.Optional; import java.util.UUID; @@ -54,16 +54,16 @@ protected AbstractStorageBlockBlockEntity(final BlockEntityType type, this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters( ResourceContainerImpl.createForFilter(resourceFactory), this::setChanged, - mainNode.getStorageConfiguration()::setFilters + mainNetworkNode.getStorageConfiguration()::setFilters ); this.configContainer = new StorageConfigurationContainerImpl( - mainNode.getStorageConfiguration(), + mainNetworkNode.getStorageConfiguration(), filter, this::setChanged, this::getRedstoneMode, this::setRedstoneMode ); - mainNode.getStorageConfiguration().setNormalizer(filter.createNormalizer()); + mainNetworkNode.getStorageConfiguration().setNormalizer(filter.createNormalizer()); } protected abstract SerializableStorage createStorage(Runnable listener); @@ -82,11 +82,11 @@ public void setLevel(final Level level) { // (#setLevel(Level) -> #modifyStorageAfterAlreadyInitialized(UUID)). // In both cases listed above we need to clean up the storage we create here. storageId = UUID.randomUUID(); - final StorageRepository storageRepository = PlatformApi.INSTANCE.getStorageRepository(level); + final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getStorageRepository(level); final SerializableStorage storage = createStorage(storageRepository::markAsChanged); storageRepository.set(storageId, storage); } - mainNode.setProvider(this); + mainNetworkNode.setProvider(this); } @Override @@ -123,7 +123,7 @@ public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provide public void setStorageId(final UUID storageId) { tryRemoveCurrentStorage(storageId); this.storageId = storageId; - mainNode.onStorageChanged(0); + mainNetworkNode.onStorageChanged(0); } private void tryRemoveCurrentStorage(final UUID newStorageId) { @@ -134,7 +134,7 @@ private void tryRemoveCurrentStorage(final UUID newStorageId) { // we got placed with an existing storage ID (#setLevel(Level) -> #setStorageId(UUID)). // Clean up the storage created earlier in #setLevel(Level). LOGGER.info("Updating storage ID from {} to {}. Removing old storage", storageId, newStorageId); - final StorageRepository storageRepository = PlatformApi.INSTANCE.getStorageRepository(level); + final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getStorageRepository(level); storageRepository.removeIfEmpty(storageId).ifPresentOrElse( storage -> LOGGER.info("Storage {} successfully removed", storageId), () -> LOGGER.warn("Storage {} could not be removed", storageId) @@ -154,8 +154,8 @@ protected final ResourceContainer getFilterContainer() { @Override public StorageBlockData getMenuData() { return new StorageBlockData( - mainNode.getStored(), - mainNode.getCapacity(), + mainNetworkNode.getStored(), + mainNetworkNode.getCapacity(), ResourceContainerData.of(filter.getFilterContainer()) ); } @@ -170,7 +170,7 @@ public Optional resolve(final int index) { if (level == null || storageId == null) { return Optional.empty(); } - final StorageRepository storageRepository = PlatformApi.INSTANCE.getStorageRepository(level); + final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getStorageRepository(level); return storageRepository.get(storageId).map(Storage.class::cast); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlockContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlockContainerMenu.java new file mode 100644 index 000000000..e315bd92a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlockContainerMenu.java @@ -0,0 +1,87 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.storage.AbstractStorageContainerMenu; +import com.refinedmods.refinedstorage.common.storage.StorageAccessor; +import com.refinedmods.refinedstorage.common.storage.StorageConfigurationContainer; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlotType; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; + +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.inventory.Slot; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public abstract class AbstractStorageBlockContainerMenu extends AbstractStorageContainerMenu + implements StorageAccessor { + private static final int FILTER_SLOT_X = 8; + private static final int FILTER_SLOT_Y = 20; + + private long stored; + private long capacity; + + protected AbstractStorageBlockContainerMenu(final MenuType type, + final int syncId, + final Player player, + final StorageBlockData storageBlockData, + final ResourceFactory resourceFactory) { + super(type, syncId); + this.stored = storageBlockData.stored(); + this.capacity = storageBlockData.capacity(); + addSlots( + player, + ResourceContainerImpl.createForFilter(resourceFactory, storageBlockData.resourceContainerData()) + ); + } + + protected AbstractStorageBlockContainerMenu(final MenuType type, + final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { + super(type, syncId, player, configContainer); + addSlots(player, resourceContainer); + } + + private void addSlots(final Player player, final ResourceContainer resourceContainer) { + for (int i = 0; i < resourceContainer.size(); ++i) { + addSlot(createFilterSlot(resourceContainer, i)); + } + addPlayerInventory(player.getInventory(), 8, 141); + + transferManager.addFilterTransfer(player.getInventory()); + } + + private Slot createFilterSlot(final ResourceContainer resourceContainer, final int i) { + final int x = FILTER_SLOT_X + (18 * i); + return new ResourceSlot( + resourceContainer, + i, + createTranslation("gui", "storage.filter_help"), + x, + FILTER_SLOT_Y, + ResourceSlotType.FILTER + ); + } + + @Override + public double getProgress() { + if (capacity == 0) { + return 0; + } + return (double) getStored() / (double) getCapacity(); + } + + @Override + public long getCapacity() { + return capacity; + } + + @Override + public long getStored() { + return stored; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlockScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlockScreen.java new file mode 100644 index 000000000..19f05616e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/AbstractStorageBlockScreen.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.common.storage.AbstractProgressStorageScreen; + +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +abstract class AbstractStorageBlockScreen extends AbstractProgressStorageScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/storage.png"); + + protected AbstractStorageBlockScreen(final AbstractStorageBlockContainerMenu menu, + final Inventory inventory, + final Component title) { + super(menu, inventory, title, 80); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlock.java new file mode 100644 index 000000000..1c0261f2c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlock.java @@ -0,0 +1,27 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; + +public class FluidStorageBlock extends AbstractStorageBlock { + private final FluidStorageVariant variant; + + public FluidStorageBlock(final FluidStorageVariant variant) { + super( + BlockConstants.PROPERTIES, + new NetworkNodeBlockEntityTicker<>(() -> BlockEntities.INSTANCE.getFluidStorageBlock(variant)) + ); + this.variant = variant; + } + + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new FluidStorageBlockBlockEntity(pos, state, variant); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java new file mode 100644 index 000000000..675d27996 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java @@ -0,0 +1,71 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.StorageTypes; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class FluidStorageBlockBlockEntity extends AbstractStorageBlockBlockEntity { + private final FluidStorageVariant variant; + private final Component displayName; + + public FluidStorageBlockBlockEntity(final BlockPos pos, + final BlockState state, + final FluidStorageVariant variant) { + super( + BlockEntities.INSTANCE.getFluidStorageBlock(variant), + pos, + state, + new StorageNetworkNode(getEnergyUsage(variant), 0, 1), + RefinedStorageApi.INSTANCE.getFluidResourceFactory() + ); + this.variant = variant; + this.displayName = createTranslation( + "block", + String.format("%s_fluid_storage_block", variant.getName()) + ); + } + + private static long getEnergyUsage(final FluidStorageVariant variant) { + return switch (variant) { + case SIXTY_FOUR_B -> Platform.INSTANCE.getConfig().getFluidStorageBlock().get64bEnergyUsage(); + case TWO_HUNDRED_FIFTY_SIX_B -> Platform.INSTANCE.getConfig().getFluidStorageBlock().get256bEnergyUsage(); + case THOUSAND_TWENTY_FOUR_B -> Platform.INSTANCE.getConfig().getFluidStorageBlock().get1024bEnergyUsage(); + case FOUR_THOUSAND_NINETY_SIX_B -> + Platform.INSTANCE.getConfig().getFluidStorageBlock().get4096bEnergyUsage(); + case CREATIVE -> Platform.INSTANCE.getConfig().getFluidStorageBlock().getCreativeEnergyUsage(); + }; + } + + @Override + protected SerializableStorage createStorage(final Runnable listener) { + return StorageTypes.FLUID.create(variant.getCapacity(), listener); + } + + @Override + public Component getDisplayName() { + return displayName; + } + + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new FluidStorageBlockContainerMenu( + syncId, + player, + getFilterContainer(), + configContainer + ); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java new file mode 100644 index 000000000..7c334447c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java @@ -0,0 +1,93 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerBlockItem; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; + +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class FluidStorageBlockBlockItem extends AbstractStorageContainerBlockItem { + private static final Component CREATIVE_HELP = createTranslation("item", "creative_fluid_storage_block.help"); + + private final FluidStorageVariant variant; + private final Component helpText; + + public FluidStorageBlockBlockItem(final Block block, final FluidStorageVariant variant) { + super( + block, + new Item.Properties().stacksTo(1).fireResistant(), + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() + ); + this.variant = variant; + this.helpText = getHelpText(variant); + } + + private static Component getHelpText(final FluidStorageVariant variant) { + if (variant.getCapacityInBuckets() == null) { + return CREATIVE_HELP; + } + return createTranslation( + "item", + "fluid_storage_block.help", + AmountFormatting.format(variant.getCapacityInBuckets()) + ); + } + + @Override + protected boolean hasCapacity() { + return variant.hasCapacity(); + } + + @Override + protected String formatAmount(final long amount) { + return FluidResourceRendering.format(amount); + } + + @Override + protected ItemStack createPrimaryDisassemblyByproduct(final int count) { + return new ItemStack(Blocks.INSTANCE.getMachineCasing(), count); + } + + @Override + @Nullable + protected ItemStack createSecondaryDisassemblyByproduct(final int count) { + if (variant == FluidStorageVariant.CREATIVE) { + return null; + } + return new ItemStack(Items.INSTANCE.getFluidStoragePart(variant), count); + } + + @Override + protected boolean placeBlock(final BlockPlaceContext ctx, final BlockState state) { + if (ctx.getPlayer() instanceof ServerPlayer serverPlayer && !(RefinedStorageApi.INSTANCE.canPlaceNetworkNode( + serverPlayer, + ctx.getLevel(), + ctx.getClickedPos(), + state))) { + return false; + } + return super.placeBlock(ctx, state); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(helpText)); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockContainerMenu.java new file mode 100644 index 000000000..bc34a5dd2 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockContainerMenu.java @@ -0,0 +1,35 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.storage.StorageConfigurationContainer; + +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +public class FluidStorageBlockContainerMenu extends AbstractStorageBlockContainerMenu { + public FluidStorageBlockContainerMenu(final int syncId, + final Inventory playerInventory, + final StorageBlockData storageBlockData) { + super( + Menus.INSTANCE.getFluidStorage(), + syncId, + playerInventory.player, + storageBlockData, + RefinedStorageApi.INSTANCE.getFluidResourceFactory() + ); + } + + FluidStorageBlockContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { + super(Menus.INSTANCE.getFluidStorage(), syncId, player, resourceContainer, configContainer); + } + + @Override + public boolean hasCapacity() { + return getCapacity() > 0; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockScreen.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockScreen.java index 4372a29fe..e9e9e344d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; +package com.refinedmods.refinedstorage.common.storage.storageblock; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlock.java new file mode 100644 index 000000000..4b7e9a36d --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlock.java @@ -0,0 +1,27 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; + +public class ItemStorageBlock extends AbstractStorageBlock { + private final ItemStorageVariant variant; + + public ItemStorageBlock(final ItemStorageVariant variant) { + super( + BlockConstants.PROPERTIES, + new NetworkNodeBlockEntityTicker<>(() -> BlockEntities.INSTANCE.getItemStorageBlock(variant)) + ); + this.variant = variant; + } + + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new ItemStorageBlockBlockEntity(pos, state, variant); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java new file mode 100644 index 000000000..4c2507d88 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java @@ -0,0 +1,67 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.StorageTypes; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ItemStorageBlockBlockEntity extends AbstractStorageBlockBlockEntity { + private final ItemStorageVariant variant; + private final Component displayName; + + public ItemStorageBlockBlockEntity(final BlockPos pos, + final BlockState state, + final ItemStorageVariant variant) { + super( + BlockEntities.INSTANCE.getItemStorageBlock(variant), + pos, + state, + new StorageNetworkNode(getEnergyUsage(variant), 0, 1), + RefinedStorageApi.INSTANCE.getItemResourceFactory() + ); + this.variant = variant; + this.displayName = createTranslation("block", String.format("%s_storage_block", variant.getName())); + } + + private static long getEnergyUsage(final ItemStorageVariant variant) { + return switch (variant) { + case ONE_K -> Platform.INSTANCE.getConfig().getStorageBlock().get1kEnergyUsage(); + case FOUR_K -> Platform.INSTANCE.getConfig().getStorageBlock().get4kEnergyUsage(); + case SIXTEEN_K -> Platform.INSTANCE.getConfig().getStorageBlock().get16kEnergyUsage(); + case SIXTY_FOUR_K -> Platform.INSTANCE.getConfig().getStorageBlock().get64kEnergyUsage(); + case CREATIVE -> Platform.INSTANCE.getConfig().getStorageBlock().getCreativeEnergyUsage(); + }; + } + + @Override + protected SerializableStorage createStorage(final Runnable listener) { + return StorageTypes.ITEM.create(variant.getCapacity(), listener); + } + + @Override + public Component getDisplayName() { + return displayName; + } + + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new ItemStorageBlockContainerMenu( + syncId, + player, + getFilterContainer(), + configContainer + ); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java new file mode 100644 index 000000000..99cdb125a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java @@ -0,0 +1,84 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerBlockItem; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; + +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ItemStorageBlockBlockItem extends AbstractStorageContainerBlockItem { + private static final Component CREATIVE_HELP = createTranslation("item", "creative_storage_block.help"); + + private final ItemStorageVariant variant; + private final Component helpText; + + public ItemStorageBlockBlockItem(final Block block, final ItemStorageVariant variant) { + super( + block, + new Item.Properties().stacksTo(1).fireResistant(), + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() + ); + this.variant = variant; + this.helpText = variant.getCapacity() == null + ? CREATIVE_HELP + : createTranslation("item", "storage_block.help", AmountFormatting.format(variant.getCapacity())); + } + + @Override + protected boolean hasCapacity() { + return variant.hasCapacity(); + } + + @Override + protected String formatAmount(final long amount) { + return AmountFormatting.format(amount); + } + + @Override + protected ItemStack createPrimaryDisassemblyByproduct(final int count) { + return new ItemStack(Blocks.INSTANCE.getMachineCasing(), count); + } + + @Override + @Nullable + protected ItemStack createSecondaryDisassemblyByproduct(final int count) { + if (variant == ItemStorageVariant.CREATIVE) { + return null; + } + return new ItemStack(Items.INSTANCE.getItemStoragePart(variant), count); + } + + @Override + protected boolean placeBlock(final BlockPlaceContext ctx, final BlockState state) { + if (ctx.getPlayer() instanceof ServerPlayer serverPlayer && !(RefinedStorageApi.INSTANCE.canPlaceNetworkNode( + serverPlayer, + ctx.getLevel(), + ctx.getClickedPos(), + state + ))) { + return false; + } + return super.placeBlock(ctx, state); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(helpText)); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockContainerMenu.java new file mode 100644 index 000000000..b192a82b2 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockContainerMenu.java @@ -0,0 +1,35 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.storage.StorageConfigurationContainer; + +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +public class ItemStorageBlockContainerMenu extends AbstractStorageBlockContainerMenu { + public ItemStorageBlockContainerMenu(final int syncId, + final Inventory playerInventory, + final StorageBlockData storageBlockData) { + super( + Menus.INSTANCE.getItemStorage(), + syncId, + playerInventory.player, + storageBlockData, + RefinedStorageApi.INSTANCE.getItemResourceFactory() + ); + } + + ItemStorageBlockContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { + super(Menus.INSTANCE.getItemStorage(), syncId, player, resourceContainer, configContainer); + } + + @Override + public boolean hasCapacity() { + return getCapacity() > 0; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockScreen.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockScreen.java index 408c0e44d..fbae1c186 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockScreen.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; +package com.refinedmods.refinedstorage.common.storage.storageblock; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/StorageBlockData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/StorageBlockData.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/StorageBlockData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/StorageBlockData.java index 405134f9c..fbaf7ea16 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/StorageBlockData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/StorageBlockData.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; +package com.refinedmods.refinedstorage.common.storage.storageblock; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/StorageBlockLootItemFunction.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/StorageBlockLootItemFunction.java new file mode 100644 index 000000000..15e2c65b3 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/StorageBlockLootItemFunction.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.StorageBlockEntity; +import com.refinedmods.refinedstorage.common.content.LootFunctions; + +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.storage.loot.functions.LootItemFunction; +import net.minecraft.world.level.storage.loot.functions.LootItemFunctionType; +import net.minecraft.world.level.storage.loot.parameters.LootContextParams; + +public class StorageBlockLootItemFunction implements LootItemFunction { + @Override + public LootItemFunctionType getType() { + return LootFunctions.INSTANCE.getStorageBlock(); + } + + @Override + public ItemStack apply(final ItemStack stack, final LootContext lootContext) { + final BlockEntity blockEntity = lootContext.getParam(LootContextParams.BLOCK_ENTITY); + if (blockEntity instanceof StorageBlockEntity transferable) { + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().transferFromBlockEntity(stack, transferable); + } + return stack; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/package-info.java new file mode 100644 index 000000000..6bcaca763 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.storage.storageblock; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java new file mode 100644 index 000000000..7a76aa02a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java @@ -0,0 +1,83 @@ +package com.refinedmods.refinedstorage.common.storage.storagedisk; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerItem; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.StorageTypes; +import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; + +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class FluidStorageDiskItem extends AbstractStorageContainerItem { + private static final Component CREATIVE_HELP = createTranslation("item", "creative_fluid_storage_disk.help"); + + private final FluidStorageVariant variant; + private final Component helpText; + + public FluidStorageDiskItem(final FluidStorageVariant variant) { + super( + new Item.Properties().stacksTo(1).fireResistant(), + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() + ); + this.variant = variant; + this.helpText = getHelpText(variant); + } + + private static Component getHelpText(final FluidStorageVariant variant) { + if (variant.getCapacityInBuckets() == null) { + return CREATIVE_HELP; + } + return createTranslation( + "item", + "fluid_storage_disk.help", + AmountFormatting.format(variant.getCapacityInBuckets()) + ); + } + + @Override + protected boolean hasCapacity() { + return variant.hasCapacity(); + } + + @Override + protected String formatAmount(final long amount) { + return FluidResourceRendering.format(amount); + } + + @Override + protected SerializableStorage createStorage(final StorageRepository storageRepository) { + return StorageTypes.FLUID.create(variant.getCapacity(), storageRepository::markAsChanged); + } + + @Override + protected ItemStack createPrimaryDisassemblyByproduct(final int count) { + return new ItemStack(Items.INSTANCE.getStorageHousing(), count); + } + + @Override + @Nullable + protected ItemStack createSecondaryDisassemblyByproduct(final int count) { + if (variant == FluidStorageVariant.CREATIVE) { + return null; + } + return new ItemStack(Items.INSTANCE.getFluidStoragePart(variant), count); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(helpText)); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java new file mode 100644 index 000000000..8b72454ee --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java @@ -0,0 +1,73 @@ +package com.refinedmods.refinedstorage.common.storage.storagedisk; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerItem; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.StorageTypes; + +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class ItemStorageDiskItem extends AbstractStorageContainerItem { + private static final Component CREATIVE_HELP = createTranslation("item", "creative_storage_disk.help"); + + private final ItemStorageVariant variant; + private final Component helpText; + + public ItemStorageDiskItem(final ItemStorageVariant variant) { + super( + new Item.Properties().stacksTo(1).fireResistant(), + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() + ); + this.variant = variant; + this.helpText = variant.getCapacity() == null + ? CREATIVE_HELP + : createTranslation("item", "storage_disk.help", AmountFormatting.format(variant.getCapacity())); + } + + @Override + protected boolean hasCapacity() { + return variant.hasCapacity(); + } + + @Override + protected String formatAmount(final long amount) { + return AmountFormatting.format(amount); + } + + @Override + protected SerializableStorage createStorage(final StorageRepository storageRepository) { + return StorageTypes.ITEM.create(variant.getCapacity(), storageRepository::markAsChanged); + } + + @Override + protected ItemStack createPrimaryDisassemblyByproduct(final int count) { + return new ItemStack(Items.INSTANCE.getStorageHousing(), count); + } + + @Override + @Nullable + protected ItemStack createSecondaryDisassemblyByproduct(final int count) { + if (variant == ItemStorageVariant.CREATIVE) { + return null; + } + return new ItemStack(Items.INSTANCE.getItemStoragePart(variant), count); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(helpText)); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/package-info.java new file mode 100644 index 000000000..ff4bca92b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.storage.storagedisk; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/CompositeStorageMonitorExtractionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/CompositeStorageMonitorExtractionStrategy.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/CompositeStorageMonitorExtractionStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/CompositeStorageMonitorExtractionStrategy.java index 055531047..cff96de1e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/CompositeStorageMonitorExtractionStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/CompositeStorageMonitorExtractionStrategy.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; +package com.refinedmods.refinedstorage.common.storagemonitor; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorExtractionStrategy; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/CompositeStorageMonitorInsertionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/CompositeStorageMonitorInsertionStrategy.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/CompositeStorageMonitorInsertionStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/CompositeStorageMonitorInsertionStrategy.java index 64ab92ce9..8ad131487 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/CompositeStorageMonitorInsertionStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/CompositeStorageMonitorInsertionStrategy.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; +package com.refinedmods.refinedstorage.common.storagemonitor; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorInsertionStrategy; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/FluidStorageMonitorExtractionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/FluidStorageMonitorExtractionStrategy.java new file mode 100644 index 000000000..e59b88a57 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/FluidStorageMonitorExtractionStrategy.java @@ -0,0 +1,41 @@ +package com.refinedmods.refinedstorage.common.storagemonitor; + +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.TransferHelper; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage.common.storage.BucketPlayerInventoryInsertableStorage; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; + +import net.minecraft.world.entity.player.Player; + +public class FluidStorageMonitorExtractionStrategy implements StorageMonitorExtractionStrategy { + @Override + public boolean extract(final ResourceKey resource, + final boolean fullStack, + final Player player, + final Actor actor, + final Network network) { + if (!(resource instanceof FluidResource fluidResource)) { + return false; + } + final BucketPlayerInventoryInsertableStorage target = new BucketPlayerInventoryInsertableStorage( + player.getInventory(), + network.getComponent(StorageNetworkComponent.class), + true + ); + final RootStorage source = network.getComponent(StorageNetworkComponent.class); + return TransferHelper.transfer( + fluidResource, + Platform.INSTANCE.getBucketAmount(), + actor, + source, + target, + source + ) > 0; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/FluidStorageMonitorInsertionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/FluidStorageMonitorInsertionStrategy.java new file mode 100644 index 000000000..6e6ee16a9 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/FluidStorageMonitorInsertionStrategy.java @@ -0,0 +1,65 @@ +package com.refinedmods.refinedstorage.common.storagemonitor; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; + +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.world.item.ItemStack; + +public class FluidStorageMonitorInsertionStrategy implements StorageMonitorInsertionStrategy { + @Override + public Optional insert( + final ResourceKey configuredResource, + final ItemStack stack, + final Actor actor, + final Network network + ) { + if (!(configuredResource instanceof FluidResource configuredFluidResource)) { + return Optional.empty(); + } + final RootStorage fluidRootStorage = network.getComponent(StorageNetworkComponent.class); + return Platform.INSTANCE.drainContainer(stack) + .map(extracted -> tryInsert(actor, configuredFluidResource, extracted, fluidRootStorage)) + .map(extracted -> doInsert(actor, extracted, fluidRootStorage)); + } + + @Nullable + private FluidOperationResult tryInsert(final Actor actor, + final FluidResource configuredResource, + final FluidOperationResult result, + final RootStorage rootStorage) { + if (!result.fluid().equals(configuredResource)) { + return null; + } + final long insertedSimulated = rootStorage.insert( + result.fluid(), + result.amount(), + Action.SIMULATE, + actor + ); + final boolean insertedSuccessfully = insertedSimulated == result.amount(); + return insertedSuccessfully ? result : null; + } + + private ItemStack doInsert(final Actor actor, + final FluidOperationResult result, + final RootStorage rootStorage) { + rootStorage.insert( + result.fluid(), + result.amount(), + Action.EXECUTE, + actor + ); + return result.container(); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java index 92f42ab05..99fc0e8c6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java @@ -1,19 +1,18 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; +package com.refinedmods.refinedstorage.common.storagemonitor; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; public class ItemStorageMonitorExtractionStrategy implements StorageMonitorExtractionStrategy { @Override - @SuppressWarnings("deprecation") public boolean extract(final ResourceKey resource, final boolean fullStack, final Player player, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorInsertionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/ItemStorageMonitorInsertionStrategy.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorInsertionStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/ItemStorageMonitorInsertionStrategy.java index 9d85bf6ed..47f40dbfc 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorInsertionStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/ItemStorageMonitorInsertionStrategy.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; +package com.refinedmods.refinedstorage.common.storagemonitor; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlock.java similarity index 80% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlock.java index ea1603d7e..6168adf7b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlock.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; +package com.refinedmods.refinedstorage.common.storagemonitor; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.direction.BiDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; @@ -30,7 +30,7 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class StorageMonitorBlock extends AbstractDirectionalBlock implements EntityBlock { private static final Component HELP = createTranslation("item", "storage_monitor.help"); @@ -80,7 +80,6 @@ protected ItemInteractionResult useItemOn(final ItemStack stack, } @Override - @SuppressWarnings("deprecation") public void attack(final BlockState state, final Level level, final BlockPos pos, final Player player) { super.attack(state, level, pos, player); if (level.isClientSide()) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntity.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntity.java index f7a4e2330..443fd19d2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntity.java @@ -1,25 +1,25 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; +package com.refinedmods.refinedstorage.common.storagemonitor; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.api.storage.channel.FuzzyStorageChannel; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; +import com.refinedmods.refinedstorage.common.api.storage.root.FuzzyRootStorage; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; import javax.annotation.Nullable; @@ -81,7 +81,7 @@ public void doWork() { private void trySendDisplayUpdate(final Level level) { final long amount = getAmount(); - final boolean active = mainNode.isActive(); + final boolean active = mainNetworkNode.isActive(); if ((amount != currentAmount || active != currentlyActive) && displayUpdateRateLimiter.tryAcquire()) { sendDisplayUpdate(level, amount, active); } @@ -92,7 +92,7 @@ private long getAmount() { if (configuredResource == null) { return 0; } - final Network network = mainNode.getNetwork(); + final Network network = mainNetworkNode.getNetwork(); if (network == null) { return 0; } @@ -100,18 +100,18 @@ private long getAmount() { } private long getAmount(final Network network, final ResourceKey configuredResource) { - final StorageChannel storageChannel = network.getComponent(StorageNetworkComponent.class); - if (!filter.isFuzzyMode() || !(storageChannel instanceof FuzzyStorageChannel fuzzyStorageChannel)) { - return storageChannel.get(configuredResource).map(ResourceAmount::getAmount).orElse(0L); + final RootStorage rootStorage = network.getComponent(StorageNetworkComponent.class); + if (!filter.isFuzzyMode() || !(rootStorage instanceof FuzzyRootStorage fuzzyRootStorage)) { + return rootStorage.get(configuredResource).map(ResourceAmount::getAmount).orElse(0L); } - return fuzzyStorageChannel.getFuzzy(configuredResource).stream().mapToLong(ResourceAmount::getAmount).sum(); + return fuzzyRootStorage.getFuzzy(configuredResource).stream().mapToLong(ResourceAmount::getAmount).sum(); } public void extract(final Player player) { if (level == null) { return; } - final Network network = mainNode.getNetwork(); + final Network network = mainNetworkNode.getNetwork(); if (network == null) { return; } @@ -128,7 +128,7 @@ private void doExtract( final ResourceKey configuredResource, final Network network ) { - final boolean success = PlatformApi.INSTANCE.getStorageMonitorExtractionStrategy().extract( + final boolean success = RefinedStorageApi.INSTANCE.getStorageMonitorExtractionStrategy().extract( configuredResource, !player.isShiftKeyDown(), player, @@ -156,7 +156,7 @@ public void insert(final Player player, final InteractionHand hand) { } private boolean doInsert(final Player player, final InteractionHand hand) { - final Network network = mainNode.getNetwork(); + final Network network = mainNetworkNode.getNetwork(); if (network == null) { return false; } @@ -178,7 +178,7 @@ private boolean doInsert( final ResourceKey configuredResource, final Network network ) { - return PlatformApi.INSTANCE.getStorageMonitorInsertionStrategy().insert( + return RefinedStorageApi.INSTANCE.getStorageMonitorInsertionStrategy().insert( configuredResource, heldStack, new PlayerActor(player), @@ -197,7 +197,7 @@ private boolean doInsertAll(final Player player) { } private boolean doInsertAll(final Player player, final ItemResource lastInsertedItem) { - final Network network = mainNode.getNetwork(); + final Network network = mainNetworkNode.getNetwork(); if (network == null) { return false; } @@ -227,7 +227,7 @@ private boolean tryInsertSlot( if (!itemInSlot.equals(lastInsertedItem)) { return false; } - return PlatformApi.INSTANCE.getStorageMonitorInsertionStrategy().insert( + return RefinedStorageApi.INSTANCE.getStorageMonitorInsertionStrategy().insert( configuredResource, slot, new PlayerActor(player), @@ -320,7 +320,7 @@ private void sendDisplayUpdate() { if (level == null) { return; } - sendDisplayUpdate(level, getAmount(), mainNode.isActive()); + sendDisplayUpdate(level, getAmount(), mainNetworkNode.isActive()); } private void sendDisplayUpdate(final Level level, final long amount, final boolean active) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlockEntityRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlockEntityRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java index ad55a397a..519001ddf 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlockEntityRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; +package com.refinedmods.refinedstorage.common.storagemonitor; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirectionType; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.direction.BiDirectionType; import javax.annotation.Nullable; @@ -61,7 +61,7 @@ private void doRender(final Level level, final BiDirection direction, final ResourceKey resource, final long amount) { - final ResourceRendering resourceRendering = PlatformApi.INSTANCE.getResourceRendering(resource); + final ResourceRendering resourceRendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource); doRender( poseStack, vertexConsumers, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorContainerMenu.java new file mode 100644 index 000000000..5a2633394 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorContainerMenu.java @@ -0,0 +1,56 @@ +package com.refinedmods.refinedstorage.common.storagemonitor; + +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlotType; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class StorageMonitorContainerMenu extends AbstractResourceContainerMenu { + private static final Component FILTER_HELP = createTranslation("gui", "storage_monitor.filter_help"); + + public StorageMonitorContainerMenu(final int syncId, + final Inventory playerInventory, + final ResourceContainerData resourceContainerData) { + super(Menus.INSTANCE.getStorageMonitor(), syncId); + registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + addSlots(playerInventory, ResourceContainerImpl.createForFilter(resourceContainerData)); + } + + StorageMonitorContainerMenu(final int syncId, + final Player player, + final StorageMonitorBlockEntity storageMonitor, + final ResourceContainer resourceContainer) { + super(Menus.INSTANCE.getStorageMonitor(), syncId, player); + registerProperty(new ServerProperty<>( + PropertyTypes.FUZZY_MODE, + storageMonitor::isFuzzyMode, + storageMonitor::setFuzzyMode + )); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + storageMonitor::getRedstoneMode, + storageMonitor::setRedstoneMode + )); + addSlots(player.getInventory(), resourceContainer); + } + + private void addSlots(final Inventory playerInventory, final ResourceContainer resourceContainer) { + addSlot(new ResourceSlot(resourceContainer, 0, FILTER_HELP, 80, 20, ResourceSlotType.FILTER)); + addPlayerInventory(playerInventory, 8, 55); + transferManager.addFilterTransfer(playerInventory); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorInsertTracker.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorInsertTracker.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorInsertTracker.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorInsertTracker.java index 2ee78886b..328a19653 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorInsertTracker.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorInsertTracker.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; +package com.refinedmods.refinedstorage.common.storagemonitor; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorScreen.java new file mode 100644 index 000000000..483bddc7b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorScreen.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage.common.storagemonitor; + +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; + +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public class StorageMonitorScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/storage_monitor.png"); + + public StorageMonitorScreen(final StorageMonitorContainerMenu menu, + final Inventory playerInventory, + final Component text) { + super(menu, playerInventory, text); + this.inventoryLabelY = 43; + this.imageWidth = 211; + this.imageHeight = 137; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + addSideButton(new FuzzyModeSideButtonWidget( + getMenu().getProperty(PropertyTypes.FUZZY_MODE), + () -> FuzzyModeSideButtonWidget.Type.GENERIC + )); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/package-info.java new file mode 100644 index 000000000..08a5218e1 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.storagemonitor; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractActiveColoredDirectionalBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractActiveColoredDirectionalBlock.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractActiveColoredDirectionalBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractActiveColoredDirectionalBlock.java index 7da5d14da..f11939e12 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractActiveColoredDirectionalBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractActiveColoredDirectionalBlock.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; import net.minecraft.network.chat.MutableComponent; import net.minecraft.util.StringRepresentable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseBlock.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseBlock.java index db3599dbd..591b5f0fc 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseBlock.java @@ -1,16 +1,17 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.network.NetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.Sounds; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeMenuProvider; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.Sounds; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeMenuProvider; import java.util.Optional; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; @@ -36,7 +37,7 @@ import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.shapes.VoxelShape; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public abstract class AbstractBaseBlock extends Block { private static final TagKey WRENCH_TAG = TagKey.create( @@ -97,21 +98,19 @@ private Optional tryOpenScreen(final BlockState state, private void tryOpenScreen(final ServerPlayer player, final MenuProvider menuProvider) { if (menuProvider instanceof NetworkNodeMenuProvider networkNodeMenuProvider && !networkNodeMenuProvider.canOpen(player)) { - PlatformApi.INSTANCE.sendNoPermissionToOpenMessage(player, getName()); + RefinedStorageApi.INSTANCE.sendNoPermissionToOpenMessage(player, getName()); return; } Platform.INSTANCE.getMenuOpener().openMenu(player, menuProvider); } @Override - @SuppressWarnings("deprecation") public MenuProvider getMenuProvider(final BlockState state, final Level level, final BlockPos pos) { final BlockEntity blockEntity = level.getBlockEntity(pos); return blockEntity instanceof MenuProvider provider ? provider : null; } @Override - @SuppressWarnings("deprecation") public void onRemove(final BlockState state, final Level level, final BlockPos pos, @@ -181,18 +180,18 @@ private boolean dismantleOrRotate(final BlockState state, if (player.isCrouching()) { return dismantle(state, level, hitResult, player); } else { - return rotate(state, level, hitResult.getBlockPos(), player); + return rotate(state, level, hitResult.getBlockPos(), hitResult.getDirection(), player); } } private boolean rotate(final BlockState state, final Level level, final BlockPos pos, + final Direction direction, final ServerPlayer player) { - final BlockEntity blockEntity = level.getBlockEntity(pos); - if (blockEntity instanceof NetworkNodeContainerBlockEntity networkNodeContainerBlockEntity - && !networkNodeContainerBlockEntity.canBuild(player)) { - PlatformApi.INSTANCE.sendNoPermissionMessage( + final NetworkNodeContainerProvider provider = Platform.INSTANCE.getContainerProvider(level, pos, direction); + if (provider != null && !provider.canBuild(player)) { + RefinedStorageApi.INSTANCE.sendNoPermissionMessage( player, createTranslation("misc", "no_permission.build.rotate", getName()) ); @@ -203,7 +202,6 @@ private boolean rotate(final BlockState state, return !state.equals(rotated); } - @SuppressWarnings("deprecation") protected BlockState getRotatedBlockState(final BlockState state, final Level level, final BlockPos pos) { return state.rotate(Rotation.CLOCKWISE_90); } @@ -216,15 +214,19 @@ private boolean dismantle(final BlockState state, final Level level, final BlockHitResult hitResult, final ServerPlayer player) { - final BlockEntity blockEntity = level.getBlockEntity(hitResult.getBlockPos()); - if (blockEntity instanceof NetworkNodeContainerBlockEntity networkNodeContainerBlockEntity - && !networkNodeContainerBlockEntity.canBuild(player)) { - PlatformApi.INSTANCE.sendNoPermissionMessage( + final NetworkNodeContainerProvider provider = Platform.INSTANCE.getContainerProvider( + level, + hitResult.getBlockPos(), + hitResult.getDirection() + ); + if (provider != null && !provider.canBuild(player)) { + RefinedStorageApi.INSTANCE.sendNoPermissionMessage( player, createTranslation("misc", "no_permission.build.dismantle", getName()) ); return false; } + final BlockEntity blockEntity = level.getBlockEntity(hitResult.getBlockPos()); final ItemStack stack = Platform.INSTANCE.getCloneItemStack(state, level, hitResult, player); if (blockEntity != null) { blockEntity.saveToItem(stack, level.registryAccess()); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseContainerMenu.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseContainerMenu.java index 544bf430f..857aafcc9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseContainerMenu.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.DisabledSlot; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.Property; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.TransferManager; +package com.refinedmods.refinedstorage.common.support; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.DisabledSlot; +import com.refinedmods.refinedstorage.common.support.containermenu.Property; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyType; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.TransferManager; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java index d4ae30e09..6c642ed05 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java @@ -1,21 +1,21 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeMapping; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.amount.ResourceAmountScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlot; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.HelpClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.SmallTextClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeItemClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeSlot; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeMapping; +import com.refinedmods.refinedstorage.common.support.amount.ResourceAmountScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage.common.support.tooltip.HelpClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.tooltip.MouseClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.tooltip.SmallTextClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeItemClientTooltipComponent; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeSlot; import java.util.ArrayList; import java.util.Collections; @@ -34,8 +34,9 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; +import org.apiguardian.api.API; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslationAsHeading; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslationAsHeading; import static java.util.Objects.requireNonNullElse; public abstract class AbstractBaseScreen extends AbstractContainerScreen { @@ -124,7 +125,7 @@ private void renderResourceSlot(final GuiGraphics graphics, final ResourceKey resource, final long amount, final boolean renderAmount) { - final ResourceRendering rendering = PlatformApi.INSTANCE.getResourceRendering(resource); + final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource); rendering.render(resource, graphics, x, y); if (renderAmount) { renderResourceSlotAmount(graphics, x, y, amount, rendering); @@ -171,6 +172,7 @@ public void addSideButton(final AbstractSideButtonWidget button) { addRenderableWidget(button); } + @API(status = API.Status.INTERNAL) public List getExclusionZones() { return exclusionZones; } @@ -243,30 +245,26 @@ private List getResourceSlotHelpTooltip(final ItemStack } final List lines = new ArrayList<>(); resourceSlot.getPrimaryResourceFactory().create(carried).ifPresent(primaryResourceInstance -> lines.add( - new MouseWithIconClientTooltipComponent( - MouseWithIconClientTooltipComponent.Type.LEFT, - getResourceRendering(primaryResourceInstance.getResource()), + MouseClientTooltipComponent.resource( + MouseClientTooltipComponent.Type.LEFT, + primaryResourceInstance.getResource(), null ) )); for (final ResourceFactory alternativeResourceFactory : resourceSlot.getAlternativeResourceFactories()) { final var result = alternativeResourceFactory.create(carried); - result.ifPresent(alternativeResourceInstance -> lines.add(new MouseWithIconClientTooltipComponent( - MouseWithIconClientTooltipComponent.Type.RIGHT, - getResourceRendering(alternativeResourceInstance.getResource()), + result.ifPresent(alternativeResourceInstance -> lines.add(MouseClientTooltipComponent.resource( + MouseClientTooltipComponent.Type.RIGHT, + alternativeResourceInstance.getResource(), null ))); } return lines; } - public static MouseWithIconClientTooltipComponent.IconRenderer getResourceRendering(final ResourceKey resource) { - return (graphics, x, y) -> PlatformApi.INSTANCE.getResourceRendering(resource).render(resource, graphics, x, y); - } - private List getTooltipForResource(final ResourceKey resource, final ResourceSlot resourceSlot) { - final List tooltip = PlatformApi.INSTANCE + final List tooltip = RefinedStorageApi.INSTANCE .getResourceRendering(resource) .getTooltip(resource) .stream() @@ -276,6 +274,18 @@ private List getTooltipForResource(final ResourceKey res if (!resourceSlot.isDisabled() && !resourceSlot.supportsItemSlotInteractions()) { tooltip.add(CLICK_TO_CLEAR); } + if (resourceSlot.supportsItemSlotInteractions()) { + RefinedStorageApi.INSTANCE.getResourceContainerInsertStrategies() + .stream() + .flatMap(strategy -> strategy.getConversionInfo(resource).stream()) + .map(conversionInfo -> MouseClientTooltipComponent.itemConversion( + MouseClientTooltipComponent.Type.LEFT, + conversionInfo.from(), + conversionInfo.to(), + null + )) + .forEach(tooltip::add); + } return tooltip; } @@ -307,6 +317,7 @@ private boolean tryOpenResourceAmountScreen(final ResourceSlot slot) { } @Nullable + @API(status = API.Status.INTERNAL) public PlatformResourceKey getHoveredResource() { if (hoveredSlot instanceof ResourceSlot resourceSlot) { return resourceSlot.getResource(); @@ -314,10 +325,12 @@ public PlatformResourceKey getHoveredResource() { return null; } + @API(status = API.Status.INTERNAL) public int getLeftPos() { return leftPos; } + @API(status = API.Status.INTERNAL) public int getTopPos() { return topPos; } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBlockEntityTicker.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBlockEntityTicker.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBlockEntityTicker.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBlockEntityTicker.java index d51d8b715..c05779d9a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBlockEntityTicker.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBlockEntityTicker.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractColoredBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractColoredBlock.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractColoredBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractColoredBlock.java index 53881b263..8ff35f56a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractColoredBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractColoredBlock.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.item.DyeColor; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractDirectionalBlock.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractDirectionalBlock.java index c358b8846..c1128fd88 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractDirectionalBlock.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; import java.util.Objects; import javax.annotation.Nullable; @@ -87,4 +87,12 @@ public static boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockSt newDirectionalBlock.getDirection(newBlockState) ); } + + @Nullable + public static Direction tryExtractDirection(final BlockState blockState) { + if (!(blockState.getBlock() instanceof AbstractDirectionalBlock directionalBlock)) { + return null; + } + return directionalBlock.extractDirection(blockState); + } } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalCableBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractDirectionalCableBlock.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalCableBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractDirectionalCableBlock.java index f35442e7e..ad11b4043 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalCableBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractDirectionalCableBlock.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.support.direction.DefaultDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.support.direction.DefaultDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; import java.util.Map; import java.util.Objects; @@ -52,7 +52,6 @@ public boolean propagatesSkylightDown(final BlockState state, final BlockGetter } @Override - @SuppressWarnings("deprecation") public FluidState getFluidState(final BlockState state) { return Boolean.TRUE.equals(state.getValue(BlockStateProperties.WATERLOGGED)) ? Fluids.WATER.getSource(false) @@ -60,7 +59,6 @@ public FluidState getFluidState(final BlockState state) { } @Override - @SuppressWarnings("deprecation") public BlockState updateShape(final BlockState state, final Direction direction, final BlockState newState, @@ -100,7 +98,6 @@ protected void createBlockStateDefinition(final StateDefinition.Builder extends AbstractBaseScreen { + public static final ResourceLocation TEXTURE = createIdentifier("textures/gui/generic_filter.png"); + + protected AbstractFilterScreen(final T menu, + final Inventory playerInventory, + final Component text) { + super(menu, playerInventory, text); + this.inventoryLabelY = 42; + this.imageWidth = hasUpgrades() ? 210 : 176; + this.imageHeight = 137; + } + + protected boolean hasUpgrades() { + return true; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractPlatformSavedData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractPlatformSavedData.java new file mode 100644 index 000000000..e9d409761 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractPlatformSavedData.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage.common.support; + +import com.refinedmods.refinedstorage.common.Platform; + +import java.io.File; + +import net.minecraft.core.HolderLookup; +import net.minecraft.world.level.saveddata.SavedData; + +public abstract class AbstractPlatformSavedData extends SavedData { + @Override + public final void save(final File file, final HolderLookup.Provider provider) { + Platform.INSTANCE.saveSavedData(this, file, provider, super::save); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/BaseBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/BaseBlockItem.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/BaseBlockItem.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/BaseBlockItem.java index c9def43b6..a72a7cb09 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/BaseBlockItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/BaseBlockItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; import java.util.Optional; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/BlockEntityWithDrops.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/BlockEntityWithDrops.java new file mode 100644 index 000000000..1527d6f83 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/BlockEntityWithDrops.java @@ -0,0 +1,9 @@ +package com.refinedmods.refinedstorage.common.support; + +import net.minecraft.core.NonNullList; +import net.minecraft.world.item.ItemStack; + +@FunctionalInterface +public interface BlockEntityWithDrops { + NonNullList getDrops(); +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/BlockItemProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/BlockItemProvider.java new file mode 100644 index 000000000..193ed8dd6 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/BlockItemProvider.java @@ -0,0 +1,8 @@ +package com.refinedmods.refinedstorage.common.support; + +import net.minecraft.world.item.BlockItem; + +@FunctionalInterface +public interface BlockItemProvider { + T createBlockItem(); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/CableBlockSupport.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/CableBlockSupport.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/CableBlockSupport.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/CableBlockSupport.java index 4e781e344..9fcb94357 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/CableBlockSupport.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/CableBlockSupport.java @@ -1,6 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; -import com.refinedmods.refinedstorage.platform.api.support.network.NetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; import java.util.HashMap; import java.util.Map; @@ -8,6 +9,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; @@ -83,10 +85,14 @@ private static VoxelShape calculateShape(final CableShapeCacheKey cacheKey) { public static BlockState getState( final BlockState currentState, - final LevelAccessor level, + final LevelAccessor levelAccessor, final BlockPos pos, @Nullable final Direction blacklistedDirection ) { + if (!(levelAccessor instanceof Level level)) { + return currentState; + } + final boolean north = hasVisualConnection(currentState, level, pos, Direction.NORTH, blacklistedDirection); final boolean east = hasVisualConnection(currentState, level, pos, Direction.EAST, blacklistedDirection); final boolean south = hasVisualConnection(currentState, level, pos, Direction.SOUTH, blacklistedDirection); @@ -105,7 +111,7 @@ public static BlockState getState( private static boolean hasVisualConnection( final BlockState blockState, - final LevelAccessor level, + final Level level, final BlockPos pos, final Direction direction, @Nullable final Direction blacklistedDirection @@ -114,7 +120,12 @@ private static boolean hasVisualConnection( return false; } final BlockPos offsetPos = pos.relative(direction); - if (!(level.getBlockEntity(offsetPos) instanceof NetworkNodeContainerBlockEntity neighbor)) { + final NetworkNodeContainerProvider neighbor = Platform.INSTANCE.getContainerProvider( + level, + offsetPos, + direction.getOpposite() + ); + if (neighbor == null) { return false; } return neighbor.getContainers() diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/CableShapeCacheKey.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/CableShapeCacheKey.java new file mode 100644 index 000000000..b3f456736 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/CableShapeCacheKey.java @@ -0,0 +1,16 @@ +package com.refinedmods.refinedstorage.common.support; + +import net.minecraft.world.level.block.state.BlockState; + +public record CableShapeCacheKey(boolean north, boolean east, boolean south, boolean west, boolean up, boolean down) { + public static CableShapeCacheKey of(final BlockState state) { + return new CableShapeCacheKey( + state.getValue(CableBlockSupport.NORTH), + state.getValue(CableBlockSupport.EAST), + state.getValue(CableBlockSupport.SOUTH), + state.getValue(CableBlockSupport.WEST), + state.getValue(CableBlockSupport.UP), + state.getValue(CableBlockSupport.DOWN) + ); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ColorableBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ColorableBlock.java new file mode 100644 index 000000000..e678f310b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ColorableBlock.java @@ -0,0 +1,17 @@ +package com.refinedmods.refinedstorage.common.support; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; + +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.block.Block; + +public interface ColorableBlock, I extends BlockItem> { + BlockColorMap getBlockColorMap(); + + DyeColor getColor(); + + default boolean canAlwaysConnect() { + return getBlockColorMap().isDefaultColor(getColor()); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/DirectionalCableBlockShapes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/DirectionalCableBlockShapes.java similarity index 98% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/DirectionalCableBlockShapes.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/DirectionalCableBlockShapes.java index eea87dc4b..ca852f48f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/DirectionalCableBlockShapes.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/DirectionalCableBlockShapes.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/FilterModeSettings.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/FilterModeSettings.java new file mode 100644 index 000000000..a8630da19 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/FilterModeSettings.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage.common.support; + +import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; + +public class FilterModeSettings { + private static final int BLOCK = 0; + private static final int ALLOW = 1; + + private FilterModeSettings() { + } + + public static FilterMode getFilterMode(final int filterMode) { + if (filterMode == ALLOW) { + return FilterMode.ALLOW; + } + return FilterMode.BLOCK; + } + + public static int getFilterMode(final FilterMode filterMode) { + return switch (filterMode) { + case BLOCK -> BLOCK; + case ALLOW -> ALLOW; + }; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterWithFuzzyMode.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/FilterWithFuzzyMode.java similarity index 94% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterWithFuzzyMode.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/FilterWithFuzzyMode.java index 9755f79a7..40bdc8e66 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterWithFuzzyMode.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/FilterWithFuzzyMode.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.FuzzyModeNormalizer; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; import java.util.List; import java.util.Set; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilteredContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/FilteredContainer.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilteredContainer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/FilteredContainer.java index 6460eae4c..933dd8e1e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilteredContainer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/FilteredContainer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; import java.util.function.Predicate; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/NetworkNodeBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/NetworkNodeBlockItem.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/NetworkNodeBlockItem.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/NetworkNodeBlockItem.java index c7f2a334a..42f3575b4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/NetworkNodeBlockItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/NetworkNodeBlockItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import javax.annotation.Nullable; @@ -21,8 +21,12 @@ public NetworkNodeBlockItem(final Block block, final Properties properties, @Nul @Override protected boolean placeBlock(final BlockPlaceContext ctx, final BlockState state) { - if (ctx.getPlayer() instanceof ServerPlayer serverPlayer - && !(PlatformApi.INSTANCE.canPlaceNetworkNode(serverPlayer, ctx.getLevel(), ctx.getClickedPos(), state))) { + if (ctx.getPlayer() instanceof ServerPlayer serverPlayer && !(RefinedStorageApi.INSTANCE.canPlaceNetworkNode( + serverPlayer, + ctx.getLevel(), + ctx.getClickedPos(), + state + ))) { return false; } return super.placeBlock(ctx, state); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/PlayerAwareBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/PlayerAwareBlockEntity.java new file mode 100644 index 000000000..ab42f832e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/PlayerAwareBlockEntity.java @@ -0,0 +1,7 @@ +package com.refinedmods.refinedstorage.common.support; + +import java.util.UUID; + +public interface PlayerAwareBlockEntity { + void setPlacedBy(UUID playerId); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneMode.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/RedstoneMode.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneMode.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/RedstoneMode.java index 0ab863e52..b6f863137 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneMode.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/RedstoneMode.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; public enum RedstoneMode { IGNORE, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneModeSettings.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/RedstoneModeSettings.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneModeSettings.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/RedstoneModeSettings.java index b54098c8c..4313057eb 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneModeSettings.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/RedstoneModeSettings.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; public class RedstoneModeSettings { private static final int IGNORE = 0; @@ -10,7 +10,6 @@ private RedstoneModeSettings() { public static RedstoneMode getRedstoneMode(final int redstoneMode) { return switch (redstoneMode) { - case IGNORE -> RedstoneMode.IGNORE; case HIGH -> RedstoneMode.HIGH; case LOW -> RedstoneMode.LOW; default -> RedstoneMode.IGNORE; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SchedulingMode.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SchedulingMode.java similarity index 97% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SchedulingMode.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SchedulingMode.java index 1948d9fb9..55e7aa2a8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SchedulingMode.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SchedulingMode.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SchedulingModeType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SchedulingModeType.java similarity index 94% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SchedulingModeType.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SchedulingModeType.java index fcddfbe3f..3f85ed1e0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SchedulingModeType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SchedulingModeType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support; +package com.refinedmods.refinedstorage.common.support; import com.refinedmods.refinedstorage.api.network.impl.node.task.DefaultTaskExecutor; import com.refinedmods.refinedstorage.api.network.impl.node.task.RandomTaskExecutor; @@ -11,7 +11,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public enum SchedulingModeType { DEFAULT( diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SimpleBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SimpleBlock.java new file mode 100644 index 000000000..feb3b70ab --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SimpleBlock.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage.common.support; + +import com.refinedmods.refinedstorage.common.content.BlockConstants; + +import net.minecraft.world.level.block.Block; + +public final class SimpleBlock extends Block { + public SimpleBlock() { + super(BlockConstants.PROPERTIES); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SimpleItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SimpleItem.java new file mode 100644 index 000000000..644fe0f74 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/SimpleItem.java @@ -0,0 +1,9 @@ +package com.refinedmods.refinedstorage.common.support; + +import net.minecraft.world.item.Item; + +public final class SimpleItem extends Item { + public SimpleItem() { + super(new Item.Properties()); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/TextureIds.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/TextureIds.java new file mode 100644 index 000000000..e4fb3e004 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/TextureIds.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage.common.support; + +import net.minecraft.resources.ResourceLocation; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public final class TextureIds { + public static final ResourceLocation ICONS = createIdentifier("textures/icons.png"); + + private TextureIds() { + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AbstractAmountScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AbstractAmountScreen.java similarity index 97% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AbstractAmountScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AbstractAmountScreen.java index 6a2f43bf3..2bb68a09f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AbstractAmountScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AbstractAmountScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.amount; +package com.refinedmods.refinedstorage.common.support.amount; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; import java.util.Objects; import java.util.Optional; @@ -21,7 +21,7 @@ import org.joml.Vector3f; import org.lwjgl.glfw.GLFW; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public abstract class AbstractAmountScreen extends AbstractBaseScreen { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AbstractSingleAmountScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AbstractSingleAmountScreen.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AbstractSingleAmountScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AbstractSingleAmountScreen.java index c11289707..f6e776983 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AbstractSingleAmountScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AbstractSingleAmountScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.amount; +package com.refinedmods.refinedstorage.common.support.amount; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractSingleAmountContainerMenu; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; @@ -8,7 +8,7 @@ import net.minecraft.world.entity.player.Inventory; import org.joml.Vector3f; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public abstract class AbstractSingleAmountScreen extends AbstractAmountScreen { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AmountOperations.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AmountOperations.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AmountOperations.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AmountOperations.java index fc65187f0..e2955b221 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AmountOperations.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AmountOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.amount; +package com.refinedmods.refinedstorage.common.support.amount; import java.util.Optional; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AmountScreenConfiguration.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AmountScreenConfiguration.java similarity index 99% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AmountScreenConfiguration.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AmountScreenConfiguration.java index 77ed7fc74..e0d1e0193 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/AmountScreenConfiguration.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AmountScreenConfiguration.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.amount; +package com.refinedmods.refinedstorage.common.support.amount; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/DoubleAmountOperations.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/DoubleAmountOperations.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/DoubleAmountOperations.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/DoubleAmountOperations.java index 683eaa9c4..6df699dbf 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/DoubleAmountOperations.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/DoubleAmountOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.amount; +package com.refinedmods.refinedstorage.common.support.amount; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/IntegerAmountOperations.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/IntegerAmountOperations.java similarity index 95% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/IntegerAmountOperations.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/IntegerAmountOperations.java index e3d286e25..b70ac5287 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/IntegerAmountOperations.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/IntegerAmountOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.amount; +package com.refinedmods.refinedstorage.common.support.amount; import java.util.Objects; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/LongAmountOperations.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/LongAmountOperations.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/LongAmountOperations.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/LongAmountOperations.java index af5becc2e..b2eb529f8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/LongAmountOperations.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/LongAmountOperations.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.amount; +package com.refinedmods.refinedstorage.common.support.amount; -import com.refinedmods.refinedstorage.platform.common.util.MathUtil; +import com.refinedmods.refinedstorage.common.util.MathUtil; import java.util.Optional; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/PriorityScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/PriorityScreen.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/PriorityScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/PriorityScreen.java index 8991bc0b8..bf53e52dc 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/PriorityScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/PriorityScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.amount; +package com.refinedmods.refinedstorage.common.support.amount; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.MutableComponent; @@ -8,8 +8,8 @@ import net.minecraft.world.entity.player.Inventory; import org.joml.Vector3f; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class PriorityScreen extends AbstractAmountScreen { private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/priority.png"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/ResourceAmountScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/ResourceAmountScreen.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/ResourceAmountScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/ResourceAmountScreen.java index 487166c2c..bb2dc979a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/ResourceAmountScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/ResourceAmountScreen.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.amount; +package com.refinedmods.refinedstorage.common.support.amount; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.MutableComponent; @@ -11,8 +11,8 @@ import net.minecraft.world.item.ItemStack; import org.joml.Vector3f; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class ResourceAmountScreen extends AbstractAmountScreen { private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/resource_amount.png"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/package-info.java new file mode 100644 index 000000000..8cc4fb92b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.amount; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractResourceContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractResourceContainerMenu.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractResourceContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractResourceContainerMenu.java index b6b5cf2a6..934a6f5d5 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractResourceContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractResourceContainerMenu.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; import java.util.ArrayList; import java.util.List; @@ -11,6 +11,7 @@ import javax.annotation.Nullable; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.ClickType; import net.minecraft.world.inventory.MenuType; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; @@ -118,4 +119,21 @@ public boolean canTakeItemForPickAll(final ItemStack stack, final Slot slot) { } return super.canTakeItemForPickAll(stack, slot); } + + @Override + public void clicked(final int id, final int dragType, final ClickType clickType, final Player p) { + final Slot slot = id >= 0 ? getSlot(id) : null; + if (slot instanceof ResourceSlot resourceSlot + && resourceSlot.supportsItemSlotInteractions() + && !resourceSlot.isEmpty() + && !getCarried().isEmpty() + ) { + final ItemStack result = resourceSlot.insertInto(getCarried()); + if (result != null) { + setCarried(result); + return; + } + } + super.clicked(id, dragType, clickType, p); + } } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractSchedulingContainerMenu.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractSchedulingContainerMenu.java index d0e9eba45..117a0a456 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractSchedulingContainerMenu.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.SchedulingModeType; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.SchedulingModeType; +import com.refinedmods.refinedstorage.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Player; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSimpleFilterContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractSimpleFilterContainerMenu.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSimpleFilterContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractSimpleFilterContainerMenu.java index dbb12d34c..19c5ecac6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSimpleFilterContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractSimpleFilterContainerMenu.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeSlot; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeSlot; import javax.annotation.Nullable; @@ -50,7 +50,7 @@ protected AbstractSimpleFilterContainerMenu(final MenuType type, ResourceContainerImpl.createForFilter(resourceContainerData), upgradeDestination == null ? null - : new UpgradeContainer(upgradeDestination, PlatformApi.INSTANCE.getUpgradeRegistry()) + : new UpgradeContainer(upgradeDestination, RefinedStorageApi.INSTANCE.getUpgradeRegistry()) ); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractSingleAmountContainerMenu.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractSingleAmountContainerMenu.java index 22c7a0c44..4af27096d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/AbstractSingleAmountContainerMenu.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ClientProperty.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ClientProperty.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ClientProperty.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ClientProperty.java index fe54ef52e..71c148491 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ClientProperty.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ClientProperty.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; import net.minecraft.world.inventory.DataSlot; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/DisabledSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/DisabledSlot.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/DisabledSlot.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/DisabledSlot.java index 7cd362c67..b48c6a53b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/DisabledSlot.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/DisabledSlot.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; import net.minecraft.world.Container; import net.minecraft.world.inventory.Slot; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ExtendedMenuProvider.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ExtendedMenuProvider.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ExtendedMenuProvider.java index 0250634dd..f4d76c5a0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ExtendedMenuProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ExtendedMenuProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamEncoder; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/MenuOpener.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/MenuOpener.java new file mode 100644 index 000000000..ece4df1bc --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/MenuOpener.java @@ -0,0 +1,8 @@ +package com.refinedmods.refinedstorage.common.support.containermenu; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.MenuProvider; + +public interface MenuOpener { + void openMenu(ServerPlayer player, MenuProvider menuProvider); +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/NetworkNodeExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/NetworkNodeExtendedMenuProvider.java new file mode 100644 index 000000000..9d7589eff --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/NetworkNodeExtendedMenuProvider.java @@ -0,0 +1,4 @@ +package com.refinedmods.refinedstorage.common.support.containermenu; + +public interface NetworkNodeExtendedMenuProvider extends ExtendedMenuProvider, NetworkNodeMenuProvider { +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/NetworkNodeMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/NetworkNodeMenuProvider.java new file mode 100644 index 000000000..2a262a5ef --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/NetworkNodeMenuProvider.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage.common.support.containermenu; + +import com.refinedmods.refinedstorage.common.api.security.SecurityHelper; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.security.BuiltinPermission; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.MenuProvider; + +public interface NetworkNodeMenuProvider extends MenuProvider { + NetworkNodeContainerProvider getContainerProvider(); + + default boolean canOpen(final ServerPlayer player) { + return SecurityHelper.isAllowed( + player, + BuiltinPermission.OPEN, + getContainerProvider().getContainers() + ); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/Property.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/Property.java new file mode 100644 index 000000000..665b3712c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/Property.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage.common.support.containermenu; + +import net.minecraft.world.inventory.DataSlot; + +public interface Property { + PropertyType getType(); + + T getValue(); + + DataSlot getDataSlot(); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/PropertyType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/PropertyType.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/PropertyType.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/PropertyType.java index 994f59255..626adbb4c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/PropertyType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/PropertyType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; import java.util.function.Function; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/PropertyTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/PropertyTypes.java new file mode 100644 index 000000000..9866ec671 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/PropertyTypes.java @@ -0,0 +1,52 @@ +package com.refinedmods.refinedstorage.common.support.containermenu; + +import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.RedstoneModeSettings; +import com.refinedmods.refinedstorage.common.support.SchedulingModeType; + +import net.minecraft.resources.ResourceLocation; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public final class PropertyTypes { + public static final PropertyType REDSTONE_MODE = new PropertyType<>( + createIdentifier("redstone_mode"), + RedstoneModeSettings::getRedstoneMode, + RedstoneModeSettings::getRedstoneMode + ); + + public static final PropertyType FILTER_MODE = new PropertyType<>( + createIdentifier("filter_mode"), + FilterModeSettings::getFilterMode, + FilterModeSettings::getFilterMode + ); + + public static final PropertyType SCHEDULING_MODE = new PropertyType<>( + createIdentifier("scheduling_mode"), + SchedulingModeType::getId, + SchedulingModeType::getById + ); + + public static final PropertyType FUZZY_MODE = createBooleanProperty(createIdentifier("fuzzy_mode")); + + private PropertyTypes() { + } + + public static PropertyType createBooleanProperty(final ResourceLocation id) { + return new PropertyType<>( + id, + value -> Boolean.TRUE.equals(value) ? 1 : 0, + value -> value == 1 + ); + } + + public static PropertyType createIntegerProperty(final ResourceLocation id) { + return new PropertyType<>( + id, + value -> value, + value -> value + ); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ResourceInventoryDestination.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ResourceInventoryDestination.java similarity index 80% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ResourceInventoryDestination.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ResourceInventoryDestination.java index 5d8fda070..6679bb6b3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ResourceInventoryDestination.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ResourceInventoryDestination.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ResourceSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ResourceSlot.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ResourceSlot.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ResourceSlot.java index 67bf7ff4f..41ca7769d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ResourceSlot.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ResourceSlot.java @@ -1,12 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.S2CPackets; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.support.packet.c2s.C2SPackets; +import com.refinedmods.refinedstorage.common.support.packet.s2c.S2CPackets; import java.util.Objects; import java.util.Set; @@ -216,4 +217,20 @@ public ResourceFactory getPrimaryResourceFactory() { public Set getAlternativeResourceFactories() { return resourceContainer.getAlternativeResourceFactories(); } + + @Nullable + public ItemStack insertInto(final ItemStack carried) { + final ResourceAmount currentResourceAmount = resourceContainer.get(getContainerSlot()); + if (currentResourceAmount == null) { + return null; + } + return RefinedStorageApi.INSTANCE.getResourceContainerInsertStrategies().stream() + .flatMap(strategy -> strategy.insert(carried, currentResourceAmount).stream()) + .findFirst() + .map(result -> { + resourceContainer.shrink(getContainerSlot(), result.inserted()); + return result.container(); + }) + .orElse(null); + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ResourceSlotType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ResourceSlotType.java new file mode 100644 index 000000000..1343775e6 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ResourceSlotType.java @@ -0,0 +1,7 @@ +package com.refinedmods.refinedstorage.common.support.containermenu; + +public enum ResourceSlotType { + FILTER, + FILTER_WITH_AMOUNT, + CONTAINER +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ServerProperty.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ServerProperty.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ServerProperty.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ServerProperty.java index 02364e590..369374d9f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ServerProperty.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ServerProperty.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; import java.util.function.Consumer; import java.util.function.Supplier; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/SingleAmountData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/SingleAmountData.java new file mode 100644 index 000000000..bc0896032 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/SingleAmountData.java @@ -0,0 +1,22 @@ +package com.refinedmods.refinedstorage.common.support.containermenu; + +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; + +import java.util.Optional; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; + +public record SingleAmountData(Optional slotReference, + double amount, + ResourceContainerData resourceContainerData) { + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + ByteBufCodecs.optional(SlotReferenceFactory.STREAM_CODEC), SingleAmountData::slotReference, + ByteBufCodecs.DOUBLE, SingleAmountData::amount, + ResourceContainerData.STREAM_CODEC, SingleAmountData::resourceContainerData, + SingleAmountData::new + ); +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/TransferDestination.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/TransferDestination.java new file mode 100644 index 000000000..03c219f38 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/TransferDestination.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage.common.support.containermenu; + +import javax.annotation.Nullable; + +import net.minecraft.world.item.ItemStack; + +@FunctionalInterface +public interface TransferDestination { + @Nullable + ItemStack transfer(ItemStack stack); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/TransferManager.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/TransferManager.java similarity index 97% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/TransferManager.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/TransferManager.java index ffd6683f4..1aece6cbf 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/TransferManager.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/TransferManager.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; import java.util.HashMap; import java.util.LinkedList; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ValidatedSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ValidatedSlot.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ValidatedSlot.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ValidatedSlot.java index 9bc6631fe..b4c14542a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ValidatedSlot.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/ValidatedSlot.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; +package com.refinedmods.refinedstorage.common.support.containermenu; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItem; +import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItem; import java.util.function.Predicate; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/package-info.java new file mode 100644 index 000000000..3771a46fa --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/containermenu/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.containermenu; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/BiDirection.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/BiDirection.java similarity index 97% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/BiDirection.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/BiDirection.java index 8bb74ce45..fa9e42996 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/BiDirection.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/BiDirection.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.direction; +package com.refinedmods.refinedstorage.common.support.direction; import java.util.Locale; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/BiDirectionType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/BiDirectionType.java similarity index 95% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/BiDirectionType.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/BiDirectionType.java index 38f47b242..a03ecd858 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/BiDirectionType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/BiDirectionType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.direction; +package com.refinedmods.refinedstorage.common.support.direction; import net.minecraft.core.Direction; import net.minecraft.world.level.block.state.properties.EnumProperty; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/DefaultDirectionType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/DefaultDirectionType.java similarity index 95% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/DefaultDirectionType.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/DefaultDirectionType.java index 05e896dca..a2300ca1d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/DefaultDirectionType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/DefaultDirectionType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.direction; +package com.refinedmods.refinedstorage.common.support.direction; import net.minecraft.core.Direction; import net.minecraft.world.level.block.state.properties.EnumProperty; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/DirectionType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/DirectionType.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/DirectionType.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/DirectionType.java index b8ac9744c..17286ca62 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/DirectionType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/DirectionType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.direction; +package com.refinedmods.refinedstorage.common.support.direction; import net.minecraft.core.Direction; import net.minecraft.util.StringRepresentable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/HorizontalDirection.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/HorizontalDirection.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/HorizontalDirection.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/HorizontalDirection.java index d8a6516ee..7c70d42f2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/HorizontalDirection.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/HorizontalDirection.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.direction; +package com.refinedmods.refinedstorage.common.support.direction; import java.util.Locale; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/HorizontalDirectionType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/HorizontalDirectionType.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/HorizontalDirectionType.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/HorizontalDirectionType.java index 857d50b0c..636ae3305 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/HorizontalDirectionType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/HorizontalDirectionType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.direction; +package com.refinedmods.refinedstorage.common.support.direction; import net.minecraft.core.Direction; import net.minecraft.world.level.block.state.properties.EnumProperty; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/package-info.java new file mode 100644 index 000000000..181b6db7e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/direction/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.direction; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/BlockEntityEnergyStorage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/BlockEntityEnergyStorage.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/BlockEntityEnergyStorage.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/BlockEntityEnergyStorage.java index 7fa4654e0..6ed1632a4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/BlockEntityEnergyStorage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/BlockEntityEnergyStorage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.energy; +package com.refinedmods.refinedstorage.common.support.energy; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage.api.network.impl.energy.AbstractListeningEnergyStorage; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/CreativeEnergyStorage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/CreativeEnergyStorage.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/CreativeEnergyStorage.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/CreativeEnergyStorage.java index 1cf2f1f75..0b105e47d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/CreativeEnergyStorage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/CreativeEnergyStorage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.energy; +package com.refinedmods.refinedstorage.common.support.energy; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyContainerMenu.java new file mode 100644 index 000000000..78611f2cc --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyContainerMenu.java @@ -0,0 +1,6 @@ +package com.refinedmods.refinedstorage.common.support.energy; + +@FunctionalInterface +public interface EnergyContainerMenu { + EnergyInfo getEnergyInfo(); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyInfo.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyInfo.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyInfo.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyInfo.java index ce92b403d..8d24723b1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyInfo.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyInfo.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.energy; +package com.refinedmods.refinedstorage.common.support.energy; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.S2CPackets; +import com.refinedmods.refinedstorage.common.support.packet.s2c.S2CPackets; import java.util.Collections; import java.util.List; @@ -11,7 +11,7 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createStoredWithCapacityTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createStoredWithCapacityTranslation; public class EnergyInfo { private final Player player; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyItemHelperImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyItemHelperImpl.java new file mode 100644 index 000000000..86b6942d2 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyItemHelperImpl.java @@ -0,0 +1,73 @@ +package com.refinedmods.refinedstorage.common.support.energy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.energy.EnergyItemHelper; +import com.refinedmods.refinedstorage.common.api.support.energy.TransferableBlockEntityEnergy; + +import java.util.List; + +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.util.Mth; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createStoredWithCapacityTranslation; + +public class EnergyItemHelperImpl implements EnergyItemHelper { + @Override + public void addTooltip(final ItemStack stack, final List lines) { + RefinedStorageApi.INSTANCE.getEnergyStorage(stack).ifPresent(energyStorage -> { + final long stored = energyStorage.getStored(); + final long capacity = energyStorage.getCapacity(); + final double pct = stored / (double) capacity; + lines.add(createStoredWithCapacityTranslation(stored, capacity, pct).withStyle(ChatFormatting.GRAY)); + }); + } + + @Override + public boolean isBarVisible(final ItemStack stack) { + return RefinedStorageApi.INSTANCE.getEnergyStorage(stack).isPresent(); + } + + @Override + public int getBarWidth(final ItemStack stack) { + return RefinedStorageApi.INSTANCE.getEnergyStorage(stack).map(energyStorage -> (int) Math.round( + (energyStorage.getStored() / (double) energyStorage.getCapacity()) * 13D + )).orElse(0); + } + + @Override + public int getBarColor(final ItemStack stack) { + return RefinedStorageApi.INSTANCE.getEnergyStorage(stack).map(energyStorage -> Mth.hsvToRgb( + Math.max(0.0F, (float) energyStorage.getStored() / (float) energyStorage.getCapacity()) / 3.0F, + 1.0F, + 1.0F + )).orElse(0); + } + + @Override + public ItemStack createAtEnergyCapacity(final Item item) { + final ItemStack stack = item.getDefaultInstance(); + RefinedStorageApi.INSTANCE.getEnergyStorage(stack).ifPresent(energyStorage -> energyStorage.receive( + energyStorage.getCapacity(), + Action.EXECUTE + )); + return stack; + } + + @Override + public void passEnergyToBlockEntity(final BlockPos pos, final Level level, final ItemStack stack) { + if (level.isClientSide() + || !(level.getBlockEntity(pos) instanceof TransferableBlockEntityEnergy transferableBlockEntityEnergy)) { + return; + } + RefinedStorageApi.INSTANCE.getEnergyStorage(stack).ifPresent( + energyStorage -> transferableBlockEntityEnergy.getEnergyStorage() + .receive(energyStorage.getStored(), Action.EXECUTE) + ); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyLootItemFunction.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyLootItemFunction.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyLootItemFunction.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyLootItemFunction.java index 4cb1740cc..e31c23be5 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyLootItemFunction.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/EnergyLootItemFunction.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.support.energy; +package com.refinedmods.refinedstorage.common.support.energy; import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.energy.TransferableBlockEntityEnergy; -import com.refinedmods.refinedstorage.platform.common.content.LootFunctions; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.energy.TransferableBlockEntityEnergy; +import com.refinedmods.refinedstorage.common.content.LootFunctions; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; @@ -23,7 +23,7 @@ public ItemStack apply(final ItemStack stack, final LootContext lootContext) { final BlockEntity blockEntity = lootContext.getParam(LootContextParams.BLOCK_ENTITY); if (blockEntity instanceof TransferableBlockEntityEnergy transferableBlockEntityEnergy) { final long stored = transferableBlockEntityEnergy.getEnergyStorage().getStored(); - PlatformApi.INSTANCE.getEnergyStorage(stack).ifPresent( + RefinedStorageApi.INSTANCE.getEnergyStorage(stack).ifPresent( energyStorage -> energyStorage.receive(stored, Action.EXECUTE) ); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/ItemBlockEnergyStorage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/ItemBlockEnergyStorage.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/ItemBlockEnergyStorage.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/ItemBlockEnergyStorage.java index aad8bc36b..e529731f1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/ItemBlockEnergyStorage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/ItemBlockEnergyStorage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.energy; +package com.refinedmods.refinedstorage.common.support.energy; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/ItemEnergyStorage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/ItemEnergyStorage.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/ItemEnergyStorage.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/ItemEnergyStorage.java index f1b45b9d3..38954f500 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/ItemEnergyStorage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/ItemEnergyStorage.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.support.energy; +package com.refinedmods.refinedstorage.common.support.energy; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage.api.network.impl.energy.AbstractListeningEnergyStorage; -import com.refinedmods.refinedstorage.platform.common.content.DataComponents; +import com.refinedmods.refinedstorage.common.content.DataComponents; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/package-info.java new file mode 100644 index 000000000..7d5caeb33 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/energy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.energy; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java index 16045b705..caa4b58f4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.network; +package com.refinedmods.refinedstorage.common.support.network; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; @@ -11,6 +11,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock.tryExtractDirection; + public abstract class AbstractLevelInteractingNetworkNodeContainerBlockEntity extends AbstractRedstoneModeNetworkNodeContainerBlockEntity { private static final Logger LOGGER = LoggerFactory.getLogger( @@ -28,7 +30,6 @@ protected AbstractLevelInteractingNetworkNodeContainerBlockEntity( // used to handle rotations @Override - @SuppressWarnings("deprecation") public void setBlockState(final BlockState newBlockState) { super.setBlockState(newBlockState); if (!(level instanceof ServerLevel serverLevel)) { @@ -47,7 +48,7 @@ public void setLevel(final Level level) { } protected final void initialize(final ServerLevel level) { - final Direction direction = getDirection(); + final Direction direction = tryExtractDirection(getBlockState()); if (direction == null) { LOGGER.warn( "Failed to initialize: could not extract direction from block at {}, state is {}", diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java index 9ad681e76..10a83f4e3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.support.network; +package com.refinedmods.refinedstorage.common.support.network; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; -import com.refinedmods.refinedstorage.platform.api.configurationcard.ConfigurationCardTarget; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.PlayerAwareBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneModeSettings; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.configurationcard.ConfigurationCardTarget; +import com.refinedmods.refinedstorage.common.support.PlayerAwareBlockEntity; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.RedstoneModeSettings; import java.util.Objects; import java.util.UUID; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java index 191278a99..c9bf5cb52 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage.platform.common.support.network; +package com.refinedmods.refinedstorage.common.support.network; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.SchedulingMode; -import com.refinedmods.refinedstorage.platform.common.support.SchedulingModeType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage.common.support.SchedulingMode; +import com.refinedmods.refinedstorage.common.support.SchedulingModeType; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java index 36b9ac59f..6645b061a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.support.network; +package com.refinedmods.refinedstorage.common.support.network; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.support.BlockEntityWithDrops; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage.platform.common.util.ContainerUtil; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.util.ContainerUtil; import java.util.List; @@ -45,7 +45,7 @@ protected AbstractUpgradeableNetworkNodeContainerBlockEntity( super(type, pos, state, node); this.upgradeContainer = new UpgradeContainer( destination, - PlatformApi.INSTANCE.getUpgradeRegistry(), + RefinedStorageApi.INSTANCE.getUpgradeRegistry(), this::upgradeContainerChanged ); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/BaseNetworkNodeContainerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/BaseNetworkNodeContainerBlockEntity.java new file mode 100644 index 000000000..1149a0177 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/BaseNetworkNodeContainerBlockEntity.java @@ -0,0 +1,116 @@ +package com.refinedmods.refinedstorage.common.support.network; + +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; +import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.AbstractNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemTargetBlockEntity; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class BaseNetworkNodeContainerBlockEntity + extends AbstractNetworkNodeContainerBlockEntity implements NetworkItemTargetBlockEntity { + private static final Logger LOGGER = LoggerFactory.getLogger(BaseNetworkNodeContainerBlockEntity.class); + + private final RateLimiter activenessChangeRateLimiter = RateLimiter.create(1); + + public BaseNetworkNodeContainerBlockEntity(final BlockEntityType type, + final BlockPos pos, + final BlockState state, + final T networkNode) { + super(type, pos, state, networkNode); + } + + @Override + protected InWorldNetworkNodeContainer createMainContainer(final T networkNode) { + return RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, networkNode) + .connectionStrategy(new ColoredConnectionStrategy(this::getBlockState, getBlockPos())) + .build(); + } + + protected boolean calculateActive() { + final long energyUsage = mainNetworkNode.getEnergyUsage(); + final boolean hasLevel = level != null && level.isLoaded(worldPosition); + return hasLevel + && mainNetworkNode.getNetwork() != null + && mainNetworkNode.getNetwork().getComponent(EnergyNetworkComponent.class).getStored() >= energyUsage; + } + + public void updateActiveness(final BlockState state, @Nullable final BooleanProperty activenessProperty) { + final boolean newActive = calculateActive(); + final boolean nodeActivenessNeedsUpdate = newActive != mainNetworkNode.isActive(); + final boolean blockStateActivenessNeedsUpdate = activenessProperty != null + && state.getValue(activenessProperty) != newActive; + final boolean activenessNeedsUpdate = nodeActivenessNeedsUpdate || blockStateActivenessNeedsUpdate; + if (activenessNeedsUpdate && activenessChangeRateLimiter.tryAcquire()) { + if (nodeActivenessNeedsUpdate) { + activenessChanged(newActive); + } + if (blockStateActivenessNeedsUpdate) { + updateActivenessBlockState(state, activenessProperty, newActive); + } + } + } + + protected void activenessChanged(final boolean newActive) { + LOGGER.debug( + "Activeness change for node at {}: {} -> {}", + getBlockPos(), + mainNetworkNode.isActive(), + newActive + ); + mainNetworkNode.setActive(newActive); + } + + private void updateActivenessBlockState(final BlockState state, + final BooleanProperty activenessProperty, + final boolean active) { + if (level != null) { + LOGGER.debug( + "Sending block update at {} due to activeness change: {} -> {}", + getBlockPos(), + state.getValue(activenessProperty), + active + ); + level.setBlockAndUpdate(getBlockPos(), state.setValue(activenessProperty, active)); + } + } + + public void doWork() { + mainNetworkNode.doWork(); + } + + protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate( + final BlockState oldBlockState, + final BlockState newBlockState + ) { + return false; + } + + @Override + @SuppressWarnings("deprecation") + public void setBlockState(final BlockState newBlockState) { + final BlockState oldBlockState = getBlockState(); + super.setBlockState(newBlockState); + if (!doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState)) { + return; + } + containers.update(level); + } + + @Nullable + @Override + public Network getNetworkForItem() { + return mainNetworkNode.getNetwork(); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/ColoredConnectionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/ColoredConnectionStrategy.java new file mode 100644 index 000000000..9e0a32bb9 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/ColoredConnectionStrategy.java @@ -0,0 +1,70 @@ +package com.refinedmods.refinedstorage.common.support.network; + +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage.common.support.ColorableBlock; + +import java.util.function.Supplier; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock.tryExtractDirection; + +public class ColoredConnectionStrategy extends SimpleConnectionStrategy { + protected final Supplier blockStateProvider; + + public ColoredConnectionStrategy(final Supplier blockStateProvider, final BlockPos origin) { + super(origin); + this.blockStateProvider = blockStateProvider; + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + final Direction myDirection = tryExtractDirection(blockStateProvider.get()); + if (myDirection == null) { + super.addOutgoingConnections(sink); + return; + } + for (final Direction direction : Direction.values()) { + if (direction == myDirection) { + continue; + } + sink.tryConnectInSameDimension(origin.relative(direction), direction.getOpposite()); + } + } + + @Override + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + if (!colorsAllowConnecting(connectingState)) { + return false; + } + final Direction myDirection = tryExtractDirection(blockStateProvider.get()); + if (myDirection != null) { + return myDirection != incomingDirection; + } + return true; + } + + protected final boolean colorsAllowConnecting(final BlockState connectingState) { + if (!(connectingState.getBlock() instanceof ColorableBlock otherColorableBlock)) { + return true; + } + final ColorableBlock colorableBlock = getColor(); + if (colorableBlock == null) { + return true; + } + return otherColorableBlock.getColor() == colorableBlock.getColor() + || colorableBlock.canAlwaysConnect() + || otherColorableBlock.canAlwaysConnect(); + } + + @Nullable + private ColorableBlock getColor() { + if (!(blockStateProvider.get().getBlock() instanceof ColorableBlock colorableBlock)) { + return null; + } + return colorableBlock; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/ConnectionProviderImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/ConnectionProviderImpl.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/ConnectionProviderImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/ConnectionProviderImpl.java index bb0c8df12..2ea7fd159 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/ConnectionProviderImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/ConnectionProviderImpl.java @@ -1,10 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.support.network; +package com.refinedmods.refinedstorage.common.support.network; import com.refinedmods.refinedstorage.api.network.ConnectionProvider; import com.refinedmods.refinedstorage.api.network.Connections; import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.api.support.network.NetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; import java.util.ArrayDeque; import java.util.ArrayList; @@ -18,12 +19,10 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; -import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.core.GlobalPos; import net.minecraft.server.MinecraftServer; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.chunk.LevelChunk; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -100,14 +99,17 @@ private List findConnectionsAt(final InWorldNetwork private Set getConnections(final InWorldNetworkNodeContainer from, final ConnectionSinkImpl.Connection connection) { - final BlockEntity connectionBlockEntity = getBlockEntitySafely(connection.pos()); - if (!(connectionBlockEntity instanceof NetworkNodeContainerBlockEntity networkNodeContainerBlockEntity)) { + final NetworkNodeContainerProvider provider = getContainerProviderSafely( + connection.pos(), + connection.incomingDirection() + ); + if (provider == null) { return Collections.emptySet(); } if (connection.incomingDirection() == null) { - return networkNodeContainerBlockEntity.getContainers(); + return provider.getContainers(); } - return networkNodeContainerBlockEntity.getContainers() + return provider.getContainers() .stream() .filter(container -> container.canAcceptIncomingConnection( connection.incomingDirection(), @@ -125,7 +127,8 @@ public List sortDeterministically(final Set keyProvider; + + public InWorldNetworkNodeContainerBuilder(final BlockEntity blockEntity, final NetworkNode networkNode) { + this.blockEntity = blockEntity; + this.networkNode = networkNode; + this.connectionStrategy = new SimpleConnectionStrategy(blockEntity.getBlockPos()); + } + + @Override + public InWorldNetworkNodeContainer.Builder name(final String builderName) { + this.name = builderName; + return this; + } + + @Override + public InWorldNetworkNodeContainer.Builder priority(final int builderPriority) { + this.priority = builderPriority; + return this; + } + + @Override + public InWorldNetworkNodeContainer.Builder connectionStrategy(final ConnectionStrategy builderConnectionStrategy) { + this.connectionStrategy = builderConnectionStrategy; + return this; + } + + @Override + public InWorldNetworkNodeContainer.Builder keyProvider(final Supplier builderKeyProvider) { + this.keyProvider = builderKeyProvider; + return this; + } + + @Override + public InWorldNetworkNodeContainer build() { + return new InWorldNetworkNodeContainerImpl( + blockEntity, + networkNode, + name, + priority, + connectionStrategy, + keyProvider + ); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/InWorldNetworkNodeContainerImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/InWorldNetworkNodeContainerImpl.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/InWorldNetworkNodeContainerImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/InWorldNetworkNodeContainerImpl.java index df607d062..30b91c7f0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/InWorldNetworkNodeContainerImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/InWorldNetworkNodeContainerImpl.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.support.network; +package com.refinedmods.refinedstorage.common.support.network; import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionLogic; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionSink; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionStrategy; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; import java.util.function.Supplier; import javax.annotation.Nullable; @@ -21,7 +21,7 @@ public class InWorldNetworkNodeContainerImpl implements InWorldNetworkNodeContai private final NetworkNode node; private final String name; private final int priority; - private final ConnectionLogic connectionLogic; + private final ConnectionStrategy connectionStrategy; @Nullable private final Supplier keyProvider; @@ -29,13 +29,13 @@ public InWorldNetworkNodeContainerImpl(final BlockEntity blockEntity, final NetworkNode node, final String name, final int priority, - final ConnectionLogic connectionLogic, + final ConnectionStrategy connectionStrategy, @Nullable final Supplier keyProvider) { this.blockEntity = blockEntity; this.node = node; this.name = name; this.priority = priority; - this.connectionLogic = connectionLogic; + this.connectionStrategy = connectionStrategy; this.keyProvider = keyProvider; } @@ -46,12 +46,12 @@ public NetworkNode getNode() { @Override public void addOutgoingConnections(final ConnectionSink sink) { - connectionLogic.addOutgoingConnections(sink); + connectionStrategy.addOutgoingConnections(sink); } @Override public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { - return connectionLogic.canAcceptIncomingConnection(incomingDirection, connectingState); + return connectionStrategy.canAcceptIncomingConnection(incomingDirection, connectingState); } @Override diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/NetworkNodeBlockEntityTicker.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/NetworkNodeBlockEntityTicker.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/NetworkNodeBlockEntityTicker.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/NetworkNodeBlockEntityTicker.java index 448c7df5c..331b9381d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/NetworkNodeBlockEntityTicker.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/NetworkNodeBlockEntityTicker.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.network; +package com.refinedmods.refinedstorage.common.support.network; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/NetworkNodeContainerProviderImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/NetworkNodeContainerProviderImpl.java new file mode 100644 index 000000000..6b88264c5 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/NetworkNodeContainerProviderImpl.java @@ -0,0 +1,32 @@ +package com.refinedmods.refinedstorage.common.support.network; + +import com.refinedmods.refinedstorage.common.api.security.SecurityHelper; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.security.BuiltinPermission; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.server.level.ServerPlayer; + +public class NetworkNodeContainerProviderImpl implements NetworkNodeContainerProvider { + private final Set containers = HashSet.newHashSet(1); + private final Set containersView = Collections.unmodifiableSet(containers); + + @Override + public Set getContainers() { + return containersView; + } + + @Override + public void addContainer(final InWorldNetworkNodeContainer container) { + containers.add(container); + } + + @Override + public boolean canBuild(final ServerPlayer player) { + return SecurityHelper.isAllowed(player, BuiltinPermission.BUILD, getContainers()); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/SimpleConnectionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/SimpleConnectionStrategy.java new file mode 100644 index 000000000..9eccd000e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/SimpleConnectionStrategy.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage.common.support.network; + +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionStrategy; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; + +public class SimpleConnectionStrategy implements ConnectionStrategy { + protected final BlockPos origin; + + public SimpleConnectionStrategy(final BlockPos origin) { + this.origin = origin; + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + for (final Direction direction : Direction.values()) { + sink.tryConnectInSameDimension(origin.relative(direction), direction.getOpposite()); + } + } + + @Override + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + return true; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/component/PlatformStorageNetworkComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/component/PlatformStorageNetworkComponent.java new file mode 100644 index 000000000..0302c6dad --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/component/PlatformStorageNetworkComponent.java @@ -0,0 +1,29 @@ +package com.refinedmods.refinedstorage.common.support.network.component; + +import com.refinedmods.refinedstorage.api.network.impl.storage.StorageNetworkComponentImpl; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; +import com.refinedmods.refinedstorage.common.api.storage.root.FuzzyRootStorage; +import com.refinedmods.refinedstorage.common.api.support.resource.list.FuzzyResourceList; +import com.refinedmods.refinedstorage.common.support.resource.list.FuzzyResourceListImpl; + +import java.util.Collection; + +public class PlatformStorageNetworkComponent extends StorageNetworkComponentImpl implements FuzzyRootStorage { + private final FuzzyResourceList fuzzyResourceList; + + public PlatformStorageNetworkComponent() { + this(new FuzzyResourceListImpl(new ResourceListImpl())); + } + + private PlatformStorageNetworkComponent(final FuzzyResourceList fuzzyResourceList) { + super(fuzzyResourceList); + this.fuzzyResourceList = fuzzyResourceList; + } + + @Override + public Collection getFuzzy(final ResourceKey resource) { + return fuzzyResourceList.getFuzzy(resource); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/component/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/component/package-info.java new file mode 100644 index 000000000..8b5124b81 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/component/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.network.component; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/NetworkItemContextImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/NetworkItemContextImpl.java new file mode 100644 index 000000000..86da03cce --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/NetworkItemContextImpl.java @@ -0,0 +1,82 @@ +package com.refinedmods.refinedstorage.common.support.network.item; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemContext; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemPlayerValidator; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemTargetBlockEntity; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; + +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.core.GlobalPos; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.phys.Vec3; + +class NetworkItemContextImpl implements NetworkItemContext { + private final Player player; + private final NetworkItemPlayerValidator.PlayerCoordinates coordinates; + private final SlotReference slotReference; + @Nullable + private final GlobalPos networkLocation; + + @SuppressWarnings("resource") + NetworkItemContextImpl( + final Player player, + final SlotReference slotReference, + @Nullable final GlobalPos networkLocation + ) { + this.player = player; + // We copy the player position and dimension + // as it can change after opening the network bound item (opening while walking) + // and could cause the network not being accessible anymore (due to being out of range of a transmitter). + // If the network is no longer accessible, certain assumptions will break (e.g. grid watcher can no longer + // be removed after it was added). + this.coordinates = new NetworkItemPlayerValidator.PlayerCoordinates( + player.level().dimension(), + new Vec3(player.position().x, player.position().y, player.position().z) + ); + this.slotReference = slotReference; + this.networkLocation = networkLocation; + } + + @Override + public Optional resolveNetwork() { + if (networkLocation == null) { + return Optional.empty(); + } + return Optional.ofNullable(player.getServer()) + .map(server -> server.getLevel(networkLocation.dimension())) + .filter(level -> level.isLoaded(networkLocation.pos())) + .map(level -> level.getBlockEntity(networkLocation.pos())) + .filter(NetworkItemTargetBlockEntity.class::isInstance) + .map(NetworkItemTargetBlockEntity.class::cast) + .map(NetworkItemTargetBlockEntity::getNetworkForItem) + .filter(this::isValid); + } + + private boolean isValid(final Network network) { + return network.getComponent(GraphNetworkComponent.class) + .getContainers(NetworkItemPlayerValidator.class) + .stream() + .anyMatch(validator -> validator.isValid(coordinates)); + } + + @Override + public boolean isActive() { + return slotReference.resolve(player) + .flatMap(Platform.INSTANCE::getEnergyStorage) + .map(energyStorage -> energyStorage.getStored() > 0) + .orElse(true); + } + + @Override + public void drainEnergy(final long amount) { + slotReference.resolve(player).flatMap(Platform.INSTANCE::getEnergyStorage).ifPresent( + energyStorage -> energyStorage.extract(amount, Action.EXECUTE) + ); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/NetworkItemHelperImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/NetworkItemHelperImpl.java new file mode 100644 index 000000000..0d407a7fc --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/NetworkItemHelperImpl.java @@ -0,0 +1,85 @@ +package com.refinedmods.refinedstorage.common.support.network.item; + +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemContext; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemHelper; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemTargetBlockEntity; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.DataComponents; + +import java.util.List; +import java.util.Optional; + +import net.minecraft.ChatFormatting; +import net.minecraft.core.GlobalPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.block.entity.BlockEntity; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class NetworkItemHelperImpl implements NetworkItemHelper { + private static final MutableComponent UNBOUND = createTranslation("item", "network_item.unbound") + .withStyle(ChatFormatting.RED); + private static final Component UNBOUND_HELP = createTranslation("item", "network_item.unbound.help"); + + @Override + public boolean isBound(final ItemStack stack) { + return stack.has(DataComponents.INSTANCE.getNetworkLocation()); + } + + @Override + public void addTooltip(final ItemStack stack, final List lines) { + getNetworkLocation(stack).ifPresentOrElse(network -> lines.add(createTranslation( + "item", + "network_item.bound_to", + network.pos().getX(), + network.pos().getY(), + network.pos().getZ() + ).withStyle(ChatFormatting.GRAY)), () -> lines.add(UNBOUND)); + } + + @Override + public InteractionResult bind(final UseOnContext ctx) { + if (ctx.getPlayer() == null) { + return InteractionResult.PASS; + } + final ItemStack stack = ctx.getPlayer().getItemInHand(ctx.getHand()); + final BlockEntity blockEntity = ctx.getLevel().getBlockEntity(ctx.getClickedPos()); + if (!(blockEntity instanceof NetworkItemTargetBlockEntity)) { + return InteractionResult.PASS; + } + final GlobalPos pos = GlobalPos.of(ctx.getLevel().dimension(), blockEntity.getBlockPos()); + stack.set(DataComponents.INSTANCE.getNetworkLocation(), pos); + return InteractionResult.SUCCESS; + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + if (isBound(stack)) { + return Optional.empty(); + } + return Optional.of(new HelpTooltipComponent(UNBOUND_HELP)); + } + + @Override + public NetworkItemContext createContext(final ItemStack stack, + final ServerPlayer player, + final SlotReference slotReference) { + final Optional location = getNetworkLocation(stack); + return new NetworkItemContextImpl( + player, + slotReference, + location.orElse(null) + ); + } + + private Optional getNetworkLocation(final ItemStack stack) { + return Optional.ofNullable(stack.get(DataComponents.INSTANCE.getNetworkLocation())); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/NetworkItemPropertyFunction.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/NetworkItemPropertyFunction.java new file mode 100644 index 000000000..eac894531 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/NetworkItemPropertyFunction.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage.common.support.network.item; + +import com.refinedmods.refinedstorage.common.api.support.energy.AbstractNetworkEnergyItem; + +import javax.annotation.Nullable; + +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.item.ClampedItemPropertyFunction; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public class NetworkItemPropertyFunction implements ClampedItemPropertyFunction { + public static final ResourceLocation NAME = createIdentifier("network_bound_active"); + + @Override + public float unclampedCall(final ItemStack itemStack, + @Nullable final ClientLevel clientLevel, + @Nullable final LivingEntity livingEntity, + final int i) { + if (itemStack.getItem() instanceof AbstractNetworkEnergyItem item) { + return item.isBound(itemStack) ? 1 : 0; + } + return 0; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/package-info.java new file mode 100644 index 000000000..ca1e56073 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/item/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.network.item; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/package-info.java new file mode 100644 index 000000000..13072b67b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.network; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/package-info.java new file mode 100644 index 000000000..8b9d22b9b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/PacketContext.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/PacketContext.java new file mode 100644 index 000000000..8a3d5c0f0 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/PacketContext.java @@ -0,0 +1,8 @@ +package com.refinedmods.refinedstorage.common.support.packet; + +import net.minecraft.world.entity.player.Player; + +@FunctionalInterface +public interface PacketContext { + Player getPlayer(); +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/PacketHandler.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/PacketHandler.java new file mode 100644 index 000000000..ade9694ae --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/PacketHandler.java @@ -0,0 +1,6 @@ +package com.refinedmods.refinedstorage.common.support.packet; + +@FunctionalInterface +public interface PacketHandler { + void handle(T packet, PacketContext ctx); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/C2SPackets.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/C2SPackets.java index 7575266e7..bf5cf804f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/C2SPackets.java @@ -1,18 +1,20 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; +package com.refinedmods.refinedstorage.common.support.packet.c2s; import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyType; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.List; import java.util.UUID; +import org.apiguardian.api.API; + public final class C2SPackets { private C2SPackets() { } @@ -53,6 +55,7 @@ public static void sendResourceSlotChange(final int slotIndex, final boolean try Platform.INSTANCE.sendPacketToServer(new ResourceSlotChangePacket(slotIndex, tryAlternatives)); } + @API(status = API.Status.INTERNAL) public static void sendResourceFilterSlotChange(final PlatformResourceKey resource, final int slotIndex) { Platform.INSTANCE.sendPacketToServer(new ResourceFilterSlotChangePacket(slotIndex, resource)); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/CraftingGridClearPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/CraftingGridClearPacket.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/CraftingGridClearPacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/CraftingGridClearPacket.java index 92707d603..2397c8a0f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/CraftingGridClearPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/CraftingGridClearPacket.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; +package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record CraftingGridClearPacket(boolean toPlayerInventory) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>(createIdentifier("crafting_grid_clear")); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/CraftingGridRecipeTransferPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/CraftingGridRecipeTransferPacket.java new file mode 100644 index 000000000..be2d9e879 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/CraftingGridRecipeTransferPacket.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.common.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public record CraftingGridRecipeTransferPacket(List> recipe) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>( + createIdentifier("crafting_grid_recipe_transfer") + ); + public static final StreamCodec STREAM_CODEC = + StreamCodec.composite( + ByteBufCodecs.collection(ArrayList::new, + ByteBufCodecs.collection(ArrayList::new, ResourceCodecs.ITEM_STREAM_CODEC)), + CraftingGridRecipeTransferPacket::recipe, + CraftingGridRecipeTransferPacket::new + ); + + public static void handle(final CraftingGridRecipeTransferPacket packet, final PacketContext ctx) { + if (ctx.getPlayer().containerMenu instanceof CraftingGridContainerMenu craftingGridContainerMenu) { + craftingGridContainerMenu.transferRecipe(packet.recipe()); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/GridExtractPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/GridExtractPacket.java new file mode 100644 index 000000000..f8347bd17 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/GridExtractPacket.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.PacketUtil.enumStreamCodec; + +public record GridExtractPacket( + PlatformResourceKey resource, + GridExtractMode mode, + boolean cursor +) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_extract")); + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + ResourceCodecs.STREAM_CODEC, GridExtractPacket::resource, + enumStreamCodec(GridExtractMode.values()), GridExtractPacket::mode, + ByteBufCodecs.BOOL, GridExtractPacket::cursor, + GridExtractPacket::new + ); + + public static void handle(final GridExtractPacket packet, final PacketContext ctx) { + if (ctx.getPlayer().containerMenu instanceof GridExtractionStrategy strategy) { + strategy.onExtract(packet.resource, packet.mode, packet.cursor); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/GridInsertPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/GridInsertPacket.java new file mode 100644 index 000000000..d987e14fc --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/GridInsertPacket.java @@ -0,0 +1,33 @@ +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.PacketUtil.enumStreamCodec; + +public record GridInsertPacket(GridInsertMode mode, boolean tryAlternatives) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_insert")); + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + enumStreamCodec(GridInsertMode.values()), GridInsertPacket::mode, + ByteBufCodecs.BOOL, GridInsertPacket::tryAlternatives, + GridInsertPacket::new + ); + + public static void handle(final GridInsertPacket packet, final PacketContext ctx) { + if (ctx.getPlayer().containerMenu instanceof GridInsertionStrategy strategy) { + strategy.onInsert(packet.mode, packet.tryAlternatives); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/GridScrollPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/GridScrollPacket.java new file mode 100644 index 000000000..af502a242 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/GridScrollPacket.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.PacketUtil.enumStreamCodec; + +public record GridScrollPacket( + PlatformResourceKey resource, + GridScrollMode mode, + int slotIndex +) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_scroll")); + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + ResourceCodecs.STREAM_CODEC, GridScrollPacket::resource, + enumStreamCodec(GridScrollMode.values()), GridScrollPacket::mode, + ByteBufCodecs.INT, GridScrollPacket::slotIndex, + GridScrollPacket::new + ); + + public static void handle(final GridScrollPacket packet, final PacketContext ctx) { + if (ctx.getPlayer().containerMenu instanceof GridScrollingStrategy strategy) { + strategy.onScroll(packet.resource, packet.mode, packet.slotIndex); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/PropertyChangePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PropertyChangePacket.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/PropertyChangePacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PropertyChangePacket.java index ff59652d4..023074634 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/PropertyChangePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PropertyChangePacket.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; +package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; @@ -9,7 +9,7 @@ import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.resources.ResourceLocation; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record PropertyChangePacket(ResourceLocation propertyId, int value) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>(createIdentifier("property_change")); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/ResourceFilterSlotChangePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/ResourceFilterSlotChangePacket.java new file mode 100644 index 000000000..da24baa36 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/ResourceFilterSlotChangePacket.java @@ -0,0 +1,38 @@ +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static java.util.Objects.requireNonNull; + +public record ResourceFilterSlotChangePacket(int slotIndex, PlatformResourceKey resource) + implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>( + createIdentifier("resource_filter_slot_change") + ); + public static final StreamCodec STREAM_CODEC = StreamCodec + .composite( + ByteBufCodecs.INT, ResourceFilterSlotChangePacket::slotIndex, + ResourceCodecs.STREAM_CODEC, ResourceFilterSlotChangePacket::resource, + ResourceFilterSlotChangePacket::new + ); + + public static void handle(final ResourceFilterSlotChangePacket packet, final PacketContext ctx) { + if (ctx.getPlayer().containerMenu instanceof AbstractResourceContainerMenu containerMenu) { + containerMenu.handleResourceFilterSlotUpdate(packet.slotIndex, requireNonNull(packet.resource)); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/ResourceSlotAmountChangePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/ResourceSlotAmountChangePacket.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/ResourceSlotAmountChangePacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/ResourceSlotAmountChangePacket.java index ab4bb76d4..8eb6bbee2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/ResourceSlotAmountChangePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/ResourceSlotAmountChangePacket.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; +package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record ResourceSlotAmountChangePacket(int slotIndex, long amount) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>( diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/ResourceSlotChangePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/ResourceSlotChangePacket.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/ResourceSlotChangePacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/ResourceSlotChangePacket.java index 9c6ef003b..75a072e51 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/ResourceSlotChangePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/ResourceSlotChangePacket.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; +package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record ResourceSlotChangePacket(int slotIndex, boolean tryAlternatives) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>( diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SecurityCardBoundPlayerPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SecurityCardBoundPlayerPacket.java similarity index 80% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SecurityCardBoundPlayerPacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SecurityCardBoundPlayerPacket.java index 3aab91fd2..0541d4705 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SecurityCardBoundPlayerPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SecurityCardBoundPlayerPacket.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; +package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.security.SecurityCardContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import java.util.UUID; @@ -12,7 +12,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.world.entity.player.Player; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record SecurityCardBoundPlayerPacket(UUID playerId) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>( diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SecurityCardPermissionPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SecurityCardPermissionPacket.java new file mode 100644 index 000000000..90d4d4a12 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SecurityCardPermissionPacket.java @@ -0,0 +1,37 @@ +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.security.AbstractSecurityCardContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public record SecurityCardPermissionPacket(PlatformPermission permission, boolean allowed) + implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>( + createIdentifier("security_card_permission") + ); + public static final StreamCodec STREAM_CODEC = StreamCodec + .composite( + RefinedStorageApi.INSTANCE.getPermissionRegistry().streamCodec(), SecurityCardPermissionPacket::permission, + ByteBufCodecs.BOOL, SecurityCardPermissionPacket::allowed, + SecurityCardPermissionPacket::new + ); + + public static void handle(final SecurityCardPermissionPacket packet, final PacketContext ctx) { + if (ctx.getPlayer().containerMenu instanceof AbstractSecurityCardContainerMenu securityCardContainerMenu) { + securityCardContainerMenu.setPermission(packet.permission, packet.allowed); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SecurityCardResetPermissionPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SecurityCardResetPermissionPacket.java new file mode 100644 index 000000000..76b4c7fe3 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SecurityCardResetPermissionPacket.java @@ -0,0 +1,35 @@ +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.security.PlatformPermission; +import com.refinedmods.refinedstorage.common.security.AbstractSecurityCardContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public record SecurityCardResetPermissionPacket(PlatformPermission permission) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>( + createIdentifier("security_card_reset_permission") + ); + public static final StreamCodec STREAM_CODEC = + StreamCodec.composite( + RefinedStorageApi.INSTANCE.getPermissionRegistry().streamCodec(), + SecurityCardResetPermissionPacket::permission, + SecurityCardResetPermissionPacket::new + ); + + public static void handle(final SecurityCardResetPermissionPacket packet, final PacketContext ctx) { + if (ctx.getPlayer().containerMenu instanceof AbstractSecurityCardContainerMenu securityCardContainerMenu) { + securityCardContainerMenu.resetPermissionServer(packet.permission); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SingleAmountChangePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SingleAmountChangePacket.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SingleAmountChangePacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SingleAmountChangePacket.java index f86447ebc..a8ae10322 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SingleAmountChangePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/SingleAmountChangePacket.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; +package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractSingleAmountContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record SingleAmountChangePacket(double amount) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>( diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/StorageInfoRequestPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/StorageInfoRequestPacket.java new file mode 100644 index 000000000..c887b7338 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/StorageInfoRequestPacket.java @@ -0,0 +1,41 @@ +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.packet.s2c.S2CPackets; + +import java.util.UUID; + +import net.minecraft.core.UUIDUtil; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public record StorageInfoRequestPacket(UUID storageId) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>( + createIdentifier("storage_info_request") + ); + public static final StreamCodec STREAM_CODEC = StreamCodec + .composite( + UUIDUtil.STREAM_CODEC, StorageInfoRequestPacket::storageId, + StorageInfoRequestPacket::new + ); + + public static void handle(final StorageInfoRequestPacket packet, final PacketContext ctx) { + final Player player = ctx.getPlayer(); + final StorageInfo info = RefinedStorageApi.INSTANCE + .getStorageRepository(player.getCommandSenderWorld()) + .getInfo(packet.storageId()); + S2CPackets.sendStorageInfoResponse((ServerPlayer) player, packet.storageId, info); + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/UseSlotReferencedItemPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/UseSlotReferencedItemPacket.java new file mode 100644 index 000000000..d039c30d3 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/UseSlotReferencedItemPacket.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceHandlerItem; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public record UseSlotReferencedItemPacket(SlotReference slotReference) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>( + createIdentifier("use_slot_referenced_item") + ); + public static final StreamCodec STREAM_CODEC = StreamCodec + .composite( + SlotReferenceFactory.STREAM_CODEC, UseSlotReferencedItemPacket::slotReference, + UseSlotReferencedItemPacket::new + ); + + public static void handle(final UseSlotReferencedItemPacket packet, final PacketContext ctx) { + final Player player = ctx.getPlayer(); + packet.slotReference.resolve(player).ifPresent(stack -> { + if (!(stack.getItem() instanceof SlotReferenceHandlerItem handlerItem)) { + return; + } + handlerItem.use((ServerPlayer) player, stack, packet.slotReference); + }); + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/package-info.java new file mode 100644 index 000000000..b72ca3e6a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/package-info.java new file mode 100644 index 000000000..d358b6354 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.packet; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/EnergyInfoPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/EnergyInfoPacket.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/EnergyInfoPacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/EnergyInfoPacket.java index 51bbaa440..535f448d3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/EnergyInfoPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/EnergyInfoPacket.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; +package com.refinedmods.refinedstorage.common.support.packet.s2c; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.energy.EnergyContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; @@ -9,7 +9,7 @@ import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.world.inventory.AbstractContainerMenu; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record EnergyInfoPacket(long stored, long capacity) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>(createIdentifier("energy_info")); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/GridActivePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/GridActivePacket.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/GridActivePacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/GridActivePacket.java index 4d6ca3917..dafa0650d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/GridActivePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/GridActivePacket.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; +package com.refinedmods.refinedstorage.common.support.packet.s2c; import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; @@ -9,7 +9,7 @@ import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.world.inventory.AbstractContainerMenu; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record GridActivePacket(boolean active) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_active")); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/GridClearPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/GridClearPacket.java new file mode 100644 index 000000000..04ad06ea5 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/GridClearPacket.java @@ -0,0 +1,32 @@ +package com.refinedmods.refinedstorage.common.support.packet.s2c; + +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.world.inventory.AbstractContainerMenu; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public class GridClearPacket implements CustomPacketPayload { + public static final GridClearPacket INSTANCE = new GridClearPacket(); + public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_clear")); + public static final StreamCodec STREAM_CODEC = StreamCodec.unit(INSTANCE); + + private GridClearPacket() { + } + + public static void handle(final PacketContext ctx) { + final AbstractContainerMenu menu = ctx.getPlayer().containerMenu; + if (menu instanceof AbstractGridContainerMenu grid) { + grid.onClear(); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/GridUpdatePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/GridUpdatePacket.java new file mode 100644 index 000000000..534396b7e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/GridUpdatePacket.java @@ -0,0 +1,42 @@ +package com.refinedmods.refinedstorage.common.support.packet.s2c; + +import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage.common.storage.StorageCodecs; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; + +import java.util.Optional; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public record GridUpdatePacket( + PlatformResourceKey resource, + long amount, + Optional trackedResource +) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_update")); + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + ResourceCodecs.STREAM_CODEC, GridUpdatePacket::resource, + ByteBufCodecs.VAR_LONG, GridUpdatePacket::amount, + StorageCodecs.TRACKED_RESOURCE_OPTIONAL_STREAM_CODEC, GridUpdatePacket::trackedResource, + GridUpdatePacket::new + ); + + public static void handle(final GridUpdatePacket packet, final PacketContext ctx) { + if (ctx.getPlayer().containerMenu instanceof AbstractGridContainerMenu containerMenu) { + containerMenu.onResourceUpdate(packet.resource, packet.amount, packet.trackedResource.orElse(null)); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/NetworkTransmitterStatusPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NetworkTransmitterStatusPacket.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/NetworkTransmitterStatusPacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NetworkTransmitterStatusPacket.java index 3d01be7a7..e38accfb6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/NetworkTransmitterStatusPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NetworkTransmitterStatusPacket.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; +package com.refinedmods.refinedstorage.common.support.packet.s2c; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterData; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterData; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; @@ -12,7 +12,7 @@ import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.world.inventory.AbstractContainerMenu; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record NetworkTransmitterStatusPacket(boolean error, Component message) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>( diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/NoPermissionPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NoPermissionPacket.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/NoPermissionPacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NoPermissionPacket.java index 08b908dde..0e2908da0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/NoPermissionPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NoPermissionPacket.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; +package com.refinedmods.refinedstorage.common.support.packet.s2c; -import com.refinedmods.refinedstorage.platform.common.util.SecurityToastUtil; +import com.refinedmods.refinedstorage.common.util.SecurityToastUtil; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; @@ -8,7 +8,7 @@ import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record NoPermissionPacket(Component component) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>(createIdentifier("no_permission")); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/ResourceSlotUpdatePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/ResourceSlotUpdatePacket.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/ResourceSlotUpdatePacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/ResourceSlotUpdatePacket.java index e2854d146..8ddf3703c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/ResourceSlotUpdatePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/ResourceSlotUpdatePacket.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; +package com.refinedmods.refinedstorage.common.support.packet.s2c; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; import java.util.Optional; @@ -12,7 +12,7 @@ import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record ResourceSlotUpdatePacket( int slotIndex, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/S2CPackets.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/S2CPackets.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java index 6955bdaac..b02897414 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/S2CPackets.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; +package com.refinedmods.refinedstorage.common.support.packet.s2c; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterData; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterData; import java.util.Optional; import java.util.UUID; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/StorageInfoResponsePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/StorageInfoResponsePacket.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/StorageInfoResponsePacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/StorageInfoResponsePacket.java index b335af780..7f04650db 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/StorageInfoResponsePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/StorageInfoResponsePacket.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; +package com.refinedmods.refinedstorage.common.support.packet.s2c; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.common.storage.ClientStorageRepository; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.storage.ClientStorageRepository; import java.util.UUID; @@ -11,7 +11,7 @@ import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record StorageInfoResponsePacket(UUID storageId, long stored, long capacity) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>( @@ -27,7 +27,7 @@ public record StorageInfoResponsePacket(UUID storageId, long stored, long capaci public static void handle(final StorageInfoResponsePacket packet) { final ClientStorageRepository storageRepository = - (ClientStorageRepository) PlatformApi.INSTANCE.getClientStorageRepository(); + (ClientStorageRepository) RefinedStorageApi.INSTANCE.getClientStorageRepository(); storageRepository.setInfo(packet.storageId, packet.stored, packet.capacity); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/WirelessTransmitterRangePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/WirelessTransmitterRangePacket.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/WirelessTransmitterRangePacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/WirelessTransmitterRangePacket.java index 7f35dc0ac..993a67aa9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/WirelessTransmitterRangePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/WirelessTransmitterRangePacket.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; +package com.refinedmods.refinedstorage.common.support.packet.s2c; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.WirelessTransmitterContainerMenu; +import com.refinedmods.refinedstorage.common.support.packet.PacketContext; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterContainerMenu; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public record WirelessTransmitterRangePacket(int range) implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>( diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/package-info.java new file mode 100644 index 000000000..628d06f50 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.packet.s2c; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/registry/PlatformRegistryImpl.java similarity index 95% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/registry/PlatformRegistryImpl.java index ceee95c25..f96eae0be 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/registry/PlatformRegistryImpl.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.registry; +package com.refinedmods.refinedstorage.common.support.registry; import com.refinedmods.refinedstorage.api.core.CoreValidations; -import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage.common.api.support.registry.PlatformRegistry; import java.util.ArrayList; import java.util.Collections; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/registry/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/registry/package-info.java new file mode 100644 index 000000000..f11829546 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/registry/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.registry; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/AbstractDiskLedBlockEntityRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/AbstractDiskLedBlockEntityRenderer.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/AbstractDiskLedBlockEntityRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/AbstractDiskLedBlockEntityRenderer.java index 5099afa6b..494a814ef 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/AbstractDiskLedBlockEntityRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/AbstractDiskLedBlockEntityRenderer.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.support.render; +package com.refinedmods.refinedstorage.common.support.render; import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/AbstractFluidRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/AbstractFluidRenderer.java similarity index 98% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/AbstractFluidRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/AbstractFluidRenderer.java index d9546a411..78e2beea1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/AbstractFluidRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/AbstractFluidRenderer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.render; +package com.refinedmods.refinedstorage.common.support.render; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.BufferBuilder; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/CubeBuilder.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/CubeBuilder.java similarity index 98% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/CubeBuilder.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/CubeBuilder.java index f3dc24824..595720ab7 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/CubeBuilder.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/CubeBuilder.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.render; +package com.refinedmods.refinedstorage.common.support.render; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/FluidRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/FluidRenderer.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/FluidRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/FluidRenderer.java index e09304332..8a9a06808 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/FluidRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/FluidRenderer.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.render; +package com.refinedmods.refinedstorage.common.support.render; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/package-info.java new file mode 100644 index 000000000..81a734d0c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/render/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.render; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/AbstractResourceContainerContainerAdapter.java similarity index 94% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/AbstractResourceContainerContainerAdapter.java index 742e533d0..34f3641bc 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/AbstractResourceContainerContainerAdapter.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; import net.minecraft.world.Container; import net.minecraft.world.entity.player.Player; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/CompositeRecipeModIngredientConverter.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/CompositeRecipeModIngredientConverter.java similarity index 77% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/CompositeRecipeModIngredientConverter.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/CompositeRecipeModIngredientConverter.java index 6946f20a8..95a90073f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/CompositeRecipeModIngredientConverter.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/CompositeRecipeModIngredientConverter.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.RecipeModIngredientConverter; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.RecipeModIngredientConverter; import java.util.Collection; import java.util.HashSet; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResource.java new file mode 100644 index 000000000..5e1c7a564 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResource.java @@ -0,0 +1,39 @@ +package com.refinedmods.refinedstorage.common.support.resource; + +import com.refinedmods.refinedstorage.api.core.CoreValidations; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; + +import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.world.level.material.Fluid; +import org.apiguardian.api.API; + +@API(status = API.Status.INTERNAL) +public record FluidResource(Fluid fluid, DataComponentPatch components) + implements PlatformResourceKey, FuzzyModeNormalizer { + public FluidResource(final Fluid fluid) { + this(fluid, DataComponentPatch.EMPTY); + } + + public FluidResource(final Fluid fluid, final DataComponentPatch components) { + this.fluid = CoreValidations.validateNotNull(fluid, "Fluid must not be null"); + this.components = CoreValidations.validateNotNull(components, "Components must not be null"); + } + + @Override + public ResourceKey normalize() { + return new FluidResource(fluid); + } + + @Override + public long getInterfaceExportLimit() { + return ResourceTypes.FLUID.getInterfaceExportLimit(); + } + + @Override + public ResourceType getResourceType() { + return ResourceTypes.FLUID; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceContainerInsertStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceContainerInsertStrategy.java new file mode 100644 index 000000000..06582a71c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceContainerInsertStrategy.java @@ -0,0 +1,33 @@ +package com.refinedmods.refinedstorage.common.support.resource; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainerInsertStrategy; + +import java.util.Optional; + +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; + +public class FluidResourceContainerInsertStrategy implements ResourceContainerInsertStrategy { + private static final ItemStack EMPTY_BUCKET = new ItemStack(Items.BUCKET); + + @Override + public Optional insert(final ItemStack container, final ResourceAmount resourceAmount) { + return Platform.INSTANCE.fillContainer(container, resourceAmount).map( + result -> new InsertResult(result.container(), result.amount()) + ); + } + + @Override + public Optional getConversionInfo(final ResourceKey resource) { + if (!(resource instanceof FluidResource fluidResource)) { + return Optional.empty(); + } + return Platform.INSTANCE.getFilledBucket(fluidResource).map(filledBucket -> new ConversionInfo( + EMPTY_BUCKET, + filledBucket + )); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceFactory.java new file mode 100644 index 000000000..0d14c3fc7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceFactory.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage.common.support.resource; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; + +import java.util.Optional; + +import net.minecraft.world.item.ItemStack; + +public class FluidResourceFactory implements ResourceFactory { + @Override + public Optional create(final ItemStack stack) { + return Platform.INSTANCE.drainContainer(stack).map(result -> new ResourceAmount( + result.fluid(), + Platform.INSTANCE.getBucketAmount() + )); + } + + @Override + public boolean isValid(final ResourceKey resource) { + return resource instanceof FluidResource; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceRendering.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java index d39a08b71..7086a8d1f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; -import com.refinedmods.refinedstorage.platform.common.Platform; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceType.java new file mode 100644 index 000000000..98cddc50f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceType.java @@ -0,0 +1,80 @@ +package com.refinedmods.refinedstorage.common.support.resource; + +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperationsImpl; +import com.refinedmods.refinedstorage.api.grid.view.GridResource; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.resource.AbstractResourceType; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.grid.view.FluidGridResource; +import com.refinedmods.refinedstorage.common.support.TextureIds; + +import java.util.Optional; + +import com.mojang.serialization.MapCodec; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class FluidResourceType extends AbstractResourceType { + FluidResourceType() { + super( + "FLUID", + createTranslation("misc", "resource_type.fluid"), + TextureIds.ICONS, + 16, + 128 + ); + } + + @Override + public Optional toGridResource(final ResourceAmount resourceAmount) { + return Platform.INSTANCE.getFluidGridResourceFactory().apply(resourceAmount); + } + + @Override + public boolean isGridResourceBelonging(final GridResource gridResource) { + return gridResource instanceof FluidGridResource; + } + + @Override + public long normalizeAmount(final double amount) { + return (long) (amount * Platform.INSTANCE.getBucketAmount()); + } + + @Override + public double getDisplayAmount(final long amount) { + return amount / (double) Platform.INSTANCE.getBucketAmount(); + } + + @Override + public long getInterfaceExportLimit() { + return Platform.INSTANCE.getBucketAmount() * 16; + } + + @Override + public GridOperations createGridOperations(final RootStorage rootStorage, final Actor actor) { + return new GridOperationsImpl( + rootStorage, + actor, + fluidResource -> Long.MAX_VALUE, + Platform.INSTANCE.getBucketAmount() + ); + } + + @Override + @SuppressWarnings({"unchecked", "rawtypes"}) + public MapCodec getMapCodec() { + return (MapCodec) ResourceCodecs.FLUID_MAP_CODEC; + } + + @Override + @SuppressWarnings({"unchecked", "rawtypes"}) + public StreamCodec getStreamCodec() { + return (StreamCodec) ResourceCodecs.FLUID_STREAM_CODEC; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResource.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResource.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResource.java index 52f987d1f..a147b97d0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResource.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResource.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.core.CoreValidations; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.FuzzyModeNormalizer; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.api.support.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import net.minecraft.core.component.DataComponentPatch; import net.minecraft.world.item.Item; @@ -13,7 +13,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") +@API(status = API.Status.INTERNAL) public record ItemResource(Item item, DataComponentPatch components) implements PlatformResourceKey, FuzzyModeNormalizer { private static final Logger LOGGER = LoggerFactory.getLogger(ItemResource.class); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceFactory.java similarity index 80% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceFactory.java index b73422734..d7f16e1e6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceFactory.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceRendering.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java index 858cbe0d7..7ea0b9e85 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; import java.util.Collections; import java.util.HashMap; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceType.java new file mode 100644 index 000000000..0588b9a0b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceType.java @@ -0,0 +1,82 @@ +package com.refinedmods.refinedstorage.common.support.resource; + +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperationsImpl; +import com.refinedmods.refinedstorage.api.grid.view.GridResource; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.resource.AbstractResourceType; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.grid.view.ItemGridResource; +import com.refinedmods.refinedstorage.common.support.TextureIds; + +import java.util.Optional; + +import com.mojang.serialization.MapCodec; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class ItemResourceType extends AbstractResourceType { + ItemResourceType() { + super( + "ITEM", + createTranslation("misc", "resource_type.item"), + TextureIds.ICONS, + 0, + 128 + ); + } + + @Override + public Optional toGridResource(final ResourceAmount resourceAmount) { + return Platform.INSTANCE.getItemGridResourceFactory().apply(resourceAmount); + } + + @Override + public boolean isGridResourceBelonging(final GridResource gridResource) { + return gridResource instanceof ItemGridResource; + } + + @Override + public long normalizeAmount(final double amount) { + return (long) amount; + } + + @Override + public double getDisplayAmount(final long amount) { + return amount; + } + + @Override + public long getInterfaceExportLimit() { + return 64; + } + + @Override + public GridOperations createGridOperations(final RootStorage rootStorage, final Actor actor) { + return new GridOperationsImpl( + rootStorage, + actor, + resource -> resource instanceof ItemResource itemResource + ? itemResource.item().getDefaultMaxStackSize() + : 0, + 1 + ); + } + + @Override + @SuppressWarnings({"unchecked", "rawtypes"}) + public MapCodec getMapCodec() { + return (MapCodec) ResourceCodecs.ITEM_MAP_CODEC; + } + + @Override + @SuppressWarnings({"unchecked", "rawtypes"}) + public StreamCodec getStreamCodec() { + return (StreamCodec) ResourceCodecs.ITEM_STREAM_CODEC; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceCodecs.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceCodecs.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceCodecs.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceCodecs.java index bfa0d16f7..9f44cb67b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceCodecs.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceCodecs.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import java.util.Optional; @@ -33,7 +33,7 @@ public final class ResourceCodecs { ).apply(ins, FluidResource::new)); public static final Codec FLUID_CODEC = FLUID_MAP_CODEC.codec(); - public static final Codec CODEC = PlatformApi.INSTANCE.getResourceTypeRegistry() + public static final Codec CODEC = RefinedStorageApi.INSTANCE.getResourceTypeRegistry() .codec() .dispatch(PlatformResourceKey::getResourceType, ResourceType::getMapCodec); public static final Codec AMOUNT_CODEC = RecordCodecBuilder.create(instance -> instance.group( @@ -45,14 +45,16 @@ public final class ResourceCodecs { @Override public PlatformResourceKey decode(final RegistryFriendlyByteBuf buf) { final ResourceLocation id = buf.readResourceLocation(); - final ResourceType resourceType = PlatformApi.INSTANCE.getResourceTypeRegistry().get(id).orElseThrow(); + final ResourceType resourceType = RefinedStorageApi.INSTANCE.getResourceTypeRegistry() + .get(id) + .orElseThrow(); return resourceType.getStreamCodec().decode(buf); } @Override public void encode(final RegistryFriendlyByteBuf buf, final PlatformResourceKey resourceKey) { final ResourceType resourceType = resourceKey.getResourceType(); - final ResourceLocation id = PlatformApi.INSTANCE.getResourceTypeRegistry().getId(resourceType) + final ResourceLocation id = RefinedStorageApi.INSTANCE.getResourceTypeRegistry().getId(resourceType) .orElseThrow(); buf.writeResourceLocation(id); resourceType.getStreamCodec().encode(buf, resourceKey); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceContainerData.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceContainerData.java index 899b026d5..e09ed5a89 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceContainerData.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceContainerImpl.java similarity index 95% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceContainerImpl.java index a026838a7..f41dcc314 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceContainerImpl.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.core.CoreValidations; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; -import com.refinedmods.refinedstorage.platform.common.util.MathUtil; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.util.MathUtil; import java.util.ArrayList; import java.util.Collections; @@ -374,8 +374,8 @@ public static ResourceContainer createForFilter(final int size) { return new ResourceContainerImpl( size, resource -> Long.MAX_VALUE, - PlatformApi.INSTANCE.getItemResourceFactory(), - PlatformApi.INSTANCE.getAlternativeResourceFactories() + RefinedStorageApi.INSTANCE.getItemResourceFactory(), + RefinedStorageApi.INSTANCE.getAlternativeResourceFactories() ); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceContainerSlot.java similarity index 78% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerSlot.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceContainerSlot.java index e7022129b..b8eff1aed 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerSlot.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceContainerSlot.java @@ -1,8 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; import java.util.Objects; @@ -19,10 +18,6 @@ class ResourceContainerSlot { : ItemStack.EMPTY; } - long getAmount() { - return resourceAmount.getAmount(); - } - ResourceAmount getResourceAmount() { return resourceAmount; } @@ -31,10 +26,6 @@ PlatformResourceKey getPlatformResource() { return (PlatformResourceKey) resourceAmount.getResource(); } - ResourceType getResourceType() { - return getPlatformResource().getResourceType(); - } - ItemStack getStackRepresentation() { return stackRepresentation; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceTypes.java new file mode 100644 index 000000000..7fcfffb3f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ResourceTypes.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage.common.support.resource; + +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; + +public final class ResourceTypes { + public static final ResourceType ITEM = new ItemResourceType(); + public static final ResourceType FLUID = new FluidResourceType(); + + private ResourceTypes() { + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/list/FuzzyResourceListImpl.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/list/FuzzyResourceListImpl.java index c7f354030..ad6eb1bff 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/list/FuzzyResourceListImpl.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource.list; +package com.refinedmods.refinedstorage.common.support.resource.list; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.resource.list.AbstractProxyResourceList; import com.refinedmods.refinedstorage.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage.platform.api.support.resource.FuzzyModeNormalizer; -import com.refinedmods.refinedstorage.platform.api.support.resource.list.FuzzyResourceList; +import com.refinedmods.refinedstorage.common.api.support.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage.common.api.support.resource.list.FuzzyResourceList; import java.util.Collection; import java.util.Collections; @@ -15,9 +15,6 @@ import java.util.Optional; import java.util.Set; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4") public class FuzzyResourceListImpl extends AbstractProxyResourceList implements FuzzyResourceList { private final Map> normalizedFuzzyMap = new HashMap<>(); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/list/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/list/package-info.java new file mode 100644 index 000000000..44c3bc303 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/list/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.resource.list; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/package-info.java new file mode 100644 index 000000000..146402820 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.resource; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/CompositeSlotReferenceProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/CompositeSlotReferenceProvider.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/CompositeSlotReferenceProvider.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/CompositeSlotReferenceProvider.java index f01a8cf60..dec851288 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/CompositeSlotReferenceProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/CompositeSlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.slotreference; +package com.refinedmods.refinedstorage.common.support.slotreference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceProvider; import java.util.ArrayList; import java.util.List; @@ -12,7 +12,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class CompositeSlotReferenceProvider implements SlotReferenceProvider { private final List providers = new ArrayList<>(List.of( diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReference.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/InventorySlotReference.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReference.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/InventorySlotReference.java index 5af624b67..c1dddcd89 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReference.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/InventorySlotReference.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.slotreference; +package com.refinedmods.refinedstorage.common.support.slotreference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceFactory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/InventorySlotReferenceFactory.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceFactory.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/InventorySlotReferenceFactory.java index ec6f5660b..7e6b9deb9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceFactory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/InventorySlotReferenceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.slotreference; +package com.refinedmods.refinedstorage.common.support.slotreference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceFactory; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/InventorySlotReferenceProvider.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceProvider.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/InventorySlotReferenceProvider.java index d5ec557e1..a72c1516e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/InventorySlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.slotreference; +package com.refinedmods.refinedstorage.common.support.slotreference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReferenceProvider; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/package-info.java new file mode 100644 index 000000000..14aebfcd7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/slotreference/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.slotreference; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/AbstractStretchingScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/AbstractStretchingScreen.java similarity index 94% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/AbstractStretchingScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/AbstractStretchingScreen.java index ce271e0fd..d1a71632a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/AbstractStretchingScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/AbstractStretchingScreen.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.support.stretching; +package com.refinedmods.refinedstorage.common.support.stretching; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.widget.ScrollbarWidget; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.widget.ScrollbarWidget; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/ScreenSize.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSize.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/ScreenSize.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSize.java index dded9afea..e4c5c9868 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/ScreenSize.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSize.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.stretching; +package com.refinedmods.refinedstorage.common.support.stretching; public enum ScreenSize { STRETCH, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeListener.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeListener.java new file mode 100644 index 000000000..748a2002f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeListener.java @@ -0,0 +1,6 @@ +package com.refinedmods.refinedstorage.common.support.stretching; + +@FunctionalInterface +public interface ScreenSizeListener { + void onScreenReady(int playerInventoryY); +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/ScreenSizeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeSideButtonWidget.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/ScreenSizeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeSideButtonWidget.java index 5d976b10c..dccbbeb9c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/ScreenSizeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeSideButtonWidget.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.support.stretching; +package com.refinedmods.refinedstorage.common.support.stretching; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class ScreenSizeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "screen_size"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/package-info.java new file mode 100644 index 000000000..cbecde1b3 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.stretching; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/CompositeClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/CompositeClientTooltipComponent.java similarity index 95% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/CompositeClientTooltipComponent.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/CompositeClientTooltipComponent.java index 26b15e285..b1a2c7989 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/CompositeClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/CompositeClientTooltipComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.tooltip; +package com.refinedmods.refinedstorage.common.support.tooltip; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/HelpClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/HelpClientTooltipComponent.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/HelpClientTooltipComponent.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/HelpClientTooltipComponent.java index 89df5f0c3..23cf658a8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/HelpClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/HelpClientTooltipComponent.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.tooltip; +package com.refinedmods.refinedstorage.common.support.tooltip; -import com.refinedmods.refinedstorage.platform.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.support.TextureIds; import java.util.List; @@ -15,7 +15,7 @@ import net.minecraft.util.FormattedCharSequence; import org.joml.Matrix4f; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslationAsHeading; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslationAsHeading; import static net.minecraft.client.gui.screens.Screen.hasShiftDown; public class HelpClientTooltipComponent implements ClientTooltipComponent { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java new file mode 100644 index 000000000..2af039f4f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java @@ -0,0 +1,155 @@ +package com.refinedmods.refinedstorage.common.support.tooltip; + +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; + +import javax.annotation.Nullable; + +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.world.item.ItemStack; + +public class MouseClientTooltipComponent implements ClientTooltipComponent { + private static final int PADDING = 4; + + private final Type type; + private final IconRenderer iconRenderer; + @Nullable + private final String amount; + + private MouseClientTooltipComponent(final Type type, + final IconRenderer iconRenderer, + @Nullable final String amount) { + this.type = type; + this.iconRenderer = iconRenderer; + this.amount = amount; + } + + public static ClientTooltipComponent fluid(final Type type, + final FluidResource fluidResource, + @Nullable final String amount) { + return new MouseClientTooltipComponent( + type, + (graphics, x, y) -> Platform.INSTANCE.getFluidRenderer().render( + graphics.pose(), + x, + y, + fluidResource + ), + amount + ); + } + + public static ClientTooltipComponent item(final Type type, + final ItemStack stack, + @Nullable final String amount) { + return new MouseClientTooltipComponent( + type, + (graphics, x, y) -> graphics.renderItem(stack, x, y), + amount + ); + } + + public static ClientTooltipComponent itemWithDecorations(final Type type, + final ItemStack stack, + @Nullable final String amount) { + return new MouseClientTooltipComponent( + type, + (graphics, x, y) -> { + graphics.renderItem(stack, x, y); + graphics.renderItemDecorations(Minecraft.getInstance().font, stack, x, y); + }, + amount + ); + } + + public static ClientTooltipComponent itemConversion(final Type type, + final ItemStack from, + final ItemStack to, + @Nullable final String amount) { + return new MouseClientTooltipComponent( + type, + new IconRenderer() { + @Override + public void render(final GuiGraphics graphics, final int x, final int y) { + graphics.renderItem(from, x, y); + graphics.blit(TextureIds.ICONS, x + 16 + 2, y, 234, 133, 22, 15); + graphics.renderItem(to, x + 16 + 2 + 22 + 2, y); + } + + @Override + public int getWidth() { + return 16 + 2 + 22 + 2 + 16; + } + }, + amount + ); + } + + public static ClientTooltipComponent resource(final Type type, + final ResourceKey resource, + @Nullable final String amount) { + return new MouseClientTooltipComponent( + type, + (graphics, x, y) -> RefinedStorageApi.INSTANCE.getResourceRendering(resource) + .render(resource, graphics, x, y), + amount + ); + } + + @Override + public int getHeight() { + return 18; + } + + @Override + public int getWidth(final Font font) { + return 9 + PADDING + iconRenderer.getWidth(); + } + + @Override + public void renderImage(final Font font, final int x, final int y, final GuiGraphics graphics) { + graphics.blit(TextureIds.ICONS, x + type.leftPad, y, type.x, type.y, type.width, type.height); + iconRenderer.render(graphics, x + 9 + PADDING, y); + if (amount != null) { + final PoseStack poseStack = graphics.pose(); + poseStack.pushPose(); + poseStack.translate(0.0F, 0.0F, 200.0F); + graphics.drawString(font, amount, x + 9 + PADDING + 16 - font.width(amount), y + 9, 16777215, true); + poseStack.popPose(); + } + } + + private interface IconRenderer { + void render(GuiGraphics graphics, int x, int y); + + default int getWidth() { + return 16; + } + } + + public enum Type { + LEFT(247, 0, 180, 9, 13), + RIGHT(238, 2, 180, 9, 13); + + private final int x; + private final int leftPad; + private final int y; + private final int width; + private final int height; + + Type(final int x, final int leftPad, final int y, final int width, final int height) { + this.x = x; + this.leftPad = leftPad; + this.y = y; + this.width = width; + this.height = height; + } + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/ResourceClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/ResourceClientTooltipComponent.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java index 253e36839..c5bb0b3a4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/ResourceClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.support.tooltip; +package com.refinedmods.refinedstorage.common.support.tooltip; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; import java.util.Objects; @@ -33,7 +33,7 @@ public int getWidth(final Font font) { @Override public void renderImage(final Font font, final int x, final int y, final GuiGraphics graphics) { - PlatformApi.INSTANCE.getResourceRendering(resourceAmount.getResource()).render( + RefinedStorageApi.INSTANCE.getResourceRendering(resourceAmount.getResource()).render( resourceAmount.getResource(), graphics, x, @@ -49,7 +49,7 @@ public void renderImage(final Font font, final int x, final int y, final GuiGrap } private static Component getNameWithAmount(final ResourceAmount resourceAmount) { - final ResourceRendering rendering = PlatformApi.INSTANCE.getResourceRendering( + final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering( resourceAmount.getResource() ); final String amount = rendering.getDisplayedAmount(resourceAmount.getAmount(), true); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/SmallText.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/SmallText.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/SmallText.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/SmallText.java index 38a77e65e..8d71dee69 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/SmallText.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/SmallText.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.tooltip; +package com.refinedmods.refinedstorage.common.support.tooltip; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/SmallTextClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/SmallTextClientTooltipComponent.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/SmallTextClientTooltipComponent.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/SmallTextClientTooltipComponent.java index 0ac9934eb..20190dafb 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/SmallTextClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/SmallTextClientTooltipComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.tooltip; +package com.refinedmods.refinedstorage.common.support.tooltip; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/package-info.java new file mode 100644 index 000000000..573cd0b2e --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.tooltip; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/AbstractSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractSideButtonWidget.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/AbstractSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractSideButtonWidget.java index c9706f073..b91358499 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/AbstractSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractSideButtonWidget.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.TextureIds; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.HelpClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.SmallTextClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.support.tooltip.HelpClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.tooltip.SmallTextClientTooltipComponent; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractYesNoSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractYesNoSideButtonWidget.java new file mode 100644 index 000000000..8aa44b9be --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractYesNoSideButtonWidget.java @@ -0,0 +1,33 @@ +package com.refinedmods.refinedstorage.common.support.widget; + +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; + +import net.minecraft.network.chat.MutableComponent; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.NO; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.YES; + +public abstract class AbstractYesNoSideButtonWidget extends AbstractSideButtonWidget { + protected final ClientProperty property; + private final MutableComponent title; + + protected AbstractYesNoSideButtonWidget(final ClientProperty property, final MutableComponent title) { + super(createPressAction(property)); + this.property = property; + this.title = title; + } + + private static OnPress createPressAction(final ClientProperty property) { + return btn -> property.setValue(!property.getValue()); + } + + @Override + protected MutableComponent getTitle() { + return title; + } + + @Override + protected MutableComponent getSubText() { + return Boolean.TRUE.equals(property.getValue()) ? YES : NO; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/CustomCheckboxWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/CustomCheckboxWidget.java similarity index 98% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/CustomCheckboxWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/CustomCheckboxWidget.java index e090114b7..aca5918a6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/CustomCheckboxWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/CustomCheckboxWidget.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/FuzzyModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/FuzzyModeSideButtonWidget.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/FuzzyModeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/FuzzyModeSideButtonWidget.java index 743439dbf..5beb1160e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/FuzzyModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/FuzzyModeSideButtonWidget.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; import java.util.function.Supplier; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class FuzzyModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "fuzzy_mode"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/History.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/History.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/History.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/History.java index 1c912088f..5494b958d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/History.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/History.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; import java.util.List; @@ -16,14 +16,13 @@ public String older() { } if (index == -1) { index = items.size() - 1; - return items.get(index); } else { index--; if (index < 0) { index = 0; } - return items.get(index); } + return items.get(index); } public String newer() { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/HoveredImageButton.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/HoveredImageButton.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/HoveredImageButton.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/HoveredImageButton.java index 269f03306..09fd5bdf1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/HoveredImageButton.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/HoveredImageButton.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.ImageButton; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/ProgressWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ProgressWidget.java similarity index 91% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/ProgressWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ProgressWidget.java index f471c70ed..8cf60a071 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/ProgressWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ProgressWidget.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; import java.util.List; import java.util.function.DoubleSupplier; @@ -11,7 +11,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class ProgressWidget extends AbstractWidget { private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/widgets.png"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/RedstoneModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/RedstoneModeSideButtonWidget.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/RedstoneModeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/RedstoneModeSideButtonWidget.java index eba1aa4b9..ebe96e777 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/RedstoneModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/RedstoneModeSideButtonWidget.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; import javax.annotation.Nullable; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class RedstoneModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "redstone_mode"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SchedulingModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SchedulingModeSideButtonWidget.java similarity index 82% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SchedulingModeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SchedulingModeSideButtonWidget.java index b1cd2ab66..ae54ec655 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SchedulingModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SchedulingModeSideButtonWidget.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; -import com.refinedmods.refinedstorage.platform.common.support.SchedulingModeType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.SchedulingModeType; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class SchedulingModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "scheduling_mode"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/ScrollbarWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ScrollbarWidget.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/ScrollbarWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ScrollbarWidget.java index 5635167fa..7f0e34a89 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/ScrollbarWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ScrollbarWidget.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; -import com.refinedmods.refinedstorage.platform.common.Platform; +import com.refinedmods.refinedstorage.common.Platform; import java.util.function.DoubleConsumer; import javax.annotation.Nullable; @@ -11,7 +11,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class ScrollbarWidget extends AbstractWidget { private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/widgets.png"); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SearchFieldWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SearchFieldWidget.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SearchFieldWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SearchFieldWidget.java index e7c6a7b70..fb9c50eb7 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SearchFieldWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SearchFieldWidget.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.KeyMappings; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.content.KeyMappings; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.components.EditBox; @@ -72,7 +72,7 @@ private boolean shouldMoveControlToParent(final int keyCode, final boolean canLo saveHistory(); setFocused(false); // If we are autoselected, we need to move control back to the parent straight away. - // If we are not autoselected, we can just unfocus (which will require another ESC press to close). + // If we are not autoselected, we can just lose focus (which will require another ESC press to close). return !canLoseFocus; } return false; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/package-info.java new file mode 100644 index 000000000..3f4db803b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.support.widget; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/FortuneUpgradeItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/FortuneUpgradeItem.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/FortuneUpgradeItem.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/FortuneUpgradeItem.java index f7a98270f..d90e709c6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/FortuneUpgradeItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/FortuneUpgradeItem.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; +package com.refinedmods.refinedstorage.common.upgrade; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.upgrade.AbstractUpgradeItem; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; -import com.refinedmods.refinedstorage.platform.common.Platform; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.upgrade.AbstractUpgradeItem; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeRegistry; import java.util.Optional; @@ -12,7 +12,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class FortuneUpgradeItem extends AbstractUpgradeItem { private static final Component HELP = createTranslation("item", "fortune_upgrade.help"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RangeUpgradeItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RangeUpgradeItem.java new file mode 100644 index 000000000..f58a0e5a7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RangeUpgradeItem.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage.common.upgrade; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.upgrade.AbstractUpgradeItem; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeRegistry; + +import java.util.Optional; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class RangeUpgradeItem extends AbstractUpgradeItem { + private static final Component HELP = createTranslation("item", "range_upgrade.help"); + private static final Component CREATIVE_HELP = createTranslation("item", "creative_range_upgrade.help"); + + private final boolean creative; + + public RangeUpgradeItem(final UpgradeRegistry registry, final boolean creative) { + super(new Item.Properties(), registry); + this.creative = creative; + } + + @Override + public long getEnergyUsage() { + if (creative) { + return Platform.INSTANCE.getConfig().getUpgrade().getCreativeRangeUpgradeEnergyUsage(); + } + return Platform.INSTANCE.getConfig().getUpgrade().getRangeUpgradeEnergyUsage(); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(creative ? CREATIVE_HELP : HELP)); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeContainerMenu.java new file mode 100644 index 000000000..046018399 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeContainerMenu.java @@ -0,0 +1,53 @@ +package com.refinedmods.refinedstorage.common.upgrade; + +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.containermenu.AbstractSingleAmountContainerMenu; +import com.refinedmods.refinedstorage.common.support.containermenu.SingleAmountData; + +import java.util.function.Consumer; +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class RegulatorUpgradeContainerMenu extends AbstractSingleAmountContainerMenu { + private static final Component FILTER_HELP = createTranslation("gui", "regulator_upgrade.filter_help"); + + @Nullable + private Consumer amountAcceptor; + + public RegulatorUpgradeContainerMenu(final int syncId, + final Inventory playerInventory, + final SingleAmountData singleAmountData) { + super(Menus.INSTANCE.getRegulatorUpgrade(), syncId, playerInventory, singleAmountData, FILTER_HELP); + } + + RegulatorUpgradeContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final Consumer amountAcceptor, + final SlotReference slotReference) { + super( + Menus.INSTANCE.getRegulatorUpgrade(), + syncId, + player, + resourceContainer, + FILTER_HELP, + slotReference + ); + this.amountAcceptor = amountAcceptor; + } + + @Override + public void changeAmountOnServer(final double newAmount) { + if (amountAcceptor == null) { + return; + } + amountAcceptor.accept(newAmount); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeItem.java new file mode 100644 index 000000000..8f93f191f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeItem.java @@ -0,0 +1,168 @@ +package com.refinedmods.refinedstorage.common.upgrade; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.common.api.upgrade.AbstractUpgradeItem; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.content.DataComponents; +import com.refinedmods.refinedstorage.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.containermenu.SingleAmountData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; +import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; + +import java.util.Optional; +import java.util.OptionalLong; +import java.util.function.Consumer; +import javax.annotation.Nullable; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.network.codec.StreamEncoder; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class RegulatorUpgradeItem extends AbstractUpgradeItem { + private static final Component HELP = createTranslation("item", "regulator_upgrade.help"); + + public RegulatorUpgradeItem(final UpgradeRegistry registry) { + super(new Item.Properties(), registry); + } + + @Override + public InteractionResultHolder use(final Level level, final Player player, final InteractionHand hand) { + final ItemStack stack = player.getItemInHand(hand); + if (player instanceof ServerPlayer serverPlayer) { + final RegulatorUpgradeState initialState = stack.getOrDefault( + DataComponents.INSTANCE.getRegulatorUpgradeState(), + RegulatorUpgradeState.EMPTY + ); + Platform.INSTANCE.getMenuOpener().openMenu(serverPlayer, new ExtendedMenuProviderImpl( + createResourceFilterContainer(stack, initialState), + initialState.amount(), + newAmount -> setAmount(stack, newAmount), + RefinedStorageApi.INSTANCE.createInventorySlotReference(player, hand) + )); + } + return InteractionResultHolder.success(stack); + } + + private ResourceContainer createResourceFilterContainer(final ItemStack stack, + final RegulatorUpgradeState initialState) { + final ResourceContainer container = ResourceContainerImpl.createForFilter(1); + container.setListener(() -> { + final RegulatorUpgradeState state = stack.getOrDefault( + DataComponents.INSTANCE.getRegulatorUpgradeState(), + RegulatorUpgradeState.EMPTY + ); + final PlatformResourceKey resource = container.getResource(0); + stack.set(DataComponents.INSTANCE.getRegulatorUpgradeState(), state.withResource(resource)); + }); + initialState.resource().ifPresent(initialResource -> container.set(0, new ResourceAmount(initialResource, 1))); + return container; + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new RegulatorTooltipComponent(HELP, getConfiguredResource(stack))); + } + + private void setAmount(final ItemStack stack, final double amount) { + final RegulatorUpgradeState state = stack.getOrDefault( + DataComponents.INSTANCE.getRegulatorUpgradeState(), + RegulatorUpgradeState.EMPTY + ); + stack.set(DataComponents.INSTANCE.getRegulatorUpgradeState(), state.withAmount(amount)); + } + + @Override + public long getEnergyUsage() { + return Platform.INSTANCE.getConfig().getUpgrade().getRegulatorUpgradeEnergyUsage(); + } + + @Nullable + private ResourceAmount getConfiguredResource(final ItemStack stack) { + final RegulatorUpgradeState state = stack.get(DataComponents.INSTANCE.getRegulatorUpgradeState()); + if (state == null) { + return null; + } + return state.resource().map(resource -> { + final double amount = state.amount(); + final long normalizedAmount = resource.getResourceType().normalizeAmount(amount); + return new ResourceAmount(resource, normalizedAmount); + }).orElse(null); + } + + public OptionalLong getDesiredAmount(final ItemStack stack, final ResourceKey resource) { + final RegulatorUpgradeState state = stack.getOrDefault( + DataComponents.INSTANCE.getRegulatorUpgradeState(), + RegulatorUpgradeState.EMPTY + ); + return state.resource().flatMap(configuredResource -> { + final boolean same = configuredResource.equals(resource); + if (!same) { + return Optional.empty(); + } + return Optional.of(configuredResource.getResourceType()); + }).map(type -> { + final double amount = state.amount(); + final long normalizedAmount = type.normalizeAmount(amount); + return OptionalLong.of(normalizedAmount); + }).orElse(OptionalLong.empty()); + } + + public record RegulatorTooltipComponent(Component helpText, @Nullable ResourceAmount configuredResource) + implements TooltipComponent { + } + + private record ExtendedMenuProviderImpl(ResourceContainer resourceContainer, + double amount, + Consumer amountAcceptor, + SlotReference slotReference) + implements ExtendedMenuProvider { + @Override + public SingleAmountData getMenuData() { + return new SingleAmountData( + Optional.of(slotReference), + amount, + ResourceContainerData.of(resourceContainer) + ); + } + + @Override + public StreamEncoder getMenuCodec() { + return SingleAmountData.STREAM_CODEC; + } + + @Override + public Component getDisplayName() { + return ContentNames.REGULATOR_UPGRADE; + } + + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new RegulatorUpgradeContainerMenu( + syncId, + player, + resourceContainer, + amountAcceptor, + slotReference + ); + } + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeScreen.java new file mode 100644 index 000000000..0a5af7083 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeScreen.java @@ -0,0 +1,14 @@ +package com.refinedmods.refinedstorage.common.upgrade; + +import com.refinedmods.refinedstorage.common.support.amount.AbstractSingleAmountScreen; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Inventory; + +public class RegulatorUpgradeScreen extends AbstractSingleAmountScreen { + public RegulatorUpgradeScreen(final RegulatorUpgradeContainerMenu menu, + final Inventory playerInventory, + final Component text) { + super(menu, playerInventory, text, menu.getAmount(), 1); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeState.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeState.java similarity index 86% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeState.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeState.java index 634877135..5e407fde2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeState.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeState.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; +package com.refinedmods.refinedstorage.common.upgrade; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; import java.util.Optional; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/SimpleUpgradeItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/SimpleUpgradeItem.java new file mode 100644 index 000000000..69c47d873 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/SimpleUpgradeItem.java @@ -0,0 +1,75 @@ +package com.refinedmods.refinedstorage.common.upgrade; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.upgrade.AbstractUpgradeItem; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeRegistry; + +import java.util.Optional; +import java.util.function.LongSupplier; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public final class SimpleUpgradeItem extends AbstractUpgradeItem { + private final LongSupplier energyUsageResolver; + private final boolean foil; + private final Component helpText; + + private SimpleUpgradeItem(final UpgradeRegistry registry, + final LongSupplier energyUsageResolver, + final boolean foil, + final Component helpText) { + super(new Item.Properties(), registry); + this.energyUsageResolver = energyUsageResolver; + this.foil = foil; + this.helpText = helpText; + } + + @Override + public long getEnergyUsage() { + return energyUsageResolver.getAsLong(); + } + + @Override + public boolean isFoil(final ItemStack stack) { + return foil; + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(helpText)); + } + + public static SimpleUpgradeItem speedUpgrade() { + return new SimpleUpgradeItem( + RefinedStorageApi.INSTANCE.getUpgradeRegistry(), + Platform.INSTANCE.getConfig().getUpgrade()::getSpeedUpgradeEnergyUsage, + false, + createTranslation("item", "speed_upgrade.help") + ); + } + + public static SimpleUpgradeItem stackUpgrade() { + return new SimpleUpgradeItem( + RefinedStorageApi.INSTANCE.getUpgradeRegistry(), + Platform.INSTANCE.getConfig().getUpgrade()::getStackUpgradeEnergyUsage, + false, + createTranslation("item", "stack_upgrade.help") + ); + } + + public static SimpleUpgradeItem silkTouchUpgrade() { + return new SimpleUpgradeItem( + RefinedStorageApi.INSTANCE.getUpgradeRegistry(), + Platform.INSTANCE.getConfig().getUpgrade()::getSilkTouchUpgradeEnergyUsage, + true, + createTranslation("item", "silk_touch_upgrade.help") + ); + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeContainer.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeContainer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeContainer.java index 9d805c137..9b1965096 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeContainer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeContainer.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; +package com.refinedmods.refinedstorage.common.upgrade; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeDestination; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeItem; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeMapping; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeDestination; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeItem; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeMapping; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; import java.util.ArrayList; import java.util.List; @@ -96,11 +96,6 @@ private void updateIndex(final int slotIndex) { index.put(upgradeItem, index.getInt(upgradeItem) + 1); } - @Override - public boolean has(final UpgradeItem upgradeItem) { - return index.containsKey(upgradeItem); - } - @Override public int getAmount(final UpgradeItem upgradeItem) { return index.getInt(upgradeItem); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinationClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeDestinationClientTooltipComponent.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinationClientTooltipComponent.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeDestinationClientTooltipComponent.java index 9e80c74d3..1895b2dac 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinationClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeDestinationClientTooltipComponent.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; +package com.refinedmods.refinedstorage.common.upgrade; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeMapping; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeMapping; import java.util.Objects; import java.util.Set; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeDestinations.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeDestinations.java new file mode 100644 index 000000000..8f8893a31 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeDestinations.java @@ -0,0 +1,47 @@ +package com.refinedmods.refinedstorage.common.upgrade; + +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeDestination; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.content.Items; + +import java.util.function.Supplier; +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.ItemStack; + +public enum UpgradeDestinations implements UpgradeDestination { + IMPORTER(ContentNames.IMPORTER, () -> new ItemStack(Items.INSTANCE.getImporters().getFirst().get())), + EXPORTER(ContentNames.EXPORTER, () -> new ItemStack(Items.INSTANCE.getExporters().getFirst().get())), + DESTRUCTOR(ContentNames.DESTRUCTOR, () -> new ItemStack(Items.INSTANCE.getDestructors().getFirst().get())), + CONSTRUCTOR(ContentNames.CONSTRUCTOR, () -> new ItemStack(Items.INSTANCE.getConstructors().getFirst().get())), + WIRELESS_TRANSMITTER(ContentNames.WIRELESS_TRANSMITTER, () -> new ItemStack( + Items.INSTANCE.getWirelessTransmitters().getFirst().get() + )), + DISK_INTERFACE(ContentNames.DISK_INTERFACE, () -> new ItemStack( + Items.INSTANCE.getDiskInterfaces().getFirst().get() + )); + + private final Component name; + private final Supplier stackFactory; + @Nullable + private ItemStack cachedStack; + + UpgradeDestinations(final Component name, final Supplier stackFactory) { + this.name = name; + this.stackFactory = stackFactory; + } + + @Override + public Component getName() { + return name; + } + + @Override + public ItemStack getStackRepresentation() { + if (cachedStack == null) { + cachedStack = stackFactory.get(); + } + return cachedStack; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeItemClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeItemClientTooltipComponent.java similarity index 89% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeItemClientTooltipComponent.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeItemClientTooltipComponent.java index 20d1cfeac..737db9d77 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeItemClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeItemClientTooltipComponent.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; +package com.refinedmods.refinedstorage.common.upgrade; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeMapping; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeMapping; import java.util.Objects; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeRegistryImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeRegistryImpl.java similarity index 88% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeRegistryImpl.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeRegistryImpl.java index 70c36641f..8ca809285 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeRegistryImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeRegistryImpl.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; +package com.refinedmods.refinedstorage.common.upgrade; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeDestination; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeMapping; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeDestination; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeMapping; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeRegistry; import java.util.Collections; import java.util.HashMap; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeSlot.java similarity index 83% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeSlot.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeSlot.java index 173aea0bb..35cb2a5c2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeSlot.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeSlot.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; +package com.refinedmods.refinedstorage.common.upgrade; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeMapping; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeMapping; import java.util.Set; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeWithEnchantedBookRecipe.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeWithEnchantedBookRecipe.java index c20e64926..5a3fb4752 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeWithEnchantedBookRecipe.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; +package com.refinedmods.refinedstorage.common.upgrade; -import com.refinedmods.refinedstorage.platform.common.content.Items; +import com.refinedmods.refinedstorage.common.content.Items; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeWithEnchantedBookRecipeSerializer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeWithEnchantedBookRecipeSerializer.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeWithEnchantedBookRecipeSerializer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeWithEnchantedBookRecipeSerializer.java index 8c77f7986..edf5ccb1b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeWithEnchantedBookRecipeSerializer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeWithEnchantedBookRecipeSerializer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; +package com.refinedmods.refinedstorage.common.upgrade; import com.mojang.serialization.MapCodec; import net.minecraft.network.RegistryFriendlyByteBuf; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/package-info.java new file mode 100644 index 000000000..06007a034 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.upgrade; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/ContainerUtil.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/ContainerUtil.java similarity index 96% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/ContainerUtil.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/ContainerUtil.java index 822d91892..6b57351d0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/ContainerUtil.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/ContainerUtil.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.util; +package com.refinedmods.refinedstorage.common.util; import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/CustomBlockPlaceContext.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/CustomBlockPlaceContext.java similarity index 92% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/CustomBlockPlaceContext.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/CustomBlockPlaceContext.java index c6181be73..90ca08ce4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/CustomBlockPlaceContext.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/CustomBlockPlaceContext.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.util; +package com.refinedmods.refinedstorage.common.util; import javax.annotation.Nullable; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/IdentifierUtil.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/IdentifierUtil.java similarity index 93% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/IdentifierUtil.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/IdentifierUtil.java index 16c23aff7..795d8e138 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/IdentifierUtil.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/IdentifierUtil.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.util; +package com.refinedmods.refinedstorage.common.util; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; +import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/MathUtil.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/MathUtil.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/MathUtil.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/MathUtil.java index 6f1a8bceb..200af85b8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/MathUtil.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/MathUtil.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.util; +package com.refinedmods.refinedstorage.common.util; public final class MathUtil { private MathUtil() { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/PacketUtil.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/PacketUtil.java similarity index 87% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/PacketUtil.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/PacketUtil.java index 3f053ec5e..286e4d22d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/PacketUtil.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/PacketUtil.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.util; +package com.refinedmods.refinedstorage.common.util; import io.netty.buffer.ByteBuf; import net.minecraft.network.codec.ByteBufCodecs; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/SecurityToastUtil.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/SecurityToastUtil.java similarity index 79% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/SecurityToastUtil.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/SecurityToastUtil.java index 68d4f833c..a92ef1557 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/SecurityToastUtil.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/SecurityToastUtil.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.util; +package com.refinedmods.refinedstorage.common.util; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.toasts.SystemToast; import net.minecraft.network.chat.Component; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public final class SecurityToastUtil { private static final SystemToast.SystemToastId NO_PERMISSION_TOAST_ID = new SystemToast.SystemToastId(); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/ServerEventQueue.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/ServerEventQueue.java similarity index 90% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/ServerEventQueue.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/ServerEventQueue.java index 7f4cb03cf..10d8f625f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/ServerEventQueue.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/ServerEventQueue.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.util; +package com.refinedmods.refinedstorage.common.util; import java.util.ArrayDeque; import java.util.Deque; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/package-info.java new file mode 100644 index 000000000..e27916796 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.util; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..76b6cc3a4 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.api.wirelesstransmitter.WirelessTransmitterRangeModifier; + +public class BaseWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + return Platform.INSTANCE.getConfig().getWirelessTransmitter().getBaseRange() + range; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java similarity index 76% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java index ec97eb5fa..1ac68976c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.wirelesstransmitter; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.api.wirelesstransmitter.WirelessTransmitterRangeModifier; import java.util.Comparator; import java.util.PriorityQueue; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..5c1e8e8b7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.api.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage.common.content.Items; + +public class CreativeRangeUpgradeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + if (upgradeState.has(Items.INSTANCE.getCreativeRangeUpgrade())) { + return Integer.MAX_VALUE; + } + return range; + } + + @Override + public int getPriority() { + return Integer.MAX_VALUE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..cf18efaaa --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.api.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage.common.content.Items; + +public class RangeUpgradeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + final int amountOfRangeUpgrades = upgradeState.getAmount(Items.INSTANCE.getRangeUpgrade()); + final int rangePerUpgrade = Platform.INSTANCE.getConfig().getUpgrade().getRangeUpgradeRange(); + return range + (amountOfRangeUpgrades * rangePerUpgrade); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlock.java new file mode 100644 index 000000000..30603c483 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlock.java @@ -0,0 +1,101 @@ +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockConstants; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.AbstractActiveColoredDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; +import com.refinedmods.refinedstorage.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage.common.support.NetworkNodeBlockItem; +import com.refinedmods.refinedstorage.common.support.direction.DefaultDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class WirelessTransmitterBlock + extends AbstractActiveColoredDirectionalBlock + implements BlockItemProvider, EntityBlock { + private static final AbstractBlockEntityTicker TICKER = + new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getWirelessTransmitter, ACTIVE); + private static final Component HELP = createTranslation("item", "wireless_transmitter.help"); + + private static final VoxelShape SHAPE_DOWN = box(6.0D, 0.0D, 6.0D, 10.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_UP = box(6.0D, 6.0D, 6.0D, 10.0D, 16.0D, 10.0D); + private static final VoxelShape SHAPE_EAST = box(6.0D, 6.0D, 6.0D, 16.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_WEST = box(0.0D, 6.0D, 6.0D, 10.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_NORTH = box(6.0D, 6.0D, 0.0D, 10.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_SOUTH = box(6.0D, 6.0D, 6.0D, 10.0D, 10.0D, 16.0D); + + public WirelessTransmitterBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES, color, name); + } + + @Override + protected DirectionType getDirectionType() { + return DefaultDirectionType.FACE_CLICKED; + } + + @Override + public VoxelShape getShape(final BlockState state, + final BlockGetter world, + final BlockPos pos, + final CollisionContext context) { + final Direction direction = getDirection(state); + if (direction == null) { + return Shapes.empty(); + } + return switch (direction) { + case DOWN -> SHAPE_DOWN; + case UP -> SHAPE_UP; + case NORTH -> SHAPE_NORTH; + case SOUTH -> SHAPE_SOUTH; + case WEST -> SHAPE_WEST; + case EAST -> SHAPE_EAST; + }; + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getWirelessTransmitter(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new WirelessTransmitterBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java new file mode 100644 index 000000000..bdd78012a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java @@ -0,0 +1,130 @@ +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage.common.support.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.util.ContainerUtil; + +import java.util.List; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.NonNullList; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.network.codec.StreamEncoder; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.BlockState; + +public class WirelessTransmitterBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity + implements NetworkNodeExtendedMenuProvider, BlockEntityWithDrops { + private static final String TAG_UPGRADES = "upgr"; + + private final UpgradeContainer upgradeContainer = new UpgradeContainer( + UpgradeDestinations.WIRELESS_TRANSMITTER, + RefinedStorageApi.INSTANCE.getUpgradeRegistry(), + this::upgradeContainerChanged + ); + + public WirelessTransmitterBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getWirelessTransmitter(), pos, state, new SimpleNetworkNode( + Platform.INSTANCE.getConfig().getWirelessTransmitter().getEnergyUsage() + )); + } + + @Override + protected InWorldNetworkNodeContainer createMainContainer(final SimpleNetworkNode networkNode) { + return new WirelessTransmitterNetworkNodeContainer( + this, + networkNode, + "main", + new WirelessTransmitterConnectionStrategy(this::getBlockState, getBlockPos()) + ); + } + + @Override + public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { + super.saveAdditional(tag, provider); + tag.put(TAG_UPGRADES, ContainerUtil.write(upgradeContainer, provider)); + } + + @Override + public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { + if (tag.contains(TAG_UPGRADES)) { + ContainerUtil.read(tag.getCompound(TAG_UPGRADES), upgradeContainer, provider); + } + super.loadAdditional(tag, provider); + } + + @Override + public List getUpgradeItems() { + return upgradeContainer.getUpgradeItems(); + } + + @Override + public boolean addUpgradeItem(final Item upgradeItem) { + return upgradeContainer.addUpgradeItem(upgradeItem); + } + + @Override + public Component getDisplayName() { + return ContentNames.WIRELESS_TRANSMITTER; + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new WirelessTransmitterContainerMenu(syncId, inventory, this, upgradeContainer); + } + + @Override + public WirelessTransmitterData getMenuData() { + return new WirelessTransmitterData(getRange()); + } + + @Override + public StreamEncoder getMenuCodec() { + return WirelessTransmitterData.STREAM_CODEC; + } + + int getRange() { + return RefinedStorageApi.INSTANCE.getWirelessTransmitterRangeModifier().modifyRange(upgradeContainer, 0); + } + + private void upgradeContainerChanged() { + final long baseUsage = Platform.INSTANCE.getConfig().getWirelessTransmitter().getEnergyUsage(); + mainNetworkNode.setEnergyUsage(baseUsage + upgradeContainer.getEnergyUsage()); + setChanged(); + } + + @Override + public NonNullList getDrops() { + final NonNullList drops = NonNullList.create(); + for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { + drops.add(upgradeContainer.getItem(i)); + } + return drops; + } + + @Override + protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, + final BlockState newBlockState) { + return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterConnectionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterConnectionStrategy.java new file mode 100644 index 000000000..fbdc388d8 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterConnectionStrategy.java @@ -0,0 +1,36 @@ +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage.common.support.network.ColoredConnectionStrategy; + +import java.util.function.Supplier; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock.tryExtractDirection; + +class WirelessTransmitterConnectionStrategy extends ColoredConnectionStrategy { + WirelessTransmitterConnectionStrategy(final Supplier blockStateProvider, final BlockPos origin) { + super(blockStateProvider, origin); + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + final Direction myDirection = tryExtractDirection(blockStateProvider.get()); + if (myDirection == null) { + return; + } + sink.tryConnectInSameDimension(origin.relative(myDirection), myDirection.getOpposite()); + } + + @Override + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + if (!colorsAllowConnecting(connectingState)) { + return false; + } + final Direction myDirection = tryExtractDirection(blockStateProvider.get()); + return incomingDirection == myDirection; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java new file mode 100644 index 000000000..5bf934a6f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java @@ -0,0 +1,89 @@ +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.content.Menus; +import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage.common.support.RedstoneMode; +import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage.common.support.packet.s2c.S2CPackets; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeSlot; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +public class WirelessTransmitterContainerMenu extends AbstractBaseContainerMenu { + private final RateLimiter rangeRateLimiter = RateLimiter.create(4); + + private int range; + @Nullable + private final WirelessTransmitterBlockEntity wirelessTransmitter; + private final Player player; + + public WirelessTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final WirelessTransmitterData data) { + super(Menus.INSTANCE.getWirelessTransmitter(), syncId); + addSlots(playerInventory, new UpgradeContainer( + UpgradeDestinations.WIRELESS_TRANSMITTER, + RefinedStorageApi.INSTANCE.getUpgradeRegistry() + )); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + this.range = data.range(); + this.wirelessTransmitter = null; + this.player = playerInventory.player; + } + + WirelessTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final WirelessTransmitterBlockEntity wirelessTransmitter, + final UpgradeContainer upgradeContainer) { + super(Menus.INSTANCE.getWirelessTransmitter(), syncId); + addSlots(playerInventory, upgradeContainer); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + wirelessTransmitter::getRedstoneMode, + wirelessTransmitter::setRedstoneMode + )); + this.range = wirelessTransmitter.getRange(); + this.wirelessTransmitter = wirelessTransmitter; + this.player = playerInventory.player; + } + + private void addSlots(final Inventory playerInventory, final UpgradeContainer upgradeContainer) { + addPlayerInventory(playerInventory, 8, 55); + for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { + addSlot(new UpgradeSlot(upgradeContainer, i, 187, 6 + (i * 18))); + } + transferManager.addBiTransfer(playerInventory, upgradeContainer); + } + + @Override + public void broadcastChanges() { + super.broadcastChanges(); + if (wirelessTransmitter == null) { + return; + } + final int newRange = wirelessTransmitter.getRange(); + final boolean changed = range != newRange; + if (changed && rangeRateLimiter.tryAcquire()) { + this.range = newRange; + S2CPackets.sendWirelessTransmitterRange((ServerPlayer) player, range); + } + } + + int getRange() { + return range; + } + + public void setRange(final int range) { + this.range = range; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterData.java similarity index 85% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterData.java index 8fc7e5aad..a0e60942b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterData.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.wirelesstransmitter; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterNetworkNodeContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterNetworkNodeContainer.java new file mode 100644 index 000000000..4e211ab69 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterNetworkNodeContainer.java @@ -0,0 +1,43 @@ +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; +import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemPlayerValidator; +import com.refinedmods.refinedstorage.common.support.network.InWorldNetworkNodeContainerImpl; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; + +class WirelessTransmitterNetworkNodeContainer extends InWorldNetworkNodeContainerImpl + implements NetworkItemPlayerValidator { + private final WirelessTransmitterBlockEntity blockEntity; + private final AbstractNetworkNode node; + + WirelessTransmitterNetworkNodeContainer(final WirelessTransmitterBlockEntity blockEntity, + final AbstractNetworkNode node, + final String name, + final WirelessTransmitterConnectionStrategy connectionStrategy) { + super(blockEntity, node, name, 0, connectionStrategy, null); + this.blockEntity = blockEntity; + this.node = node; + } + + @Override + public boolean isValid(final PlayerCoordinates coordinates) { + final Level level = blockEntity.getLevel(); + if (level == null || level.dimension() != coordinates.dimension()) { + return false; + } + if (!node.isActive()) { + return false; + } + final BlockPos pos = blockEntity.getBlockPos(); + final Vec3 playerPos = coordinates.position(); + final double distance = Math.sqrt( + Math.pow(pos.getX() - playerPos.x(), 2) + + Math.pow(pos.getY() - playerPos.y(), 2) + + Math.pow(pos.getZ() - playerPos.z(), 2) + ); + return distance <= blockEntity.getRange(); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterScreen.java new file mode 100644 index 000000000..85ba735f4 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterScreen.java @@ -0,0 +1,50 @@ +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class WirelessTransmitterScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/wireless_transmitter.png"); + + public WirelessTransmitterScreen(final WirelessTransmitterContainerMenu containerMenu, + final Inventory inventory, + final Component title) { + super(containerMenu, inventory, title); + this.inventoryLabelY = 43; + this.imageWidth = 211; + this.imageHeight = 137; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } + + @Override + protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { + super.renderLabels(graphics, mouseX, mouseY); + graphics.drawString( + font, + createTranslation("gui", "wireless_transmitter.distance", getMenu().getRange()), + 28, + 25, + 4210752, + false + ); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/package-info.java new file mode 100644 index 000000000..dff267fde --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/1024b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/1024b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/1024b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/1024b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/16k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/16k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/16k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/16k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/1k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/1k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/1k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/1k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/256b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/256b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/256b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/256b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/4096b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/4096b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/4096b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/4096b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/4k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/4k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/4k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/4k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/64b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/64b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/64b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/64b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/64k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/64k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/64k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/64k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/creative_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/creative_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/creative_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/creative_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/creative_portable_grid.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/creative_portable_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/creative_portable_grid.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/creative_portable_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/creative_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/creative_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/creative_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/creative_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/disk_drive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/disk_drive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/disk_drive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/disk_drive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/interface.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/interface.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/interface.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/interface.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/machine_casing.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/machine_casing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/machine_casing.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/machine_casing.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/portable_grid.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/portable_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/portable_grid.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/portable_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/quartz_enriched_copper_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/quartz_enriched_copper_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/quartz_enriched_copper_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/quartz_enriched_copper_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/quartz_enriched_iron_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/quartz_enriched_iron_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/quartz_enriched_iron_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/quartz_enriched_iron_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/storage_monitor.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/storage_monitor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/blockstates/storage_monitor.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/blockstates/storage_monitor.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/icon.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/icon.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/icon.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/icon.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/de_de.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/de_de.json similarity index 79% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/de_de.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/de_de.json index 19fc66425..b86cf97e8 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/de_de.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/de_de.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Werkbank in der Konsole zum Netzwerk leeren", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Werkbank in der Konsole zum Inventar leeren", "key.refinedstorage.open_wireless_grid": "Drahtlose Konsole öffnen", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Schraubenschlüssel benutzt", "permission.refinedstorage.insert": "Einfügen", "permission.refinedstorage.insert.description": "Gibt an, ob der Spieler Ressourcen in ein Netzwerk einfügen kann.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Flüssiges Scrollen", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Bildschirmgröße", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximale Anzahl von Zeilen, wenn Bildschirmgröße gestreckt ist", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Konsole", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Große Schriftart", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Sortierung verhindern während SHIFT gedrückt ist", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detaillierte Kurzinfo", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Suchabfrage merken", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Autoselektieres Suchfeld", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronisator", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Ressourcentyp", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sortierrichtung", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sortierart", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Herstellungskonsole", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Werkbank Schließverhalten", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Kontrollblock", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energiekapazität", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Kabel", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Laufwerk", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energieverbrauch pro Festplatte", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Speicherblock", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1k Energieverbrauch", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4k Energieverbrauch", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16k Energieverbrauch", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64k Energieverbrauch", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Kreativer Energieverbrauch", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Flüssigspeicherblock", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B Energieverbrauch", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B Energieverbrauch", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B Energieverbrauch", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B Energieverbrauch", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Kreativer Energieverbrauch", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importierer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exportierer", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detektor", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Konstruktor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destruktor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Energieverbrauch von Geschwindigkeitsupgrade", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Energieverbrauch vom Stapelupgrade", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Energieverbrauch vom Glück 1 Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Energieverbrauch vom Glück 2 Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Energieverbrauch vom Glück 3 Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Energieverbrauch vom Behutsamkeitsupgrade", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Energieverbrauch vom Regulator Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Energieverbrauch vom Reichweitenupgrade", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Energieverbrauch vom Kreativen Reichweitenupgrade", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Reichweite vom Reichweitenupgrade", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Schnittstelle", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "Externer Speicher", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Drahtlose Konsole", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energiekapazität", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Energieverbrauch beim Öffnen", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Energieverbrauch beim Importieren", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Energieverbrauch beim Exportieren", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Funksender", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Basisreichweite", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Speichermonitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Netzwerkempfänger", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Netzwerksender", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Mobile Konsole", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energiekapazität", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Energieverbrauch beim Öffnen", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Energieverbrauch beim Importieren", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Energieverbrauch beim Exportieren", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Sicherheitskarte", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Standard-Sicherheitskarte", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Sicherheits-Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relais", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Eingabenetzwerk Energienutzung", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Ausgangsnetzwerk Energieverbrauch (wenn nicht im Durchlauf-Modus)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Nutzen Sie einen oder mehrere Kontrollblöcke in einem Speichernetzwerk, um das Netzwerk mit Energie zu versorgen", "advancements.refinedstorage.connecting": "Verbinden", "advancements.refinedstorage.connecting.description": "Benutze Kabel um Geräte miteinander zu verbinden, oder platziere Geräte nebeneinander", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/en_us.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/en_us.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json index 828ac42e9..adf9fc563 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/en_us.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json @@ -335,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exporter", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/es_es.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/es_es.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/es_es.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/es_es.json index ec4bbf34f..7b07c2b4f 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/es_es.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/es_es.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Llave Inglesa usada", "permission.refinedstorage.insert": "Insertar", "permission.refinedstorage.insert.description": "Si el jugador puede insertar recursos en una red.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Desplazamiento suave", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Tamaño de pantalla", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Fuente grande", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Evitar ordenar mientras SHIFT está presionado", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Descripción detallada", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Recordar búsqueda", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Tipo de Recurso", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Dirección de ordenación", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Tipo de ordenación", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disco Duro", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Uso de energía por disco", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Bloque de almacenamiento", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K de consumo de energía", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K de consumo de energía", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K de consumo de energía", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K de consumo de energía", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Consumo de energía creativo", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importador", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exportador", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Mejora", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Rango de mejora de rango", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interfaz", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "Almacenamiento Externo", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Consumo de energía al extraer", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Tarjeta de Seguridad", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Gestor de seguridad", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Utilice uno o varios controladores en una red de almacenamiento para proporcionar energía a su red", "advancements.refinedstorage.connecting": "Conectando", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/fr_fr.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/fr_fr.json new file mode 100644 index 000000000..7f499f6a0 --- /dev/null +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/fr_fr.json @@ -0,0 +1,569 @@ +{ + "mod.refinedstorage": "Refined Storage", + "block.refinedstorage.cable": "Câble", + "block.refinedstorage.quartz_enriched_iron_block": "Bloc de Fer Enrichi en Quartz", + "block.refinedstorage.quartz_enriched_copper_block": "Bloc de Cuivre enrichi en Quartz", + "block.refinedstorage.disk_drive": "Lecteur de Disque", + "block.refinedstorage.machine_casing": "Boitier de Machine", + "block.refinedstorage.grid": "Grille", + "block.refinedstorage.crafting_grid": "Grille d’Artisanat", + "block.refinedstorage.controller": "Contrôleur", + "block.refinedstorage.creative_controller": "Contrôleur créatif", + "block.refinedstorage.1k_storage_block": "Bloc de Stockage 1K", + "block.refinedstorage.4k_storage_block": "Bloc de Stockage 4k", + "block.refinedstorage.16k_storage_block": "Bloc de Stockage 16k", + "block.refinedstorage.64k_storage_block": "Bloc de Stockage 64k", + "block.refinedstorage.creative_storage_block": "Bloc de Stockage Créatif", + "block.refinedstorage.64b_fluid_storage_block": "Bloc de Stockage de Fluides 64B", + "block.refinedstorage.256b_fluid_storage_block": "Bloc de Stockage de Fluides 256B", + "block.refinedstorage.1024b_fluid_storage_block": "Bloc de Stockage de Fluides 1024B", + "block.refinedstorage.4096b_fluid_storage_block": "Bloc de Stockage de Fluides 4096B", + "block.refinedstorage.creative_fluid_storage_block": "Bloc de Stockage de Fluides Créatif", + "block.refinedstorage.importer": "Importateur", + "block.refinedstorage.exporter": "Exportateur", + "block.refinedstorage.interface": "Interface", + "block.refinedstorage.external_storage": "Stockage Externe", + "block.refinedstorage.detector": "Détecteur", + "block.refinedstorage.constructor": "Constructeur", + "block.refinedstorage.destructor": "Destructeur", + "block.refinedstorage.wireless_transmitter": "Transmetteur sans fil", + "block.refinedstorage.storage_monitor": "Moniteur de Stockage", + "block.refinedstorage.network_receiver": "Récepteur Réseau", + "block.refinedstorage.network_transmitter": "Transmetteur Réseau", + "block.refinedstorage.portable_grid": "Grille portable", + "block.refinedstorage.creative_portable_grid": "Grille portable créative", + "block.refinedstorage.security_manager": "Poste de sécurité", + "block.refinedstorage.security_manager.help": "Lorsque ce périphérique est actif, il protège le réseau par défaut et bloque toutes les opérations. Commencez à ajouter des Cartes de Sécurité pour permettre ou refuser des opérations spécifiques pour un joueur.", + "block.refinedstorage.relay": "Relais", + "block.refinedstorage.disk_interface": "Interface Disque", + "gui.refinedstorage.controller.redstone_mode_help": "Lorsque ce périphérique est inactif, le réseau de stockage ne peut pas utiliser ce périphérique comme source d'énergie.", + "gui.refinedstorage.disk_drive.disks": "Disques", + "gui.refinedstorage.storage.redstone_mode_help": "Lorsque ce périphérique est inactif, le stockage contenu ne sera plus accessible depuis le réseau de stockage.", + "gui.refinedstorage.storage.filter_help": "Les ressources qui sont autorisées ou refusées dans ce stockage, en fonction du mode de filtrage du périphérique.", + "gui.refinedstorage.storage.filter_mode.empty_warning": "Sans filtre configuré, aucune ressource ne sera accepté dans ce stockage.", + "gui.refinedstorage.storage.filter_mode.allow.help": "Autorise dans ce stockage uniquement les ressources configurées dans les filtres.", + "gui.refinedstorage.storage.filter_mode.block.help": "Interdis dans ce stockage les ressources configurées dans les filtres.", + "gui.refinedstorage.grid.sorting.direction": "Direction du tri", + "gui.refinedstorage.grid.sorting.direction.ascending": "Ascendant", + "gui.refinedstorage.grid.sorting.direction.descending": "Descendant", + "gui.refinedstorage.grid.sorting.type": "Type de tri", + "gui.refinedstorage.grid.sorting.type.quantity": "Quantité", + "gui.refinedstorage.grid.sorting.type.name": "Nom", + "gui.refinedstorage.grid.sorting.type.id": "Identifiant", + "gui.refinedstorage.grid.sorting.type.last_modified": "Dernière modification", + "gui.refinedstorage.grid.auto_selected": "Sélection automatique", + "gui.refinedstorage.grid.auto_selected.help": "Si la barre de recherche doit être sélectionnée automatique à l'ouverture de la grille.", + "gui.refinedstorage.grid.synchronizer": "Mode de synchronisation", + "gui.refinedstorage.grid.synchronizer.off": "Éteint", + "gui.refinedstorage.grid.synchronizer.off.help": "Ne pas synchroniser la recherche.", + "gui.refinedstorage.grid.resource_type": "Type de ressource", + "gui.refinedstorage.grid.resource_type.all": "Toutes", + "gui.refinedstorage.grid.resource_type.help": "Filtrer un type de ressources spécifique.", + "gui.refinedstorage.crafting_grid.move.network": "Déplacer les objets dans le réseau", + "gui.refinedstorage.crafting_grid.move.inventory": "Déplacer les objets dans l'inventaire", + "gui.refinedstorage.screen_size": "Taille de l'écran", + "gui.refinedstorage.screen_size.stretch": "Etiré", + "gui.refinedstorage.screen_size.small": "Petit", + "gui.refinedstorage.screen_size.medium": "Moyen", + "gui.refinedstorage.screen_size.large": "Grand", + "gui.refinedstorage.screen_size.extra_large": "Très grand", + "gui.refinedstorage.detector.mode": "Mode", + "gui.refinedstorage.detector.mode.under": "Émet un signal de redstone si la valeur est inférieure au seuil.", + "gui.refinedstorage.detector.mode.equal": "Émet un signal de redstone si la valeur est égale au seuil.", + "gui.refinedstorage.detector.mode.above": "Émet un signal de redstone si la valeur est supérieure au seuil.", + "gui.refinedstorage.detector.filter_help": "La ressource qui doit être détectée dans le réseau de stockage.", + "gui.refinedstorage.destructor.pickup_items": "Ramasser des objets au lieu de casser des blocs.", + "gui.refinedstorage.destructor.filter_help": "Les blocs qui seront détruits ou ignorés en fonction du mode de filtrage du périphérique.", + "gui.refinedstorage.destructor.filter_mode.allow.help": "Autorise dans le réseau de stockage uniquement les blocs configurés dans les filtres.", + "gui.refinedstorage.destructor.filter_mode.block.help": "Interdit dans le réseau de stockage les blocs configurés dans les filtres.", + "gui.refinedstorage.constructor.drop_items": "Laisser tomber des objets au lieu de placer des blocs.", + "gui.refinedstorage.constructor.filter_help": "Les ressources qui doivent être placées depuis le réseau de stockage.", + "gui.refinedstorage.interface.filter_help": "Les ressources qui doivent être exportées depuis le réseau de stockage.", + "gui.refinedstorage.exporter.filter_help": "Les ressources qui doivent être exportées depuis le réseau de stockage.", + "gui.refinedstorage.importer.filter_help": "Les ressources qui doivent être importées depuis l'inventaire ciblé.", + "gui.refinedstorage.importer.filter_mode.allow.help": "Autorise dans le réseau de stockage uniquement les ressources configurées dans les filtres.", + "gui.refinedstorage.importer.filter_mode.block.help": "Interdit dans le réseau de stockage les ressources configurées dans les filtres.", + "gui.refinedstorage.wireless_transmitter.distance": "%d bloc(s)", + "gui.refinedstorage.storage_monitor.filter_help": "La ressource à afficher.", + "gui.refinedstorage.redstone_mode": "Mode redstone", + "gui.refinedstorage.redstone_mode.ignore": "Ignoré", + "gui.refinedstorage.redstone_mode.ignore.help": "Ce périphérique sera toujours actif quel que soit le signal de redstone.", + "gui.refinedstorage.redstone_mode.high": "Allumé", + "gui.refinedstorage.redstone_mode.high.help": "Ce périphérique sera actif seulement s'il reçoit un signal de redstone.", + "gui.refinedstorage.redstone_mode.low": "Éteint", + "gui.refinedstorage.redstone_mode.low.help": "Ce périphérique sera actif seulement s'il ne reçoit pas de signal de redstone.", + "gui.refinedstorage.scheduling_mode": "Mode de distribution", + "gui.refinedstorage.scheduling_mode.default": "Par défaut", + "gui.refinedstorage.scheduling_mode.default.help": "Utilise le premier filtre disponible.", + "gui.refinedstorage.scheduling_mode.round_robin": "À tour de rôle", + "gui.refinedstorage.scheduling_mode.round_robin.help": "Utiliser chaque filtre à tour de rôle.", + "gui.refinedstorage.scheduling_mode.random": "Aléatoire", + "gui.refinedstorage.scheduling_mode.random.help": "Utiliser un filtre aléatoire.", + "gui.refinedstorage.priority": "Priorité", + "gui.refinedstorage.priority.storage_help": "L'ordre dans lequel le réseau de stockage va insérer ou extraire les ressources, le plus élevé en premier.", + "gui.refinedstorage.amount": "Quantité", + "gui.refinedstorage.amount.reset": "Réinitialiser", + "gui.refinedstorage.amount.set": "Définir", + "gui.refinedstorage.filter_mode": "Mode de filtrage", + "gui.refinedstorage.filter_mode.allow": "Liste blanche", + "gui.refinedstorage.filter_mode.block": "Liste noire", + "gui.refinedstorage.fuzzy_mode": "Mode flou", + "gui.refinedstorage.fuzzy_mode.on": "Activé", + "gui.refinedstorage.fuzzy_mode.on.storage_help": "Faire correspondre exactement les filtres pour la liste d'autorisation ou de blocage.", + "gui.refinedstorage.fuzzy_mode.on.generic_help": "Faire correspondre exactement le filtre.", + "gui.refinedstorage.fuzzy_mode.on.extracting_storage_network_help": "Faire correspondre exactement les filtres du réseau de stockage.", + "gui.refinedstorage.fuzzy_mode.on.extracting_source_help": "Faire correspondre exactement les filtres lors de l'extraction depuis la source.", + "gui.refinedstorage.fuzzy_mode.off": "Désactivé", + "gui.refinedstorage.fuzzy_mode.off.storage_help": "Faire correspondre exactement les filtres pour la liste d'autorisation ou de blocage sans comparer les tags NBT.", + "gui.refinedstorage.fuzzy_mode.off.generic_help": "Faire correspondre le filtre sans comparer les tags NBT.", + "gui.refinedstorage.fuzzy_mode.off.extracting_storage_network_help": "Faire correspondre les filtres lors de l'extraction depuis le réseau de stockage sans comparer les tags NBT.", + "gui.refinedstorage.fuzzy_mode.off.extracting_source_help": "Match the filters when extracting from the source without comparing NBT tags.", + "gui.refinedstorage.access_mode": "Mode d'accès", + "gui.refinedstorage.access_mode.insert_extract": "Insertion et extraction", + "gui.refinedstorage.access_mode.insert_extract.help": "Le réseau de stockage pourra insérer et extraire depuis ce stockage.", + "gui.refinedstorage.access_mode.insert": "Insertion uniquement", + "gui.refinedstorage.access_mode.insert.help": "Le réseau de stockage ne pourra qu'insérer dans stockage. Les ressources seront tout de même visible dans une grille.", + "gui.refinedstorage.access_mode.extract": "Extraction uniquement", + "gui.refinedstorage.access_mode.extract.help": "Le réseau de stockage ne pourra qu'extraire depuis ce stockage.", + "gui.refinedstorage.void_excess": "Anéantir les ressources en excès", + "gui.refinedstorage.void_excess.help": "Quand le mode anéantir les ressources en excès est allumé et que le stockage est plein, il continuera d'accepter les ressources mais les détruira.", + "gui.refinedstorage.void_excess.allowlist_warning": "Le mode anéantir les ressources en excès ne fonction que lorsque le stockage est en mode liste blanche.", + "gui.refinedstorage.upgrade_slot": "Emplacement d'amélioration vide", + "gui.refinedstorage.filter_slot.empty_filter": "Filtre vide", + "gui.refinedstorage.filter_slot.left_click_for": "Left click for", + "gui.refinedstorage.filter_slot.right_click_for": "Right click for", + "gui.refinedstorage.filter_slot.click_to_clear": "Click to clear", + "gui.refinedstorage.regulator_upgrade.filter_help": "La ressource qui doit être régulée dans la cible.", + "gui.refinedstorage.network_transmitter.status.inactive": "Inactif", + "gui.refinedstorage.network_transmitter.status.missing_network_card": "Carte réseau manquante", + "gui.refinedstorage.network_transmitter.status.transmitting": "%d bloc(s)", + "gui.refinedstorage.network_transmitter.status.receiver_unreachable": "Inaccessible", + "gui.refinedstorage.security_card.permission.reset": "Réinitialiser", + "gui.refinedstorage.security_card.permission.modified": "Modifiée", + "gui.refinedstorage.security_manager.redstone_mode_help": "Lorsque ce périphérique est inactif, le réseau ne sera pas protégé.", + "gui.refinedstorage.security_manager.fallback_security_card_slot_hint": "Emplacement pour une carte de sécurité de repli.", + "gui.refinedstorage.security_manager.no_fallback_security_card_consequence": "Ajoutez une Carte de sécurité de repli à cet emplacement pour définir les permissions de tous les joueurs sans Carte de sécurité. Par défaut, toutes les actions sont interdites.", + "gui.refinedstorage.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage.relay.pass_through": "Pass-through", + "gui.refinedstorage.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage.relay.pass_energy": "Pass energy", + "gui.refinedstorage.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage.relay.pass_storage": "Pass storage", + "gui.refinedstorage.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage.relay.pass_security": "Pass security", + "gui.refinedstorage.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.", + "gui.refinedstorage.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.", + "gui.refinedstorage.disk_interface.in": "In", + "gui.refinedstorage.disk_interface.out": "Out", + "gui.refinedstorage.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.", + "gui.refinedstorage.disk_interface.transfer_mode": "Transfer mode", + "gui.refinedstorage.disk_interface.transfer_mode.insert_into_network": "Insert into network", + "gui.refinedstorage.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.", + "gui.refinedstorage.disk_interface.transfer_mode.extract_from_network": "Extract from network", + "gui.refinedstorage.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.", + "item.refinedstorage.controller.help": "Alimente le réseau de stockage en énergie. Plusieurs sont autorisés dans un seul réseau de stockage. ", + "item.refinedstorage.creative_controller.help": "Alimente le réseau de stockage avec une source d'énergie infinie. ", + "item.refinedstorage.disk_drive.help": "Accepte des disques de stockage pour fournir de l'espace de stockage au réseau.", + "item.refinedstorage.disk_interface.help": "Transfers resources between the storage network and provided storage disks.", + "item.refinedstorage.grid.help": "Permet d'interagir avec le réseau de stockage.", + "item.refinedstorage.crafting_grid.help": "Permet d'interagir avec le réseau de stockage, avec les capacités d'artisanat.", + "item.refinedstorage.importer.help": "Importe des ressources depuis une source externe vers le réseau de stockage.", + "item.refinedstorage.exporter.help": "Exporte les ressources du réseau de stockage vers une destination externe.", + "item.refinedstorage.interface.help": "Agit comme la combinaison d'un importateur et d'un exportateur.", + "item.refinedstorage.external_storage.help": "Fournit au réseau de stockage accès à un inventaire externe.", + "item.refinedstorage.detector.help": "Émet un signal de redstone si le réseau de stockage contient une ressource en quantité égale, supérieure ou inférieure à un seuil donné.", + "item.refinedstorage.constructor.help": "Place des blocs du réseau de stockage dans le monde.", + "item.refinedstorage.destructor.help": "Détruit les blocs du monde et les met dans le réseau de stockage.", + "item.refinedstorage.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.", + "item.refinedstorage.quartz_enriched_iron": "Fer enrichi en quartz", + "item.refinedstorage.quartz_enriched_copper": "Quartz Enriched Copper", + "item.refinedstorage.processor_binding": "Liant pour processeur", + "item.refinedstorage.silicon": "Silicone", + "item.refinedstorage.raw_basic_processor": "Processeur basique brut", + "item.refinedstorage.raw_improved_processor": "Processeur amélioré brut", + "item.refinedstorage.raw_advanced_processor": "Processeur avancé brut", + "item.refinedstorage.basic_processor": "Processeur basique", + "item.refinedstorage.improved_processor": "Processeur amélioré", + "item.refinedstorage.advanced_processor": "Processeur avancé", + "item.refinedstorage.1k_storage_part": "Pièce de stockage 1k", + "item.refinedstorage.4k_storage_part": "Pièce de stockage 4k", + "item.refinedstorage.16k_storage_part": "Pièce de stockage 16k", + "item.refinedstorage.64k_storage_part": "Pièce de stockage 64k", + "item.refinedstorage.1k_storage_disk": "Disque de stockage 1k", + "item.refinedstorage.4k_storage_disk": "Disque de stockage 4k", + "item.refinedstorage.16k_storage_disk": "Disque de stockage 16k", + "item.refinedstorage.64k_storage_disk": "Disque de stockage 64k", + "item.refinedstorage.storage_disk.help": "Stores %s items.", + "item.refinedstorage.storage_block.help": "Stores %s items.", + "item.refinedstorage.creative_storage_disk": "Disque de stockage créatif", + "item.refinedstorage.creative_storage_disk.help": "Stores an infinite amount of items.", + "item.refinedstorage.creative_storage_block.help": "Stores an infinite amount of items.", + "item.refinedstorage.64b_fluid_storage_part": "Pièce de stockage de fluides 64B", + "item.refinedstorage.256b_fluid_storage_part": "Pièce de stockage de fluides 256B", + "item.refinedstorage.1024b_fluid_storage_part": "Pièce de stockage de fluides 1024B", + "item.refinedstorage.4096b_fluid_storage_part": "Pièce de stockage de fluides 4096B", + "item.refinedstorage.64b_fluid_storage_disk": "Disque de stockage de fluides 64B", + "item.refinedstorage.256b_fluid_storage_disk": "Disque de stockage de fluides 256B", + "item.refinedstorage.1024b_fluid_storage_disk": "Disque de stockage de fluides 1024B", + "item.refinedstorage.4096b_fluid_storage_disk": "Disque de stockage de fluides 4096B", + "item.refinedstorage.fluid_storage_disk.help": "Stocke %s seaux.", + "item.refinedstorage.fluid_storage_block.help": "Stockes %s seaux.", + "item.refinedstorage.creative_fluid_storage_disk": "Disque de stockage de fluides créatif", + "item.refinedstorage.creative_fluid_storage_disk.help": "Stocke une quantité infinie de seaux.", + "item.refinedstorage.creative_fluid_storage_block.help": "Stocke une quantité infinie de seaux.", + "item.refinedstorage.storage_housing": "Boitier de stockage", + "item.refinedstorage.construction_core": "Cœur de construction", + "item.refinedstorage.destruction_core": "Cœur de destruction", + "item.refinedstorage.wrench": "Clé", + "item.refinedstorage.wrench.help": "Utiliser afin de tourner des blocs ou appuyer sur SHIFT et utiliser afin de démonter des blocs Refined Storage.", + "item.refinedstorage.upgrade": "Amélioration", + "item.refinedstorage.speed_upgrade": "Amélioration de vitesse", + "item.refinedstorage.speed_upgrade.help": "Increases the operation speed of a storage network device.", + "item.refinedstorage.stack_upgrade": "Amélioration de stack", + "item.refinedstorage.stack_upgrade.help": "Increases the amount of resources that the storage network device handles per operation.", + "item.refinedstorage.silk_touch_upgrade": "Amélioration de toucher de soie", + "item.refinedstorage.silk_touch_upgrade.help": "Acts like the Silk Touch enchantment on a pickaxe.", + "item.refinedstorage.fortune_upgrade.1": "Amélioration de fortune I", + "item.refinedstorage.fortune_upgrade.2": "Amélioration de fortune II", + "item.refinedstorage.fortune_upgrade.3": "Amélioration de fortune III", + "item.refinedstorage.fortune_upgrade.help": "Yields more resources when breaking a block. Acts like the Fortune enchantment on a pickaxe.", + "item.refinedstorage.regulator_upgrade": "Amélioration de régulation", + "item.refinedstorage.regulator_upgrade.help": "Dans un Exportateur, n'exportera que si le montant dans la cible est inférieur à la valeur configurée dans l'amélioration. Dans un Importateur, n'importera que si le montant dans la cible est supérieur à la valeur configurée dans l'amélioration. Utilisez l'objet pour configurer.", + "item.refinedstorage.range_upgrade": "Amélioration de portée", + "item.refinedstorage.range_upgrade.help": "Increases the range of the Wireless Transmitter.", + "item.refinedstorage.creative_range_upgrade": "Amélioration de portée créative", + "item.refinedstorage.creative_range_upgrade.help": "Provides infinite range for the Wireless Transmitter. Does not work cross-dimensionally.", + "item.refinedstorage.wireless_grid": "Grille sans fil", + "item.refinedstorage.creative_wireless_grid": "Grille sans fil créative", + "item.refinedstorage.wireless_transmitter.help": "Fournit un accès au réseau sans fil pour des objets comme la grille sans fil. Plusieurs sont autorisés pour une couverture plus large.", + "item.refinedstorage.network_item.unbound": "Non liée.", + "item.refinedstorage.network_item.unbound.help": "Utiliser sur n'importe quel périphérique du réseau de stockage pour relier.", + "item.refinedstorage.network_item.bound_to": "Lié à %d, %d, %d.", + "item.refinedstorage.network_item.cannot_open_with_shortcut_due_to_duplicate": "Il y a plusieurs %s dans votre inventaire.", + "item.refinedstorage.network_item.cannot_open_because_not_found": "Il n'y a pas de %s dans votre inventaire.", + "item.refinedstorage.configuration_card": "Carte de configuration", + "item.refinedstorage.configuration_card.empty": "Vide.", + "item.refinedstorage.configuration_card.configured": "Contient une configuration pour %s.", + "item.refinedstorage.configuration_card.copied_configuration": "Configuration copiée pour %s.", + "item.refinedstorage.configuration_card.cleared_configuration": "Configuration effacée.", + "item.refinedstorage.configuration_card.cannot_apply_configuration": "Impossible d'appliquer la carte de configuration à un autre type de périphérique. Elle est configurée pour %s.", + "item.refinedstorage.configuration_card.applied_configuration": "Configuration appliquée.", + "item.refinedstorage.configuration_card.empty_help": "Utiliser sur un périphérique réseau en étant accroupi pour sauvegarder sa configuration et ses améliorations dans la carte.", + "item.refinedstorage.configuration_card.configured_help": "Utiliser sur le périphérique de destination en étant accroupi pour transférer la configuration et les améliorations. Utiliser en étant accroupi pour effacer.", + "item.refinedstorage.network_card": "Carte réseau", + "item.refinedstorage.network_card.unbound_help": "Utilisez en étant accroupi sur un Récepteur réseau.", + "item.refinedstorage.network_card.unbound": "Unbound.", + "item.refinedstorage.network_card.bound_help": "Insert into a Network Transmitter. Use while crouching to clear binding.", + "item.refinedstorage.network_card.bound": "Bound to %d, %d, %d in %s.", + "item.refinedstorage.network_transmitter.help": "Transmits a network signal wirelessly. Needs a Network Card that is paired with a Network Receiver.", + "item.refinedstorage.network_receiver.help": "Receives a network signal wirelessly. Bind a Network Card to this block.", + "item.refinedstorage.cable.help": "Connects storage network devices with each other.", + "item.refinedstorage.security_card": "Security Card", + "item.refinedstorage.security_card.cleared_configuration": "Cleared configuration.", + "item.refinedstorage.security_card.unbound": "Unbound.", + "item.refinedstorage.security_card.unbound.help": "Right click to configure and bind to the current player.", + "item.refinedstorage.security_card.bound": "Bound to %s.", + "item.refinedstorage.security_card.bound.help": "Right click to configure. Use while crouching to clear configuration and binding.", + "item.refinedstorage.fallback_security_card": "Fallback Security Card", + "item.refinedstorage.fallback_security_card.help": "Acts as a fallback if no matching Security Card for a player is found. Right click to configure. Use while crouching to clear configuration.", + "item.refinedstorage.portable_grid.help": "Allows to interact with a storage disk while not being connected to a storage network. Can be used as a block in world, or from your inventory.", + "item.refinedstorage.storage_monitor.help": "A block that displays the current amount of a certain resource in your storage network. SHIFT + right click to configure. Left click to extract a stack, SHIFT + left click to extract a single resource, right click to insert a resource, right click multiple times to insert resources in bulk.", + "misc.refinedstorage.stored": "Stocké : %s", + "misc.refinedstorage.stored_with_capacity": "Stocké : %s / %s (%d%%)", + "misc.refinedstorage.total": "%d total", + "misc.refinedstorage.last_modified.just_now": "Dernière modification à l'instant par %s", + "misc.refinedstorage.last_modified.second": "Dernière modification il y %d seconde par %s", + "misc.refinedstorage.last_modified.seconds": "Dernière modification il y %d secondes par %s", + "misc.refinedstorage.last_modified.minute": "Dernière modification il y %d minute par %s", + "misc.refinedstorage.last_modified.minutes": "Dernière modification il y %d minutes par %s", + "misc.refinedstorage.last_modified.hour": "Dernière modification il y %d heure par %s", + "misc.refinedstorage.last_modified.hours": "Dernière modification il y %d heures par %s", + "misc.refinedstorage.last_modified.day": "Dernière modification il y %d jour par %s", + "misc.refinedstorage.last_modified.days": "Dernière modification il y %d jours par %s", + "misc.refinedstorage.last_modified.week": "Dernière modification il y %d semaine par %s", + "misc.refinedstorage.last_modified.weeks": "Dernière modification il y %d semaines par %s", + "misc.refinedstorage.last_modified.year": "Dernière modification il y %d an par %s", + "misc.refinedstorage.last_modified.years": "Dernière modification il y %d ans par %s", + "misc.refinedstorage.resource_type.item": "Objet", + "misc.refinedstorage.resource_type.fluid": "Fluide", + "misc.refinedstorage.press_shift_for_help": "Appuyez sur Maj pour obtenir de l'aide", + "misc.refinedstorage.no_permission": "Permission manquante", + "misc.refinedstorage.no_permission.open": "Vous n'êtes pas autorisé à ouvrir %s.", + "misc.refinedstorage.no_permission.insert": "Vous n'êtes pas autorisé à insérer.", + "misc.refinedstorage.no_permission.extract": "Vous n'êtes pas autorisé à extraire.", + "misc.refinedstorage.no_permission.build.place": "Vous n'êtes pas autorisé à placer %s ici.", + "misc.refinedstorage.no_permission.build.break": "Vous n'êtes pas autorisé à casser %s.", + "misc.refinedstorage.no_permission.build.rotate": "Vous n'êtes pas autorisé à faire pivoter %s.", + "misc.refinedstorage.no_permission.build.dismantle": "Vous n'êtes pas autorisé à démonter %s.", + "key.refinedstorage.focus_search_bar": "Focus search bar", + "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Vider la matrice d'artisanat dans le réseau", + "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Vider la matrice d'artisanat dans l'inventaire", + "key.refinedstorage.open_wireless_grid": "Ouvrir la grille sans fil", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", + "refinedstorage.subtitle.wrench": "Clé utilisée", + "permission.refinedstorage.insert": "Insérer", + "permission.refinedstorage.insert.description": "Si le joueur peut insérer des ressources dans le réseau.", + "permission.refinedstorage.extract": "Extraire", + "permission.refinedstorage.extract.description": "Si le joueur peut extraire des ressources du réseau.", + "permission.refinedstorage.autocrafting": "Fabrication automatique", + "permission.refinedstorage.autocrafting.description": "Si le joueur peut démarrer, annuler ou afficher les tâches de fabrication automatique.", + "permission.refinedstorage.open": "Ouvrir", + "permission.refinedstorage.open.description": "Si le joueur peut ouvrir l'interface graphique des périphériques du réseau.", + "permission.refinedstorage.build": "Construire", + "permission.refinedstorage.build.description": "Si le joueur peut ajouter ou enlever des périphériques au réseau.", + "permission.refinedstorage.security": "Sécurité", + "permission.refinedstorage.security.description": "Si le joueur peut gérer les options de sécurité du réseau.", + "tag.item.refinedstorage.cables": "Cables", + "tag.item.refinedstorage.constructors": "Constructors", + "tag.item.refinedstorage.controllers": "Controllers", + "tag.item.refinedstorage.crafting_grids": "Crafting Grids", + "tag.item.refinedstorage.creative_controllers": "Creative Controllers", + "tag.item.refinedstorage.destructors": "Destructors", + "tag.item.refinedstorage.detectors": "Detectors", + "tag.item.refinedstorage.exporters": "Exporters", + "tag.item.refinedstorage.external_storages": "External Storages", + "tag.item.refinedstorage.fluid_storage_disks": "Fluid Storage Disks", + "tag.item.refinedstorage.grids": "Grids", + "tag.item.refinedstorage.importers": "Importers", + "tag.item.refinedstorage.network_receivers": "Network Receivers", + "tag.item.refinedstorage.network_transmitters": "Network Transmitters", + "tag.item.refinedstorage.relays": "Relays", + "tag.item.refinedstorage.security_managers": "Security Managers", + "tag.item.refinedstorage.storage_disks": "Storage Disks", + "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", + "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", + "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", + "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", + "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", + "text.autoconfig.refinedstorage.option.grid": "Grille", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", + "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Empêcher le tri lorsque la touche Maj est enfoncée", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", + "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", + "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", + "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronisation", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", + "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Direction du tri", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", + "text.autoconfig.refinedstorage.option.grid.sortingType": "Type de tri", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", + "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", + "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", + "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", + "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", + "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", + "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", + "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", + "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", + "text.autoconfig.refinedstorage.option.importer": "Importateur", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", + "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", + "text.autoconfig.refinedstorage.option.exporter": "Exportateur", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", + "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", + "text.autoconfig.refinedstorage.option.detector": "Détecteur", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", + "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", + "text.autoconfig.refinedstorage.option.constructor": "Constructeur", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", + "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", + "text.autoconfig.refinedstorage.option.destructor": "Destructeur", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", + "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", + "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", + "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", + "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", + "text.autoconfig.refinedstorage.option.externalStorage": "Stockage Externe", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", + "text.autoconfig.refinedstorage.option.wirelessGrid": "Grille sans fil", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Capacité énergétique", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", + "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Émetteur sans fil", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Portée de base", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", + "text.autoconfig.refinedstorage.option.storageMonitor": "Moniteur de Stockage", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", + "text.autoconfig.refinedstorage.option.networkReceiver": "Récepteur Réseau", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", + "text.autoconfig.refinedstorage.option.networkTransmitter": "Transmetteur Réseau", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", + "text.autoconfig.refinedstorage.option.portableGrid": "Grille portable", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", + "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", + "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", + "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", + "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", + "advancements.refinedstorage.connecting": "Connexion en cours", + "advancements.refinedstorage.connecting.description": "Utiliser un câble pour connecter pour connecter des périphériques ensembles, ou placer les périphériques l'un contre l'autre", + "advancements.refinedstorage.drives": "Disques", + "advancements.refinedstorage.drives.description": "Craftez un lecteur de disques afin de stocker vos disques de stockage", + "advancements.refinedstorage.interfacing_with_disks": "Interfacer avec des disques", + "advancements.refinedstorage.interfacing_with_disks.description": "Craftez une interface disque afin de transférer des ressources entre le réseau de stockage et les disques de stockage", + "advancements.refinedstorage.storing_items": "Stocker des items", + "advancements.refinedstorage.storing_items.description": "Craftez un disque de stockage et mettez-le dans votre lecteur de disque", + "advancements.refinedstorage.viewing_your_storage": "Visualiser votre stockage", + "advancements.refinedstorage.viewing_your_storage.description": "Craftez une grille pour interagir avec votre stockage", + "advancements.refinedstorage.upgrading_your_grid": "Ameliorer votre grille", + "advancements.refinedstorage.upgrading_your_grid.description": "Upgrade your Grid to a Crafting Grid to get crafting abilities", + "advancements.refinedstorage.storing_fluids": "Storing fluids", + "advancements.refinedstorage.storing_fluids.description": "Craft a Fluid Storage Disk and put it in your Disk Drive", + "advancements.refinedstorage.importing": "Importing", + "advancements.refinedstorage.importing.description": "Get resources into the storage network with an Importer", + "advancements.refinedstorage.exporting": "Exporting", + "advancements.refinedstorage.exporting.description": "Get resources out of the storage network with an Exporter", + "advancements.refinedstorage.upgrading": "Upgrading", + "advancements.refinedstorage.upgrading.description": "Construire une amélioration pour améliorer divers périphériques", + "advancements.refinedstorage.interface_to_the_world": "Interface to the world", + "advancements.refinedstorage.interface_to_the_world.description": "Export and import items at the same time with an Interface", + "advancements.refinedstorage.storing_externally": "Storing externally", + "advancements.refinedstorage.storing_externally.description": "Use an External Storage to provide the network with storage from an external block like a chest", + "advancements.refinedstorage.detecting": "Detecting", + "advancements.refinedstorage.detecting.description": "Use redstone to check resources stored in the storage network", + "advancements.refinedstorage.construction": "Construction", + "advancements.refinedstorage.construction.description": "Get blocks from the storage network into the world with a Constructor", + "advancements.refinedstorage.destruction": "Destruction", + "advancements.refinedstorage.destruction.description": "Get blocks from in the world into the storage network with a Destructor", + "advancements.refinedstorage.wireless": "Sans fil", + "advancements.refinedstorage.wireless.description": "Accédez à vos ressources à distance avec une grille sans fil", + "advancements.refinedstorage.better_than_a_barrel": "Better than a barrel", + "advancements.refinedstorage.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network", + "advancements.refinedstorage.no_cables_required": "No cables required", + "advancements.refinedstorage.no_cables_required.description": "Add extra components to your storage network without using cables by using a Network Transmitter, Network Receiver and Network Card", + "advancements.refinedstorage.portable_storage": "Portable storage", + "advancements.refinedstorage.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", + "advancements.refinedstorage.security": "Security", + "advancements.refinedstorage.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" +} diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/hu_hu.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/hu_hu.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/hu_hu.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/hu_hu.json index f08f87e3b..adf9fc563 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/hu_hu.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/hu_hu.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Wrench used", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exporter", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/id_id.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/id_id.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/id_id.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/id_id.json index b01e02486..4c58839c8 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/id_id.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/id_id.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Singkirkan matriks Kisi Kerajinan ke jaringan", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Singkirkan matriks Kisi Kerajinan ke inventaris", "key.refinedstorage.open_wireless_grid": "Buka Kisi Nirkabel", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Kunci inggris digunakan", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Kisi", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Font besar", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Mencegah pengurutan ketika SHIFT ditekan", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detail teks keterangan", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Ingat permintaan pencarian", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Memilih otomatis kotak pencarian", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Sinkronisasi", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Jenis sumber daya", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Arah Pengurutan", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Jenis pengurutan", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Kisi Kerajinan", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Perilaku menutup Matriks kerajinan", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Pengendali", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Kapasitas daya", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Kabel", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Lemari Cakram", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Pemakaian daya per cakram", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Balok Penyimpanan", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "Pemakaian daya 1K", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "Pemakaian daya 4K", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "Pemakaian daya 16K", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "Pemakaian daya 64K", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Pemakaian daya kreatif", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Balok Penyimpanan Cairan", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "Pemakaian daya 64M", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "Pemakaian daya 256M", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "Pemakaian daya 1024M", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "Pemakaian daya 4096M", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Pemakaian daya kreatif", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importir", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Eksportir", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Pendeteksi", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Pembangun", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Penghancur", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Peningkatan", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Pemakaian daya peningkat kecepatan", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Pemakaian daya peningkat tumpukan", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Pemakaian daya peningkat peruntungan 1", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Pemakaian daya peningkat peruntungan 2", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Pemakaian daya peningkat peruntungan 3", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Pemakaian daya peningkat sentuhan sutra", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Pemakaian daya peningkat pengatur", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Pemakaian daya peningkat jangkauan", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Pemakaian daya peningkat jangkauan kreatif", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Rentang Peningkatan Jangkauan", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Antarmuka", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "Penyimpanan Eksternal", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Kisi Nirkabel", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Kapasitas energi", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Buka pemakaian daya", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Masukkan pemakaian daya", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Ekstrak pemakaian daya", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Pemancar Nirkabel", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Jangkauan Dasar", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Monitor Penyimpanan", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Penerima Jaringan", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Pemancar Jaringan", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Pemakaian daya", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Kisi Portabel", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Kapasitas energi", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Buka pemakaian daya", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Masukkan pemakaian daya", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Ekstrak pemakaian daya", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Menyambungkan", "advancements.refinedstorage.connecting.description": "Gunakan Kabel untuk menghubungkan perangkat satu sama lain, atau letakkan perangkat melawan satu sama lain", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/it_it.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/it_it.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/it_it.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/it_it.json index f08f87e3b..adf9fc563 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/it_it.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/it_it.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Wrench used", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exporter", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/ja_jp.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/ja_jp.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/ja_jp.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/ja_jp.json index 56cd7dc0e..4c45dde42 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/ja_jp.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/ja_jp.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Wrench used", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exporter", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/ko_kr.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/ko_kr.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/ko_kr.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/ko_kr.json index f08f87e3b..adf9fc563 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/ko_kr.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/ko_kr.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Wrench used", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exporter", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/pl_pl.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/pl_pl.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/pl_pl.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/pl_pl.json index 2fbd84b22..a4280a4c7 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/pl_pl.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/pl_pl.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Wrench used", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exporter", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "Zewnętrzny magazyn", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Zużycie energii", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/pt_br.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/pt_br.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/pt_br.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/pt_br.json index 6ccc338a8..f53a35996 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/pt_br.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/pt_br.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Wrench used", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exporter", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/ru_ru.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/ru_ru.json similarity index 79% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/ru_ru.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/ru_ru.json index 0b3c8b15c..7b074251b 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/ru_ru.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/ru_ru.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Wrench used", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exporter", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/tr_tr.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/tr_tr.json new file mode 100644 index 000000000..976dd8177 --- /dev/null +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/tr_tr.json @@ -0,0 +1,569 @@ +{ + "mod.refinedstorage": "Refined Storage", + "block.refinedstorage.cable": "Kablo", + "block.refinedstorage.quartz_enriched_iron_block": "Kuvarsla Zenginleştirilmiş Demir Bloğu", + "block.refinedstorage.quartz_enriched_copper_block": "Kuvarsla Zenginleştirilmiş Bakır Bloğu", + "block.refinedstorage.disk_drive": "Disk Sürücüsü", + "block.refinedstorage.machine_casing": "Makine Muhafazası", + "block.refinedstorage.grid": "Terminal", + "block.refinedstorage.crafting_grid": "Üretim Terminali", + "block.refinedstorage.controller": "Denetleyici", + "block.refinedstorage.creative_controller": "Yaratıcı Mod Denetleyici", + "block.refinedstorage.1k_storage_block": "1K Depolama Bloğu", + "block.refinedstorage.4k_storage_block": "4K Depolama Bloğu", + "block.refinedstorage.16k_storage_block": "16K Depolama Bloğu", + "block.refinedstorage.64k_storage_block": "64K Depolama Bloğu", + "block.refinedstorage.creative_storage_block": "Yaratıcı Mod Depolama Bloğu", + "block.refinedstorage.64b_fluid_storage_block": "64B Akışkan Depolama Bloğu", + "block.refinedstorage.256b_fluid_storage_block": "256B Akışkan Depolama Bloğu", + "block.refinedstorage.1024b_fluid_storage_block": "1024B Akışkan Depolama Bloğu", + "block.refinedstorage.4096b_fluid_storage_block": "4096B Akışkan Depolama Bloğu", + "block.refinedstorage.creative_fluid_storage_block": "Yaratıcı Mod Akışkan Depolama Bloğu", + "block.refinedstorage.importer": "İçe Aktarıcı", + "block.refinedstorage.exporter": "Dışarıya Aktarıcı", + "block.refinedstorage.interface": "Arayüz", + "block.refinedstorage.external_storage": "Harici Depo", + "block.refinedstorage.detector": "Dedektör", + "block.refinedstorage.constructor": "Yapıcı", + "block.refinedstorage.destructor": "Yıkıcı", + "block.refinedstorage.wireless_transmitter": "Kablosuz Verici", + "block.refinedstorage.storage_monitor": "Depolama Monitörü", + "block.refinedstorage.network_receiver": "Ağ Alıcısı", + "block.refinedstorage.network_transmitter": "Ağ Vericisi", + "block.refinedstorage.portable_grid": "Taşınabilir Terminal", + "block.refinedstorage.creative_portable_grid": "Yaratıcı Mod Taşınabilir Terminal", + "block.refinedstorage.security_manager": "Güvenlik Yöneticisi", + "block.refinedstorage.security_manager.help": "Bu cihaz aktif olduğunda, varsayılan olarak ağı koruyacak ve tüm işlemleri engelleyecektir. Bir oyuncu için belirli işlemlere izin vermek veya reddetmek için Güvenlik Kartları eklemeye başlayın.", + "block.refinedstorage.relay": "Röle", + "block.refinedstorage.disk_interface": "Disk Arayüzü", + "gui.refinedstorage.controller.redstone_mode_help": "Bu cihaz etkin olmadığında, depolama ağı bu cihazı enerji kaynağı olarak kullanamayacaktır.", + "gui.refinedstorage.disk_drive.disks": "Diskler", + "gui.refinedstorage.storage.redstone_mode_help": "Bu cihaz etkin olmadığında, içerdiği depolama alanına depolama ağı içinden erişilemeyecektir.", + "gui.refinedstorage.storage.filter_help": "Cihazın izin listesi veya engel listesi modunda olmasına bağlı olarak, bu depolama alanında izin verilebilecek veya verilmeyebilecek kaynaklar.", + "gui.refinedstorage.storage.filter_mode.empty_warning": "Yapılandırılmış herhangi bir filtre olmadan, bu depolama alanına hiçbir kaynak kabul edilmeyecektir.", + "gui.refinedstorage.storage.filter_mode.allow.help": "Yalnızca filtrelerde yapılandırılan kaynakların bu depolama alanına girmesine izin ver.", + "gui.refinedstorage.storage.filter_mode.block.help": "Filtrelerde yapılandırılan kaynakların bu depolama alanına girmesine izin verme.", + "gui.refinedstorage.grid.sorting.direction": "Sıralama yönü", + "gui.refinedstorage.grid.sorting.direction.ascending": "Artan", + "gui.refinedstorage.grid.sorting.direction.descending": "Azalan", + "gui.refinedstorage.grid.sorting.type": "Sıralama türü", + "gui.refinedstorage.grid.sorting.type.quantity": "Miktar", + "gui.refinedstorage.grid.sorting.type.name": "Ad", + "gui.refinedstorage.grid.sorting.type.id": "ID", + "gui.refinedstorage.grid.sorting.type.last_modified": "Son düzenleme", + "gui.refinedstorage.grid.auto_selected": "Otomatik seçili", + "gui.refinedstorage.grid.auto_selected.help": "Terminal açılırken arama kutusunun otomatik olarak seçilip seçilmeyeceği.", + "gui.refinedstorage.grid.synchronizer": "Senkronizasyon modu", + "gui.refinedstorage.grid.synchronizer.off": "Kapalı", + "gui.refinedstorage.grid.synchronizer.off.help": "Arama kutusu metnini senkronize etme.", + "gui.refinedstorage.grid.resource_type": "Kaynak türü", + "gui.refinedstorage.grid.resource_type.all": "Hepsi", + "gui.refinedstorage.grid.resource_type.help": "Belirli kaynak türlerini filtreleyin.", + "gui.refinedstorage.crafting_grid.move.network": "Eşyaları ağa taşı", + "gui.refinedstorage.crafting_grid.move.inventory": "Eşyaları envantere taşı", + "gui.refinedstorage.screen_size": "Ekran boyutu", + "gui.refinedstorage.screen_size.stretch": "Esnet", + "gui.refinedstorage.screen_size.small": "Küçük", + "gui.refinedstorage.screen_size.medium": "Orta", + "gui.refinedstorage.screen_size.large": "Büyük", + "gui.refinedstorage.screen_size.extra_large": "Çok büyük", + "gui.refinedstorage.detector.mode": "Mod", + "gui.refinedstorage.detector.mode.under": "Miktarın altında olduğunda redstone sinyali yayınla", + "gui.refinedstorage.detector.mode.equal": "İstenilen miktara gelindiğinde redstone sinyali yayınla", + "gui.refinedstorage.detector.mode.above": "Miktarın üzerinde olduğunda redstone sinyali yayınla", + "gui.refinedstorage.detector.filter_help": "Depolama ağında tespit edilmesi gereken kaynak.", + "gui.refinedstorage.destructor.pickup_items": "Eşyaları kırmak yerine toplar", + "gui.refinedstorage.destructor.filter_help": "Cihazın, izin listesi veya engel listesi modunda olmasına bağlı olarak yok edilebilecek veya yok edilemeyecek bloklar.", + "gui.refinedstorage.destructor.filter_mode.allow.help": "Depolama ağına, yalnızca filtrelerde yapılandırılmış blokların girmesine izin ver.", + "gui.refinedstorage.destructor.filter_mode.block.help": "Depolama ağına, filtrelerde yapılandırılmış blokların girmesine izin verme.", + "gui.refinedstorage.constructor.drop_items": "Blok yerleştirmek yerine eşyaları bırakır", + "gui.refinedstorage.constructor.filter_help": "Depolama ağından yerleştirilmesi gereken kaynaklar.", + "gui.refinedstorage.interface.filter_help": "Depolama ağından dışarı aktarılması gereken kaynaklar.", + "gui.refinedstorage.exporter.filter_help": "Depolama ağından dışarı aktarılması gereken kaynaklar.", + "gui.refinedstorage.importer.filter_help": "Hedef envanterden içe aktarılabilecek kaynaklar.", + "gui.refinedstorage.importer.filter_mode.allow.help": "Yalnızca filtrelerde yapılandırılmış kaynakların depolama ağına girmesine izin ver.", + "gui.refinedstorage.importer.filter_mode.block.help": "Filtrelerde yapılandırılmış kaynakların depolama ağına girmesine izin verme.", + "gui.refinedstorage.wireless_transmitter.distance": "%d blok", + "gui.refinedstorage.storage_monitor.filter_help": "Görüntülenecek kaynak.", + "gui.refinedstorage.redstone_mode": "Redstone modu", + "gui.refinedstorage.redstone_mode.ignore": "Yoksay", + "gui.refinedstorage.redstone_mode.ignore.help": "Bu cihaz redstone sinyalinden bağımsız olarak her zaman aktif olacaktır.", + "gui.refinedstorage.redstone_mode.high": "Yüksek", + "gui.refinedstorage.redstone_mode.high.help": "Bu cihaz yalnızca redstone sinyaliyle etkinleşecektir.", + "gui.refinedstorage.redstone_mode.low": "Düşük", + "gui.refinedstorage.redstone_mode.low.help": "Bu cihaz yalnızca redstone sinyali olmadan etkinleşecektir.", + "gui.refinedstorage.scheduling_mode": "Sıralama modu", + "gui.refinedstorage.scheduling_mode.default": "Varsayılan", + "gui.refinedstorage.scheduling_mode.default.help": "Müsait olan ilk filtreyi kullan.", + "gui.refinedstorage.scheduling_mode.round_robin": "Sırayla", + "gui.refinedstorage.scheduling_mode.round_robin.help": "Her filtreyi sırayla kullan.", + "gui.refinedstorage.scheduling_mode.random": "Rastgele", + "gui.refinedstorage.scheduling_mode.random.help": "Rastgele bir filtreyi kullan.", + "gui.refinedstorage.priority": "Öncelik", + "gui.refinedstorage.priority.storage_help": "Depolama ağının kaynakları ekleyeceği veya çıkaracağı sıra, en yüksek-ilk.", + "gui.refinedstorage.amount": "Miktar", + "gui.refinedstorage.amount.reset": "Sıfırla", + "gui.refinedstorage.amount.set": "Ayarla", + "gui.refinedstorage.filter_mode": "Filtre modu", + "gui.refinedstorage.filter_mode.allow": "İzin Listesi", + "gui.refinedstorage.filter_mode.block": "Engel Listesi", + "gui.refinedstorage.fuzzy_mode": "Belirsiz Mod", + "gui.refinedstorage.fuzzy_mode.on": "Açık", + "gui.refinedstorage.fuzzy_mode.on.storage_help": "İzin listesi veya engel listesi için filtreleri tam olarak eşleştir.", + "gui.refinedstorage.fuzzy_mode.on.generic_help": "Filtreyi tam olarak eşleştir.", + "gui.refinedstorage.fuzzy_mode.on.extracting_storage_network_help": "Depolama ağından çıkarırken filtreleri tam olarak eşleştir.", + "gui.refinedstorage.fuzzy_mode.on.extracting_source_help": "Kaynaktan çıkarırken filtreleri tam olarak eşleştir.", + "gui.refinedstorage.fuzzy_mode.off": "Kapalı", + "gui.refinedstorage.fuzzy_mode.off.storage_help": "NBT etiketlerini karşılaştırmadan izin listesi veya engel listesi için filtreleri eşleştir.", + "gui.refinedstorage.fuzzy_mode.off.generic_help": "NBT etiketlerini karşılaştırmadan filtreyi eşleştir.", + "gui.refinedstorage.fuzzy_mode.off.extracting_storage_network_help": "NBT etiketlerini karşılaştırmadan depolama ağından çıkarırken filtreleri eşleştir.", + "gui.refinedstorage.fuzzy_mode.off.extracting_source_help": "NBT etiketlerini karşılaştırmadan kaynaktan çıkarırken filtreleri eşleştir.", + "gui.refinedstorage.access_mode": "Erişim modu", + "gui.refinedstorage.access_mode.insert_extract": "Ekle ve çıkar", + "gui.refinedstorage.access_mode.insert_extract.help": "Depolama ağı, bu depoya ekleme veya çıkarma yapabilecektir.", + "gui.refinedstorage.access_mode.insert": "Yalnızca ekle", + "gui.refinedstorage.access_mode.insert.help": "Depolama ağı, yalnızca bu depoya ekleme yapabilecektir. Depolanan kaynaklar Terminal'de görünür olmaya devam edecektir.", + "gui.refinedstorage.access_mode.extract": "Yalnızca çıkar", + "gui.refinedstorage.access_mode.extract.help": "Depolama ağı, yalnızca bu depodan çıkarma yapabilecektir.", + "gui.refinedstorage.void_excess": "Fazla kaynakları geçersiz kıl", + "gui.refinedstorage.void_excess.help": "Fazla kaynakları geçersiz kıl modu açıldığında ve depolama alanı dolduğunda, kaynakları kabul etmeye devam edecek ancak onları geçersiz kılacaktır.", + "gui.refinedstorage.void_excess.allowlist_warning": "Fazlalığı geçersiz kıl modu yalnızca depolama, izin listesi modundayken çalışacaktır.", + "gui.refinedstorage.upgrade_slot": "Boş yükseltme yuvası", + "gui.refinedstorage.filter_slot.empty_filter": "Boş filtre", + "gui.refinedstorage.filter_slot.left_click_for": "Şunun için Sol tıkla", + "gui.refinedstorage.filter_slot.right_click_for": "Şunun için Sağ tıkla", + "gui.refinedstorage.filter_slot.click_to_clear": "Temizlemek için tıkla", + "gui.refinedstorage.regulator_upgrade.filter_help": "Hedefte düzenlenmesi gereken kaynak.", + "gui.refinedstorage.network_transmitter.status.inactive": "Etkin Değil", + "gui.refinedstorage.network_transmitter.status.missing_network_card": "Ağ Kartı Eksik", + "gui.refinedstorage.network_transmitter.status.transmitting": "%d blok", + "gui.refinedstorage.network_transmitter.status.receiver_unreachable": "Erişilemiyor", + "gui.refinedstorage.security_card.permission.reset": "Sıfırla", + "gui.refinedstorage.security_card.permission.modified": "Değiştirilmiş", + "gui.refinedstorage.security_manager.redstone_mode_help": "Bu cihaz etkin olmadığında, ağ korunmayacaktır.", + "gui.refinedstorage.security_manager.fallback_security_card_slot_hint": "Yedek Güvenlik Kartı için Yuva.", + "gui.refinedstorage.security_manager.no_fallback_security_card_consequence": "Güvenlik Kartı olmadan her oyuncunun izinlerini ayarlamak için bu yuvaya bir Yedek Güvenlik Kartı ekleyin. Varsayılan olarak, tüm eylemler reddedilir.", + "gui.refinedstorage.relay.filter_help": "Röle, doğrudan geçiş modunda değilse giriş ağından çıkış ağına maruz bırakılması gereken kaynaklar.", + "gui.refinedstorage.relay.pass_through": "Doğrudan geçiş", + "gui.refinedstorage.relay.pass_through.help": "Bu cihazın tüm giriş ağı sinyalini olduğu gibi geçirmesi gerekip gerekmediği. Bileşenleri çıkış ağına seçici olarak maruz bırakmak için bunu kapatın.", + "gui.refinedstorage.relay.pass_energy": "Enerjiyi geçir", + "gui.refinedstorage.relay.pass_energy.help": "Bu cihazın kısa süreli toplanmış enerjiyi giriş ağından çıkış ağına geçirip geçirmeyeceği.", + "gui.refinedstorage.relay.pass_storage": "Depoyu geçir", + "gui.refinedstorage.relay.pass_storage.help": "Bu cihazın depolamayı giriş ağından çıkış ağına geçirmesi gerekip gerekmediği.", + "gui.refinedstorage.relay.pass_security": "Güvenliği geçir", + "gui.refinedstorage.relay.pass_security.help": "Bu cihazın güvenlik ayarlarını giriş ağından çıkış ağına geçirmesi gerekip gerekmediği.", + "gui.refinedstorage.relay.filter_mode.allow.help": "Yalnızca filtrelerde yapılandırılmış olan kaynakları giriş ağından çıkış ağına maruz bırakın.", + "gui.refinedstorage.relay.filter_mode.block.help": "Filtrelerde yapılandırılmış olan kaynakları giriş ağından çıkış ağına maruz bırakmayın.", + "gui.refinedstorage.disk_interface.filter_mode.allow.help": "Yalnızca filtrelerde yapılandırılan kaynakların depolama disklerine veya ağa girmesine izin ver.", + "gui.refinedstorage.disk_interface.filter_mode.block.help": "Filtrelerde yapılandırılan kaynakların depolama disklerine veya ağa girmesine izin verme.", + "gui.refinedstorage.disk_interface.in": "Giriş", + "gui.refinedstorage.disk_interface.out": "Çıkış", + "gui.refinedstorage.disk_interface.filter_help": "Cihazın izin listesi veya engel listesi modunda olmasına bağlı olarak, sağlanan depolama disklerinden veya bu disklere aktarılmasına izin verilebilecek veya verilmeyebilecek kaynaklar.", + "gui.refinedstorage.disk_interface.transfer_mode": "Aktarım modu", + "gui.refinedstorage.disk_interface.transfer_mode.insert_into_network": "Ağa ekle", + "gui.refinedstorage.disk_interface.transfer_mode.insert_into_network.help": "Kaynakları, depolama disklerinden depolama ağına yerleştirin.", + "gui.refinedstorage.disk_interface.transfer_mode.extract_from_network": "Ağdan çıkar", + "gui.refinedstorage.disk_interface.transfer_mode.extract_from_network.help": "Kaynakları, depolama ağından depolama disklerine yerleştirin.", + "item.refinedstorage.controller.help": "Depolama ağına enerji sağlar. Tek bir depolama ağında birden fazlasına izin verilir.", + "item.refinedstorage.creative_controller.help": "Depolama ağına sonsuz enerji sağlar.", + "item.refinedstorage.disk_drive.help": "Depolama ağına, depolama alanı sağlamak için depolama disklerini kabul eder.", + "item.refinedstorage.disk_interface.help": "Kaynakları, depolama ağı ve sağlanan depolama diskleri arasında aktarır.", + "item.refinedstorage.grid.help": "Depolama ağı ile etkileşime girmeye izin verir.", + "item.refinedstorage.crafting_grid.help": "Üretim yetenekleri ile depolama ağına etkileşime izin verir.", + "item.refinedstorage.importer.help": "Kaynakları, harici bir kaynaktan depolama ağına aktarır.", + "item.refinedstorage.exporter.help": "Kaynakları, depolama ağından harici bir hedefe aktarır.", + "item.refinedstorage.interface.help": "İçe Aktarıcı ve Dışarıya Aktarıcı'nın birleşimi olarak davranır.", + "item.refinedstorage.external_storage.help": "Depolama ağına harici bir kaynaktan depolama alanı sağlar.", + "item.refinedstorage.detector.help": "Eğer depolama ağı verilen miktarın üstünde, altında veya eşit bir kaynak içeriyorsa bir redstone sinyali yayar.", + "item.refinedstorage.constructor.help": "Depolama ağındaki blokları dünyaya yerleştirir.", + "item.refinedstorage.destructor.help": "Dünyadaki blokları yok eder ve depolama ağına yerleştirir.", + "item.refinedstorage.relay.help": "Bir depolama ağının tüm bölümlerini açın veya kapatın ve ağınızın yeni dallarını oluşturun.", + "item.refinedstorage.quartz_enriched_iron": "Kuvarsla Zenginleştirilmiş Demir", + "item.refinedstorage.quartz_enriched_copper": "Kuvarsla Zenginleştirilmiş Bakır", + "item.refinedstorage.processor_binding": "İşlemci Bağlayıcısı", + "item.refinedstorage.silicon": "Silikon", + "item.refinedstorage.raw_basic_processor": "Ham Temel İşlemci", + "item.refinedstorage.raw_improved_processor": "Ham İyileştirilmiş İşlemci", + "item.refinedstorage.raw_advanced_processor": "Ham Gelişmiş İşlemci", + "item.refinedstorage.basic_processor": "Temel İşlemci", + "item.refinedstorage.improved_processor": "İyileştirilmiş İşlemci", + "item.refinedstorage.advanced_processor": "Gelişmiş İşlemci", + "item.refinedstorage.1k_storage_part": "1K Depolama Parçası", + "item.refinedstorage.4k_storage_part": "4K Depolama Parçası", + "item.refinedstorage.16k_storage_part": "16K Depolama Parçası", + "item.refinedstorage.64k_storage_part": "64K Depolama Parçası", + "item.refinedstorage.1k_storage_disk": "1K Depolama Diski", + "item.refinedstorage.4k_storage_disk": "4K Depolama Diski", + "item.refinedstorage.16k_storage_disk": "16K Depolama Diski", + "item.refinedstorage.64k_storage_disk": "64K Depolama Diski", + "item.refinedstorage.storage_disk.help": "%s eşya depolar.", + "item.refinedstorage.storage_block.help": "%s eşya depolar.", + "item.refinedstorage.creative_storage_disk": "Yaratıcı Mod Depolama Diski", + "item.refinedstorage.creative_storage_disk.help": "Sonsuz miktarda eşya depolar.", + "item.refinedstorage.creative_storage_block.help": "Sonsuz miktarda eşya depolar.", + "item.refinedstorage.64b_fluid_storage_part": "64B Akışkan Depolama Parçası", + "item.refinedstorage.256b_fluid_storage_part": "256B Akışkan Depolama Parçası", + "item.refinedstorage.1024b_fluid_storage_part": "1024B Akışkan Depolama Parçası", + "item.refinedstorage.4096b_fluid_storage_part": "4096B Akışkan Depolama Parçası", + "item.refinedstorage.64b_fluid_storage_disk": "64B Akışkan Depolama Diski", + "item.refinedstorage.256b_fluid_storage_disk": "256B Akışkan Depolama Diski", + "item.refinedstorage.1024b_fluid_storage_disk": "1024B Akışkan Depolama Diski", + "item.refinedstorage.4096b_fluid_storage_disk": "4096B Akışkan Depolama Diski", + "item.refinedstorage.fluid_storage_disk.help": "%s kova depolar.", + "item.refinedstorage.fluid_storage_block.help": "%s kova depolar.", + "item.refinedstorage.creative_fluid_storage_disk": "Yaratıcı Mod Akışkan Depolama Diski", + "item.refinedstorage.creative_fluid_storage_disk.help": "Sonsuz miktarda kova depolar.", + "item.refinedstorage.creative_fluid_storage_block.help": "Sonsuz miktarda kova depolar.", + "item.refinedstorage.storage_housing": "Depolama Muhafazası", + "item.refinedstorage.construction_core": "Yapım Çekirdeği", + "item.refinedstorage.destruction_core": "Yıkım Çekirdeği", + "item.refinedstorage.wrench": "Anahtar", + "item.refinedstorage.wrench.help": "Blokları döndürmek için kullanın veya SHIFT'e basın ve Refined Storage bloklarını sökmek için kullanın.", + "item.refinedstorage.upgrade": "Yükseltme", + "item.refinedstorage.speed_upgrade": "Hız Yükseltmesi", + "item.refinedstorage.speed_upgrade.help": "Depolama ağı cihazının çalışma hızını artırır.", + "item.refinedstorage.stack_upgrade": "Yığın Yükseltmesi", + "item.refinedstorage.stack_upgrade.help": "Depolama ağı cihazının işlem başına işlediği kaynak miktarını artırır.", + "item.refinedstorage.silk_touch_upgrade": "İpeksi Dokunuş Yükseltmesi", + "item.refinedstorage.silk_touch_upgrade.help": "Kazmadaki İpeksi Dokunuş büyüsü gibi davranır.", + "item.refinedstorage.fortune_upgrade.1": "Servet I Yükseltmesi", + "item.refinedstorage.fortune_upgrade.2": "Servet II Yükseltmesi", + "item.refinedstorage.fortune_upgrade.3": "Servet III Yükseltmesi", + "item.refinedstorage.fortune_upgrade.help": "Bir bloğu kırarken daha fazla kaynak sağlar. Kazmadaki Servet büyüsü gibi davranır.", + "item.refinedstorage.regulator_upgrade": "Regülatör Yükseltmesi", + "item.refinedstorage.regulator_upgrade.help": "Dışarıya Aktarıcıda, yalnızca hedefteki miktar yükseltmede yapılandırılandan daha azsa dışarıya aktarır. İçe Aktarıcıda, yalnızca hedefteki miktar yükseltmede yapılandırılandan fazlaysa içe aktarır. Ayarlamak için eşyayı kullanın.", + "item.refinedstorage.range_upgrade": "Menzil Yükseltmesi", + "item.refinedstorage.range_upgrade.help": "Kablosuz Vericinin menzilini artırır.", + "item.refinedstorage.creative_range_upgrade": "Yaratıcı Mod Menzil Yükseltmesi", + "item.refinedstorage.creative_range_upgrade.help": "Kablosuz Verici için sonsuz menzil sağlar. Boyutlar arasında çalışmaz.", + "item.refinedstorage.wireless_grid": "Kablosuz Terminal", + "item.refinedstorage.creative_wireless_grid": "Yaratıcı Mod Kablosuz Terminal", + "item.refinedstorage.wireless_transmitter.help": "Kablosuz Terminal gibi eşyalar için kablosuz ağ erişimi sağlar. Daha geniş kapsama alanı için bir alanda birden fazlasına izin verilir.", + "item.refinedstorage.network_item.unbound": "Bağlanmamış.", + "item.refinedstorage.network_item.unbound.help": "Bağlamak için herhangi bir depolama ağı cihazında kullanın.", + "item.refinedstorage.network_item.bound_to": "%d, %d, %d konumuna bağlı.", + "item.refinedstorage.network_item.cannot_open_with_shortcut_due_to_duplicate": "Envanterinizde birden fazla %s var.", + "item.refinedstorage.network_item.cannot_open_because_not_found": "Envanterinizde hiç %s yok.", + "item.refinedstorage.configuration_card": "Yapılandırma Kartı", + "item.refinedstorage.configuration_card.empty": "Boş.", + "item.refinedstorage.configuration_card.configured": "%s için yapılandırma içeriyor.", + "item.refinedstorage.configuration_card.copied_configuration": "%s için yapılandırma kopyalandı.", + "item.refinedstorage.configuration_card.cleared_configuration": "Yapılandırma temizlendi.", + "item.refinedstorage.configuration_card.cannot_apply_configuration": "Yapılandırma kartı farklı türdeki cihazlara uygulanamıyor. %s için yapılandırılmış.", + "item.refinedstorage.configuration_card.applied_configuration": "Uygulanan yapılandırma.", + "item.refinedstorage.configuration_card.empty_help": "Yapılandırmasını ve yükseltmelerini karta kopyalamak için çömelip bir depolama ağı cihazında kullanın.", + "item.refinedstorage.configuration_card.configured_help": "Yapılandırmayı ve yükseltmeleri aktarmak için çömelirken hedef depolama ağı cihazında kullanın. Temizlemek için çömelirken kullanın.", + "item.refinedstorage.network_card": "Ağ Kartı", + "item.refinedstorage.network_card.unbound_help": "Ağ Alıcısına, çömelirken kullanın.", + "item.refinedstorage.network_card.unbound": "Bağlanmamış.", + "item.refinedstorage.network_card.bound_help": "Ağ Vericisine yerleştirin. Bağlamayı temizlemek için çömelirken kullanın.", + "item.refinedstorage.network_card.bound": "%s boyutunda %d, %d, %d konumuna bağlanıldı.", + "item.refinedstorage.network_transmitter.help": "Bir ağ sinyalini kablosuz olarak iletir. Ağ Alıcısı ile eşleştirilmiş Ağ Kartı gerekir.", + "item.refinedstorage.network_receiver.help": "Ağ sinyalini kablosuz olarak alır. Bu bloğa bir Ağ Kartı bağlayın.", + "item.refinedstorage.cable.help": "Depolama ağı cihazlarını birbirine bağlar.", + "item.refinedstorage.security_card": "Güvenlik Kartı", + "item.refinedstorage.security_card.cleared_configuration": "Yapılandırma temizlendi.", + "item.refinedstorage.security_card.unbound": "Bağlanmamış.", + "item.refinedstorage.security_card.unbound.help": "Mevcut oyuncuya yapılandırmak ve bağlamak için sağ tıklayın.", + "item.refinedstorage.security_card.bound": "%s adlı oyuncuya bağlı.", + "item.refinedstorage.security_card.bound.help": "Ayarlamak için sağ tıklayın. Yapılandırmayı ve bağlamayı temizlemek için çömelirken kullanın.", + "item.refinedstorage.fallback_security_card": "Yedek Güvenlik Kartı", + "item.refinedstorage.fallback_security_card.help": "Bir oyuncu için eşleşen bir Güvenlik Kartı bulunamazsa yedek olarak görev yapar. Yapılandırmak için sağ tıklayın. Yapılandırmayı temizlemek için çömelirken kullanın.", + "item.refinedstorage.portable_grid.help": "Bir depolama ağına bağlı değilken bir depolama diski ile etkileşime girmeye izin verir. Dünyada bir blok olarak veya envanterinizden kullanılabilir.", + "item.refinedstorage.storage_monitor.help": "Depolama ağınızdaki belirli bir kaynağın mevcut miktarını gösteren bir blok. Yapılandırmak için SHIFT + sağ tıklayın. Bir yığını çıkarmak için sol tıklayın, tek bir kaynağı çıkarmak için SHIFT + sol tıklayın, bir kaynağı eklemek için sağ tıklayın, kaynakları toplu olarak eklemek için birden çok kez sağ tıklayın.", + "misc.refinedstorage.stored": "Depolanmış: %s", + "misc.refinedstorage.stored_with_capacity": "Depolanmış: %s / %s (%d%%)", + "misc.refinedstorage.total": "Toplam %d", + "misc.refinedstorage.last_modified.just_now": "Son değişiklik %s tarafından yapıldı", + "misc.refinedstorage.last_modified.second": "Son değişiklik %d saniye önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.seconds": "Son değişiklik %d saniye önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.minute": "Son değişiklik %d dakika önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.minutes": "Son değişiklik %d dakika önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.hour": "Son değişiklik %d saat önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.hours": "Son değişiklik %d saat önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.day": "Son değişiklik %d gün önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.days": "Son değişiklik %d gün önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.week": "Son değişiklik %d hafta önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.weeks": "Son değişiklik %d hafta önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.year": "Son değişiklik %d yıl önce %s tarafından yapıldı", + "misc.refinedstorage.last_modified.years": "Son değişiklik %d yıl önce %s tarafından yapıldı", + "misc.refinedstorage.resource_type.item": "Eşya", + "misc.refinedstorage.resource_type.fluid": "Akışkan", + "misc.refinedstorage.press_shift_for_help": "Yardım için SHIFT'e basın", + "misc.refinedstorage.no_permission": "İzin yok", + "misc.refinedstorage.no_permission.open": "%s açmanıza izin verilmiyor.", + "misc.refinedstorage.no_permission.insert": "Eklemenize izin verilmiyor.", + "misc.refinedstorage.no_permission.extract": "Çıkarmanıza izin verilmiyor.", + "misc.refinedstorage.no_permission.build.place": "Buraya %s yerleştirmenize izin verilmiyor.", + "misc.refinedstorage.no_permission.build.break": "%s kırmanıza izin verilmiyor.", + "misc.refinedstorage.no_permission.build.rotate": "%s döndürmenize izin verilmiyor.", + "misc.refinedstorage.no_permission.build.dismantle": "%s sökmenize izin verilmiyor.", + "key.refinedstorage.focus_search_bar": "Arama çubuğuna odaklan", + "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Üretim Terminali matriksini, ağa temizle", + "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Üretim Terminali matriksini, envantere temizle", + "key.refinedstorage.open_wireless_grid": "Kablosuz Terminali Aç", + "key.refinedstorage.open_portable_grid": "Taşınabilir Terminali Aç", + "refinedstorage.subtitle.wrench": "Anahtar kullanıldı", + "permission.refinedstorage.insert": "Ekle", + "permission.refinedstorage.insert.description": "Oyuncunun bir ağa kaynak ekleyip ekleyemeyeceği.", + "permission.refinedstorage.extract": "Çıkart", + "permission.refinedstorage.extract.description": "Oyuncunun bir ağdan kaynak çıkarıp çıkaramayacağı.", + "permission.refinedstorage.autocrafting": "Otomatik Üretim", + "permission.refinedstorage.autocrafting.description": "Oyuncunun bir otomatik oluşturma görevini başlatıp başlatamayacağı, iptal edip edemeyeceği veya görüntüleyip görüntüleyemeyeceği.", + "permission.refinedstorage.open": "Aç", + "permission.refinedstorage.open.description": "Oyuncunun ağ cihazı GUI'lerini açıp açamayacağı.", + "permission.refinedstorage.build": "İnşa", + "permission.refinedstorage.build.description": "Oyuncunun ağ cihazları ekleyip ekleyemeyeceği.", + "permission.refinedstorage.security": "Güvenlik", + "permission.refinedstorage.security.description": "Oyuncunun bir ağ için güvenlik seçeneklerini yönetip yönetemeyeceği.", + "tag.item.refinedstorage.cables": "Kablolar", + "tag.item.refinedstorage.constructors": "Yapıcılar", + "tag.item.refinedstorage.controllers": "Denetleyiciler", + "tag.item.refinedstorage.crafting_grids": "Üretim Terminalleri", + "tag.item.refinedstorage.creative_controllers": "Yaratıcı Mod Denetleyicileri", + "tag.item.refinedstorage.destructors": "Yıkıcılar", + "tag.item.refinedstorage.detectors": "Dedektörler", + "tag.item.refinedstorage.exporters": "Dışarıya Aktarıcılar", + "tag.item.refinedstorage.external_storages": "Harici Depolar", + "tag.item.refinedstorage.fluid_storage_disks": "Akışkan Depolama Diskleri", + "tag.item.refinedstorage.grids": "Terminaller", + "tag.item.refinedstorage.importers": "İçe Aktarıcılar", + "tag.item.refinedstorage.network_receivers": "Ağ Alıcıları", + "tag.item.refinedstorage.network_transmitters": "Ağ Vericileri", + "tag.item.refinedstorage.relays": "Röleler", + "tag.item.refinedstorage.security_managers": "Güvenlik Yöneticileri", + "tag.item.refinedstorage.storage_disks": "Depolama Diskileri", + "tag.item.refinedstorage.wireless_transmitters": "Kablosuz Vericiler", + "tag.item.refinedstorage.disk_interfaces": "Disk Arayüzleri", + "text.autoconfig.refinedstorage.title": "Refined Storage Yapılandırması", + "refinedstorage.configuration.title": "Refined Storage Yapılandırması", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Yapılandırması", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Yapılandırması", + "text.autoconfig.refinedstorage.option.smoothScrolling": "Yumuşak kaydırma", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Kaydırma çubuklarının yumuşak kaydırmayı kullanıp kullanmayacağı.", + "text.autoconfig.refinedstorage.option.screenSize": "Ekran boyutu", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "Ekran boyutu.", + "text.autoconfig.refinedstorage.option.maxRowsStretch": "Ekran boyutu esnetildiğinde en fazla satır miktarı", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "Ekran boyutu esnetildiğinde görüntülenebilecek maksimum satır miktarı.", + "text.autoconfig.refinedstorage.option.grid": "Terminal", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Terminal için yapılandırma.", + "text.autoconfig.refinedstorage.option.grid.largeFont": "Büyük yazı tipi", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Terminalin miktarlar için büyük bir yazı tipi kullanması gerekip gerekmediği.", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "SHIFT tuşu basılıyken sıralamayı önleme", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Shift basılı tutulduğunda Terminalin sıralamadan kaçınması gerekip gerekmediği.", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detaylı alet ipucusu", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Terminalin ayrıntılı bir alet ipucusu göstermesi gerekip gerekmediği.", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Arama sorgusunu hatırla", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Terminalin kapatılıp yeniden açıldığında arama sorgusunun korunup korunmayacağı.", + "text.autoconfig.refinedstorage.option.grid.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "Terminal tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.grid.autoSelected": "Otomatik seçilen arama kutusu", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Terminal açılırken arama kutusunun otomatik olarak seçilip seçilmeyeceği.", + "text.autoconfig.refinedstorage.option.grid.synchronizer": "Eşitleyici", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "Terminalin arama kutusunun senkronizasyon türü.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Kaynak türü", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "Gösterilecek kaynak türü.", + "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sıralama yönü", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "Sıralama yönü.", + "text.autoconfig.refinedstorage.option.grid.sortingType": "Sıralama türü", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "Sıralama türü.", + "text.autoconfig.refinedstorage.option.craftingGrid": "Üretim Terminali", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Üretim Terminali için yapılandırma.", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "Üretim Terminali tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Üretim matrisi, kapanma davranışı", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "Üretim Terminalini kapatırken, üretim matrisi yuvalarına ne olduğu.", + "text.autoconfig.refinedstorage.option.controller": "Denetleyici", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Denetleyici için yapılandırma.", + "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Enerji kapasitesi", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "Denetleyicinin enerji kapasitesi.", + "text.autoconfig.refinedstorage.option.cable": "Kablo", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Kablo için yapılandırma.", + "text.autoconfig.refinedstorage.option.cable.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "Kablo tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.diskDrive": "Disk Sürücüsü", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Disk Sürücüsü için yapılandırma.", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "Disk Sürücüsü tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Disk başına enerji kullanımı", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "Disk başına kullanılan enerji.", + "text.autoconfig.refinedstorage.option.diskInterface": "Disk Arayüzü", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Disk Arayüzü için yapılandırma.", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "Disk Arayüzü tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Disk başına enerji kullanımı", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "Disk başına kullanılan enerji.", + "text.autoconfig.refinedstorage.option.storageBlock": "Depolama Bloğu", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Depolama Blokları için yapılandırma.", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K enerji kullanımı", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "1K Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K enerji kullanımı", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "4K Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K enerji kullanımı", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "16K Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K enerji kullanımı", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "64K Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Yaratıcı Mod enerji kullanımı", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "Yaratıcı Mod Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Akışkan Depolama Bloğu", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Akışkan Depolama Blokları için Yapılandırma.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B enerji kullanımı", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "64B Akışkan Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B enerji kullanımı", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "256B Akışkan Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B enerji kullanımı", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "1024B Akışkan Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B enerji kullanımı", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "4096B Akışkan Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Yaratıcı Mod enerji kullanımı", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "Yaratıcı Mod Akışkan Depolama Bloğu tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.importer": "İçe Aktarıcı", + "text.autoconfig.refinedstorage.option.importer.tooltip": "İçe Aktarıcı için yapılandırma.", + "text.autoconfig.refinedstorage.option.importer.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "İçe Aktarıcı tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.exporter": "Dışarıya Aktarıcı", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Dışarıya Aktarıcı için yapılandırma.", + "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "Dışarıya Aktarıcı tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.detector": "Dedektör", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Dedektör için yapılandırma.", + "text.autoconfig.refinedstorage.option.detector.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "Dedektör tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.constructor": "Yapıcı", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Yapıcı için yapılandırma.", + "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "Yapıcı tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.destructor": "Yıkıcı", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Yıkıcı için yapılandırma.", + "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "Yıkıcı tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.upgrade": "Yükseltme", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Yükseltmeler için yapılandırma.", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Hız Yükseltmesi enerji kullanımı", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "Hız Yükseltmesi başına kullanılan ek enerji.", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Yığın Yükseltmesi enerji kullanımı", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "Yığın Yükseltmesi tarafından kullanılan ek enerji.", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Servet 1 Yükseltme enerji kullanımı", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "Servet 1 Yükseltmesi tarafından kullanılan ek enerji.", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Servet 2 Yükseltme enerji kullanımı", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "Servet 2 Yükseltmesi tarafından kullanılan ek enerji.", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Servet 3 Yükseltme enerji kullanımı", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "Servet 3 Yükseltmesi tarafından kullanılan ek enerji.", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "İpeksi Dokunuş Yükseltmesi enerji kullanımı", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "İpeksi Dokunuş Yükseltmesi tarafından kullanılan ek enerji.", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regülatör Yükseltmesi enerji kullanımı", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "Regülatör Yükseltmesi tarafından kullanılan ek enerji.", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Menzil Yükseltmesi enerji kullanımı", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "Menzil Yükseltmesi başına kullanılan ek enerji.", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Yaratıcı Mod Menzil Yükseltmesi enerji kullanımı", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "Yaratıcı Mod Menzil Yükseltmesi tarafından kullanılan ek enerji.", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Menzil Yükseltmesi menzili", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "Menzil Yükseltmesi tarafından sağlanan ek menzil.", + "text.autoconfig.refinedstorage.option.iface": "Arayüz", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Arayüz için yapılandırma.", + "text.autoconfig.refinedstorage.option.iface.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "Arayüz tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.externalStorage": "Harici Depo", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Harici Depo için yapılandırma.", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "Harici Depo tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.wirelessGrid": "Kablosuz Terminal", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Kablosuz Terminal için yapılandırma.", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Enerji kapasitesi", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "Kablosuz Terminalin enerji kapasitesi.", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Aç enerji kullanımını", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "Kablosuz Terminal tarafından açılmak için kullanılan enerji.", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Yerleştir enerji kullanımını", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "Kablosuz Terminal tarafından kaynakları yerleştirmek için kullanılan enerji.", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Çıkart enerji kullanımını", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "Kablosuz Terminal tarafından kaynakları çıkarmak için kullanılan enerji.", + "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Kablosuz Verici", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Kablosuz Verici için yapılandırma.", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "Kablosuz Verici tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Temel menzil", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "Kablosuz Vericinin temel menzili.", + "text.autoconfig.refinedstorage.option.storageMonitor": "Depolama Monitörü", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Depolama Monitörü için yapılandırma.", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "Depolama Monitörü tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.networkReceiver": "Ağ Alıcısı", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Ağ Alıcısı için yapılandırma.", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "Ağ Alıcısı tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.networkTransmitter": "Ağ Vericisi", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Ağ Vericisi için yapılandırma.", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "Ağ Vericisi tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.portableGrid": "Taşınabilir Terminal", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Taşınabilir Terminal için yapılandırma.", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Enerji kapasitesi", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "Taşınabilir Terminalin enerji kapasitesi.", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Aç enerji kullanımı", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "Taşınabilir Terminal tarafından açılmak için kullanılan enerji.", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Yerleştir enerji kullanımı", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "Taşınabilir Terminal tarafından kaynakları yerleştirmek için kullanılan enerji.", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Çıkart enerji kullanımı", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "Taşınabilir Terminal tarafından kaynakları çıkarmak için kullanılan enerji.", + "text.autoconfig.refinedstorage.option.securityCard": "Güvenlik Kartı", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Güvenlik Kartı için yapılandırma.", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "Güvenlik Kartı tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Yedek Güvenlik Kartı", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Yedek Güvenlik Kartı için yapılandırma.", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "Yedek Güvenlik Kartı tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.securityManager": "Güvenlik Yöneticisi", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Güvenlik Yöneticisi için yapılandırma.", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Enerji kullanımı", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "Güvenlik Yöneticisi tarafından kullanılan enerji.", + "text.autoconfig.refinedstorage.option.relay": "Röle", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Röle için yapılandırma.", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Giriş ağı enerji kullanımı", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Giriş ağı enerji kullanımı.", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Çıkış ağı enerji kullanımı (doğrudan geçiş modunda değilse)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Çıkış ağı enerji kullanımı (doğrudan geçiş modunda değilse).", + "advancements.refinedstorage.root.description": "Ağınıza enerji sağlamak için bir depolama ağında bir veya birden fazla Denetleyici kullanın", + "advancements.refinedstorage.connecting": "Bağlanıyor", + "advancements.refinedstorage.connecting.description": "Cihazları birbirlerine bağlamak veya cihazları birbirlerine doğru yerleştirmek için Kablo kullanın", + "advancements.refinedstorage.drives": "Sürücüler", + "advancements.refinedstorage.drives.description": "Depolama disklerinizi saklayabilmek için bir Disk Sürücüsü oluşturun", + "advancements.refinedstorage.interfacing_with_disks": "Disklerle arayüz oluşturma", + "advancements.refinedstorage.interfacing_with_disks.description": "Kaynakları depolama ağı ve depolama diskleri arasında aktarmak için bir Disk Arayüzü oluşturun", + "advancements.refinedstorage.storing_items": "Eşyaların saklanması", + "advancements.refinedstorage.storing_items.description": "Bir Depolama Diski oluşturun ve Disk Sürücünüze yerleştirin", + "advancements.refinedstorage.viewing_your_storage": "Deponuzu görüntüleme", + "advancements.refinedstorage.viewing_your_storage.description": "Deponuzla etkileşim kurmak için bir Terminal oluşturun", + "advancements.refinedstorage.upgrading_your_grid": "Terminalinizin Yükseltilmesi", + "advancements.refinedstorage.upgrading_your_grid.description": "Üretim yetenekleri elde etmek için Terminalinizi, Üretim Terminaline yükseltin", + "advancements.refinedstorage.storing_fluids": "Akışkanların depolanması", + "advancements.refinedstorage.storing_fluids.description": "Bir Akışkan Depolama Diski oluşturun ve Disk Sürücünüze yerleştirin", + "advancements.refinedstorage.importing": "İçe Aktarım", + "advancements.refinedstorage.importing.description": "İçe Aktarıcı ile kaynakları depolama ağına alın", + "advancements.refinedstorage.exporting": "Dışa Aktarım", + "advancements.refinedstorage.exporting.description": "Dışa Aktarıcı ile depolama ağından kaynakları çıkarın", + "advancements.refinedstorage.upgrading": "Yükseltme", + "advancements.refinedstorage.upgrading.description": "Çeşitli cihazları iyileştirmek için bir Yükseltme oluşturun", + "advancements.refinedstorage.interface_to_the_world": "Dünyayla Arayüz", + "advancements.refinedstorage.interface_to_the_world.description": "Arayüz ile öğeleri aynı anda dışa ve içe aktarın", + "advancements.refinedstorage.storing_externally": "Harici olarak depolama", + "advancements.refinedstorage.storing_externally.description": "Ağa sandık gibi harici bir bloktan depolama alanı sağlamak için Harici Depo kullanın", + "advancements.refinedstorage.detecting": "Tespit", + "advancements.refinedstorage.detecting.description": "Depolama ağında depolanan kaynakları kontrol etmek için redstone kullanın", + "advancements.refinedstorage.construction": "Yapım", + "advancements.refinedstorage.construction.description": "Yapıcı ile blokları depolama ağından dünyaya taşıyın", + "advancements.refinedstorage.destruction": "Yıkım", + "advancements.refinedstorage.destruction.description": "Yıkıcı ile dünyadaki blokları depolama ağına aktarın", + "advancements.refinedstorage.wireless": "Kablosuz", + "advancements.refinedstorage.wireless.description": "Kablosuz Terminal ile kaynaklarınıza kablosuz olarak erişin", + "advancements.refinedstorage.better_than_a_barrel": "Varilden daha iyi", + "advancements.refinedstorage.better_than_a_barrel.description": "Bir depolama ağındaki kaynakları görüntülemek, eklemek veya çıkarmak için bir Depolama Monitörü oluşturun", + "advancements.refinedstorage.no_cables_required": "Kablo gerekli değil", + "advancements.refinedstorage.no_cables_required.description": "Ağ Vericisi, Ağ Alıcısı ve Ağ Kartı kullanarak kablo kullanmadan depolama ağınıza ekstra bileşenler ekleyin", + "advancements.refinedstorage.portable_storage": "Taşınabilir depo", + "advancements.refinedstorage.portable_storage.description": "Depolama ağı gerektirmeden disklerin içeriğine erişmek için bir Taşınabilir Terminal oluşturun", + "advancements.refinedstorage.security": "Güvenlik", + "advancements.refinedstorage.security.description": "Depolama ağınızı bir Güvenlik Yöneticisi ve Güvenlik Kartı ile güvence altına alın", + "advancements.refinedstorage.conditional_connecting": "Koşullu bağlantı", + "advancements.refinedstorage.conditional_connecting.description": "Bir depolama ağının tüm bölümlerini açın veya kapatın ve bir Röle ile ağınızın yeni dallarını oluşturun" +} diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/zh_cn.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/zh_cn.json similarity index 77% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/zh_cn.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/zh_cn.json index b5424ef88..c585ecc29 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/zh_cn.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/zh_cn.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "清除合成终端矩阵到网络", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "清除合成终端矩阵到库存", "key.refinedstorage.open_wireless_grid": "打开无线终端", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "使用扳手", "permission.refinedstorage.insert": "存入", "permission.refinedstorage.insert.description": "玩家是否可以向存储网络中存入资源", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "精致存储 2", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "平滑滚动", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "界面大小", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "截面尺寸拉伸时的最大显示行数", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "终端", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "大字体", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "按住 SHIFT 时阻止排序", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "详细提示", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "记住搜索查询", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "自动选择搜索框", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "同步器", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "存储通道类型", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "排序方向", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "排序类型", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "合成终端", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "合成矩阵关闭行为", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "控制器", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "能量容量", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "电缆", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "磁盘驱动器", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "每个磁盘的耗能", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "存储方块", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K 能源", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K 能源", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K 能源", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K 能源", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "创造能源", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "流体存储块", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B 能源", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B 能源", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B 能源", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B 能源", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "创造能源", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "输入总线", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "输出总线", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "检测器", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "成型面板", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "破坏面板", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "升级", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "速度升级耗能", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "堆叠升级耗能", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "时运 I 升级耗能", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "时运 II 升级耗能", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "时运 III 升级耗能", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "精准采集升级耗能", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "调节器升级耗能", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "范围升级耗能", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "创造范围升级耗能", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "范围升级范围", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "物品传输接口", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "外部存储", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "无线网格", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "能量容量", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "打开耗能", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "插入耗能", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "取出耗能", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "无线访问点", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "基础范围", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "存储监控器", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "网络接收器", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "网络发送器", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "便携式终端", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "能量容量", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "打开耗能", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "插入耗能", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "取出耗能", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "权限卡", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "后备权限卡", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "权限管理器", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "耗能", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "中继器", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "输入网络耗能", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "在网络中使用一个或多个控制器为其提供能量", "advancements.refinedstorage.connecting": "连接", "advancements.refinedstorage.connecting.description": "使用电缆将设备连接在一起,或放置时使设备贴在一起", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/zh_tw.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/zh_tw.json similarity index 78% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/zh_tw.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/lang/zh_tw.json index f08f87e3b..adf9fc563 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/zh_tw.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/zh_tw.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Wrench used", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", @@ -334,99 +335,194 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", + "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", + "refinedstorage.configuration.title": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", + "refinedstorage.configuration.section.refinedstorage.common.toml.title": "Refined Storage Configuration", "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", + "text.autoconfig.refinedstorage.option.smoothScrolling.tooltip": "Whether scrollbars should use smooth scrolling.", "text.autoconfig.refinedstorage.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage.option.screenSize.tooltip": "The screen size.", "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage.option.maxRowsStretch.tooltip": "The maximum amount of rows that can be displayed when the screen size is stretched.", "text.autoconfig.refinedstorage.option.grid": "Grid", + "text.autoconfig.refinedstorage.option.grid.tooltip": "Configuration for the Grid.", "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", + "text.autoconfig.refinedstorage.option.grid.largeFont.tooltip": "Whether the Grid should use a large font for quantities.", "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", + "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown.tooltip": "Whether the Grid should avoid sorting when shift is held down.", "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", + "text.autoconfig.refinedstorage.option.grid.detailedTooltip.tooltip": "Whether the Grid should show a detailed tooltip.", "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", + "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery.tooltip": "Whether the search query should persist when closing and re-opening the Grid.", "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.grid.energyUsage.tooltip": "The energy used by the Grid.", "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", + "text.autoconfig.refinedstorage.option.grid.autoSelected.tooltip": "Whether the search box should be auto-selected when opening the Grid.", "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", + "text.autoconfig.refinedstorage.option.grid.synchronizer.tooltip": "The synchronization type of the Grid search box.", + "text.autoconfig.refinedstorage.option.grid.resourceType": "Resource type", + "text.autoconfig.refinedstorage.option.grid.resourceType.tooltip": "The resource type to be shown.", "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", + "text.autoconfig.refinedstorage.option.grid.sortingDirection.tooltip": "The sorting direction.", "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage.option.grid.sortingType.tooltip": "The sorting type.", "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", + "text.autoconfig.refinedstorage.option.craftingGrid.tooltip": "Configuration for the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage.tooltip": "The energy used by the Crafting Grid.", "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", + "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior.tooltip": "What should happen to the crafting matrix slots when closing the Crafting Grid.", "text.autoconfig.refinedstorage.option.controller": "Controller", + "text.autoconfig.refinedstorage.option.controller.tooltip": "Configuration for the Controller.", "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.controller.energyCapacity.tooltip": "The energy capacity of the Controller.", "text.autoconfig.refinedstorage.option.cable": "Cable", + "text.autoconfig.refinedstorage.option.cable.tooltip": "Configuration for the Cable.", "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.cable.energyUsage.tooltip": "The energy used by the Cable.", "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", + "text.autoconfig.refinedstorage.option.diskDrive.tooltip": "Configuration for the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsage.tooltip": "The energy used by the Disk Drive.", "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", + "text.autoconfig.refinedstorage.option.diskInterface.tooltip": "Configuration for the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsage.tooltip": "The energy used by the Disk Interface.", "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", + "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk.tooltip": "The energy used per disk.", "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", + "text.autoconfig.refinedstorage.option.storageBlock.tooltip": "Configuration for the Storage Blocks.", "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage.tooltip": "The energy used by the 1K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage.tooltip": "The energy used by the 4K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage.tooltip": "The energy used by the 16K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage.tooltip": "The energy used by the 64K Storage Block.", "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.tooltip": "Configuration for the Fluid Storage Blocks.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage.tooltip": "The energy used by the 64B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage.tooltip": "The energy used by the 256B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage.tooltip": "The energy used by the 1024B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage.tooltip": "The energy used by the 4096B Fluid Storage Block.", "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage.tooltip": "The energy used by the Creative Fluid Storage Block.", "text.autoconfig.refinedstorage.option.importer": "Importer", + "text.autoconfig.refinedstorage.option.importer.tooltip": "Configuration for the Importer.", "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.importer.energyUsage.tooltip": "The energy used by the Importer.", "text.autoconfig.refinedstorage.option.exporter": "Exporter", + "text.autoconfig.refinedstorage.option.exporter.tooltip": "Configuration for the Exporter.", "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.exporter.energyUsage.tooltip": "The energy used by the Exporter.", "text.autoconfig.refinedstorage.option.detector": "Detector", + "text.autoconfig.refinedstorage.option.detector.tooltip": "Configuration for the Detector.", "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.detector.energyUsage.tooltip": "The energy used by the Detector.", "text.autoconfig.refinedstorage.option.constructor": "Constructor", + "text.autoconfig.refinedstorage.option.constructor.tooltip": "Configuration for the Constructor.", "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.constructor.energyUsage.tooltip": "The energy used by the Constructor.", "text.autoconfig.refinedstorage.option.destructor": "Destructor", + "text.autoconfig.refinedstorage.option.destructor.tooltip": "Configuration for the Destructor.", "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.destructor.energyUsage.tooltip": "The energy used by the Destructor.", "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage.option.upgrade.tooltip": "Configuration for the Upgrades.", "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage.tooltip": "The additional energy used per Speed Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage.tooltip": "The additional energy used by the Stack Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 1 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 2 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage.tooltip": "The additional energy used by the Fortune 3 Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage.tooltip": "The additional energy used by the Silk Touch Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage.tooltip": "The additional energy used by the Regulator Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage.tooltip": "The additional energy used per Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage.tooltip": "The additional energy used by the Creative Range Upgrade.", "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", + "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange.tooltip": "The additional range provided by the Range Upgrade.", "text.autoconfig.refinedstorage.option.iface": "Interface", + "text.autoconfig.refinedstorage.option.iface.tooltip": "Configuration for the Interface.", "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.iface.energyUsage.tooltip": "The energy used by the Interface.", "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", + "text.autoconfig.refinedstorage.option.externalStorage.tooltip": "Configuration for the External Storage.", "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.externalStorage.energyUsage.tooltip": "The energy used by the External Storage.", "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", + "text.autoconfig.refinedstorage.option.wirelessGrid.tooltip": "Configuration for the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity.tooltip": "The energy capacity of the Wireless Grid.", "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage.tooltip": "The energy used by the Wireless Grid to open.", "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage.tooltip": "The energy used by the Wireless Grid to insert resources.", "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage.tooltip": "The energy used by the Wireless Grid to extract resources.", "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.tooltip": "Configuration for the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage.tooltip": "The energy used by the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange.tooltip": "The base range of the Wireless Transmitter.", "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", + "text.autoconfig.refinedstorage.option.storageMonitor.tooltip": "Configuration for the Storage Monitor.", "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage.tooltip": "The energy used by the Storage Monitor.", "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage.option.networkReceiver.tooltip": "Configuration for the Network Receiver.", "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage.tooltip": "The energy used by the Network Receiver.", "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", + "text.autoconfig.refinedstorage.option.networkTransmitter.tooltip": "Configuration for the Network Transmitter.", "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage.tooltip": "The energy used by the Network Transmitter.", "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", + "text.autoconfig.refinedstorage.option.portableGrid.tooltip": "Configuration for the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", + "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity.tooltip": "The energy capacity of the Portable Grid.", "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage.tooltip": "The energy used by the Portable Grid to open.", "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage.tooltip": "The energy used by the Portable Grid to insert resources.", "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage.tooltip": "The energy used by the Portable Grid to extract resources.", "text.autoconfig.refinedstorage.option.securityCard": "Security Card", + "text.autoconfig.refinedstorage.option.securityCard.tooltip": "Configuration for the Security Card.", "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityCard.energyUsage.tooltip": "The energy used by the Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.tooltip": "Configuration for the Fallback Security Card.", "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage.tooltip": "The energy used by the Fallback Security Card.", "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", + "text.autoconfig.refinedstorage.option.securityManager.tooltip": "Configuration for the Security Manager.", "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.securityManager.energyUsage.tooltip": "The energy used by the Security Manager.", "text.autoconfig.refinedstorage.option.relay": "Relay", + "text.autoconfig.refinedstorage.option.relay.tooltip": "Configuration for the Relay.", "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage.tooltip": "Input network energy usage.", "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage.tooltip": "Output network energy usage (if not in pass through mode).", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/1024b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/1024b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/1024b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/1024b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/16k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/16k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/16k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/16k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/1k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/1k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/1k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/1k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/256b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/256b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/256b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/256b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/4096b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/4096b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/4096b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/4096b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/4k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/4k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/4k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/4k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/64b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/64b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/64b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/64b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/64k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/64k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/64k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/64k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/all_cutout.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/all_cutout.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/all_cutout.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/all_cutout.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/cable/core/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/cable/core/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/cable/core/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/cable/core/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/cable/extension/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/cable/extension/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/cable/extension/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/cable/extension/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/constructor/active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/constructor/active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/constructor/active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/constructor/active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/constructor/inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/constructor/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/constructor/inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/constructor/inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/constructor_destructor/active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/constructor_destructor/active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/constructor_destructor/active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/constructor_destructor/active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/constructor_destructor/inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/constructor_destructor/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/constructor_destructor/inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/constructor_destructor/inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly_off.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly_off.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly_off.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly_off.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly_on.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly_on.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly_on.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/controller/nearly_on.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/controller/off.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/controller/off.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/controller/off.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/controller/off.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/creative_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/creative_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/creative_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/creative_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/creative_portable_grid.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/creative_portable_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/creative_portable_grid.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/creative_portable_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/creative_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/creative_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/creative_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/creative_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/cutout.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/cutout.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/cutout.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/cutout.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/destructor/active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/destructor/active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/destructor/active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/destructor/active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/destructor/inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/destructor/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/destructor/inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/destructor/inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/detector/powered.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/detector/powered.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/detector/powered.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/detector/powered.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/detector/unpowered.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/detector/unpowered.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/detector/unpowered.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/detector/unpowered.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/fluid_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/fluid_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/fluid_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/fluid_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json similarity index 94% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json index 49923d184..b2eba9f3c 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json @@ -1,5 +1,4 @@ { - "credit": "Made with Blockbench", "textures": { "base": "refinedstorage:block/disk/leds" }, diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json similarity index 94% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json index eb0650629..41ebfbe2a 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json @@ -1,5 +1,4 @@ { - "credit": "Made with Blockbench", "textures": { "base": "refinedstorage:block/disk/leds" }, diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_normal.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_normal.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_normal.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk/led_normal.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk_drive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk_drive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk_drive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk_drive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk_drive/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk_drive/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk_drive/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/disk_drive/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/emissive_all_cutout.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/emissive_all_cutout.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/emissive_all_cutout.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/emissive_all_cutout.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/emissive_cutout.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/emissive_cutout.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/emissive_cutout.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/emissive_cutout.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/emissive_north_cutout.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/emissive_north_cutout.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/emissive_north_cutout.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/emissive_north_cutout.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/exporter.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/exporter.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/exporter.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/exporter.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/external_storage.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/external_storage.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/external_storage.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/importer.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/importer.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/importer.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/importer.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/interface_active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/interface_active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/interface_active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/interface_active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/interface_inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/interface_inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/interface_inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/interface_inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/machine_casing.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/machine_casing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/machine_casing.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/machine_casing.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/north_cutout.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/north_cutout.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/north_cutout.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/north_cutout.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/portable_grid.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/portable_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/portable_grid.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/portable_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/portable_grid/inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/quartz_enriched_copper_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/quartz_enriched_copper_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/quartz_enriched_copper_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/quartz_enriched_copper_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/quartz_enriched_iron_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/quartz_enriched_iron_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/quartz_enriched_iron_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/quartz_enriched_iron_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/storage_monitor.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/storage_monitor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/storage_monitor.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/storage_monitor.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/wireless_transmitter/active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/wireless_transmitter/active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/wireless_transmitter/active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/wireless_transmitter/active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/wireless_transmitter/inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/wireless_transmitter/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/wireless_transmitter/inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/block/wireless_transmitter/inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_part.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_part.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1024b_fluid_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_part.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_part.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/16k_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_part.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_part.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/1k_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_part.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_part.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/256b_fluid_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_part.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_part.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4096b_fluid_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_part.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_part.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/4k_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_part.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_part.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64b_fluid_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_part.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_part.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/64k_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/advanced_processor.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/advanced_processor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/advanced_processor.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/advanced_processor.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/basic_processor.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/basic_processor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/basic_processor.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/basic_processor.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/book.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/book.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/book.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/book.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/cable/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/cable/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/cable/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/cable/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/configuration_card.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/configuration_card.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/configuration_card.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/configuration_card.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/configuration_card/active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/configuration_card/active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/configuration_card/active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/configuration_card/active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/configuration_card/inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/configuration_card/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/configuration_card/inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/configuration_card/inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/construction_core.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/construction_core.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/construction_core.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/construction_core.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/constructor/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/constructor/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/constructor/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/constructor/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_fluid_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_fluid_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_fluid_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_fluid_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_fluid_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_portable_grid.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_portable_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_portable_grid.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_portable_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_range_upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_range_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_range_upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_range_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_storage_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_storage_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_storage_disk.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_storage_disk.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_wireless_grid.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_wireless_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/creative_wireless_grid.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/creative_wireless_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/destruction_core.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/destruction_core.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/destruction_core.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/destruction_core.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/destructor/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/destructor/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/destructor/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/destructor/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/disk_drive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/disk_drive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/disk_drive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/disk_drive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/exporter/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/exporter/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/exporter/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/exporter/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/external_storage/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/external_storage/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/external_storage/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/external_storage/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/fallback_security_card.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/fallback_security_card.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/fallback_security_card.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/fallback_security_card.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/fortune_1_upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/fortune_1_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/fortune_1_upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/fortune_1_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/fortune_2_upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/fortune_2_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/fortune_2_upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/fortune_2_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/fortune_3_upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/fortune_3_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/fortune_3_upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/fortune_3_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/importer/base.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/importer/base.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/importer/base.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/importer/base.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/improved_processor.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/improved_processor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/improved_processor.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/improved_processor.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/interface.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/interface.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/interface.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/interface.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/machine_casing.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/machine_casing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/machine_casing.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/machine_casing.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/network_card.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/network_card.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/network_card.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/network_card.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/network_card/active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/network_card/active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/network_card/active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/network_card/active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/network_card/inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/network_card/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/network_card/inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/network_card/inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/portable_grid.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/portable_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/portable_grid.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/portable_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/processor_binding.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/processor_binding.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/processor_binding.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/processor_binding.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_copper.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_copper.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_copper.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_copper.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_copper_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_copper_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_copper_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_copper_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_iron.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_iron.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_iron.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_iron.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_iron_block.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_iron_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_iron_block.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/quartz_enriched_iron_block.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/range_upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/range_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/range_upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/range_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/raw_advanced_processor.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/raw_advanced_processor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/raw_advanced_processor.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/raw_advanced_processor.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/raw_basic_processor.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/raw_basic_processor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/raw_basic_processor.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/raw_basic_processor.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/raw_improved_processor.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/raw_improved_processor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/raw_improved_processor.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/raw_improved_processor.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/regulator_upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/regulator_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/regulator_upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/regulator_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/security_card.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/security_card.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/security_card.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/security_card.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/security_card/active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/security_card/active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/security_card/active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/security_card/active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/security_card/inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/security_card/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/security_card/inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/security_card/inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/silicon.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/silicon.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/silicon.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/silicon.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/silk_touch_upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/silk_touch_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/silk_touch_upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/silk_touch_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/speed_upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/speed_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/speed_upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/speed_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/stack_upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/stack_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/stack_upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/stack_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/storage_housing.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/storage_housing.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/storage_monitor.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/storage_monitor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/storage_monitor.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/storage_monitor.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/upgrade.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/upgrade.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid/active.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid/active.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid/active.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid/active.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid/inactive.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid/inactive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid/inactive.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/wireless_grid/inactive.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/wrench.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/wrench.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/item/wrench.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/models/item/wrench.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/sounds.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/sounds.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/sounds.json rename to refinedstorage-common/src/main/resources/assets/refinedstorage/sounds.json diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/sounds/wrench.ogg b/refinedstorage-common/src/main/resources/assets/refinedstorage/sounds/wrench.ogg similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/sounds/wrench.ogg rename to refinedstorage-common/src/main/resources/assets/refinedstorage/sounds/wrench.ogg diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/bottom.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/bottom.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/bottom.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/bottom.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/part_border.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/part_border.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/part_border.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/part_border.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/cable/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/cable/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/active.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/active.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/active.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/active.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/active.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/active.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/active.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/active.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/constructor/cutouts/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/constructor/front.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/constructor/front.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/constructor/front.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/constructor/front.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/black.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/black.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/black.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/black.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/blue.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/blue.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/blue.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/blue.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/brown.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/brown.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/brown.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/brown.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/cyan.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/cyan.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/cyan.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/cyan.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/gray.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/gray.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/gray.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/gray.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/green.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/green.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/green.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/green.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_blue.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_blue.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_blue.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_blue.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_gray.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_gray.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_gray.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/light_gray.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/lime.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/lime.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/lime.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/lime.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/magenta.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/magenta.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/magenta.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/magenta.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off_gray.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off_gray.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off_gray.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_off_gray.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on_gray.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on_gray.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on_gray.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/nearly_on_gray.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/off.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/off.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/off.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/off.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/on.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/on.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/on.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/on.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/orange.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/orange.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/orange.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/orange.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/pink.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/pink.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/pink.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/pink.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/purple.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/purple.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/purple.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/purple.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/red.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/red.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/red.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/red.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/white.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/white.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/white.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/white.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/yellow.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/yellow.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/yellow.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/cutouts/yellow.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/off.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/off.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/off.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/off.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/on.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/on.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/controller/on.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/controller/on.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/back.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/back.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/back.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/back.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/cutouts/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/front.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/front.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/front.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/front.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/left.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/left.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/left.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/left.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/right.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/right.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/right.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/right.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/top.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/top.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/top.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/crafting_grid/top.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/active.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/active.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/active.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/active.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/active.png.mcmeta b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/active.png.mcmeta similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/active.png.mcmeta rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/active.png.mcmeta diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/destructor/cutouts/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/destructor/front.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/destructor/front.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/destructor/front.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/destructor/front.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/bottom.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/bottom.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/bottom.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/bottom.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/unpowered.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/unpowered.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/unpowered.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/unpowered.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/cutouts/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/side.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/side.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/side.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/side.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/top.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/top.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/detector/top.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/detector/top.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk/disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk/disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk/disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk/disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk/fluid_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk/fluid_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk/fluid_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk/fluid_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk/leds.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk/leds.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk/leds.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk/leds.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/bottom.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/bottom.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/bottom.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/bottom.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/front.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/front.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/front.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/front.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/side.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/side.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/side.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/side.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/top.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/top.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/top.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_drive/top.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/back.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/back.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/back.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/back.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/cutouts/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/front.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/front.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/front.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/front.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/left.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/left.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/left.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/left.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/right.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/right.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/right.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/right.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/top.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/top.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/top.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/disk_interface/top.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/1024b_fluid_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/1024b_fluid_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/1024b_fluid_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/1024b_fluid_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/256b_fluid_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/256b_fluid_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/256b_fluid_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/256b_fluid_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/4096b_fluid_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/4096b_fluid_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/4096b_fluid_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/4096b_fluid_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/64b_fluid_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/64b_fluid_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/64b_fluid_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/64b_fluid_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/creative_fluid_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/creative_fluid_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/creative_fluid_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/fluid_storage_block/creative_fluid_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/back.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/back.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/back.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/back.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/cutouts/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/front.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/front.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/front.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/front.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/left.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/left.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/left.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/left.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/right.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/right.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/right.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/right.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/top.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/top.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/grid/top.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/grid/top.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/interface/active.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/interface/active.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/interface/active.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/interface/active.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/interface/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/interface/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/interface/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/interface/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/machine_casing.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/machine_casing.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/machine_casing.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/machine_casing.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/base.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/base.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/base.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/base.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_receiver/cutouts/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/base.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/base.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/base.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/base.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/error.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/error.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/error.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/error.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/network_transmitter/cutouts/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_1.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_1.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_1.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_1.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_2.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_2.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_2.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_2.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_2_inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_2_inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_2_inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_2_inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_3.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_3.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_3.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_3.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_4.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_4.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_4.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_4.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_5.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_5.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_5.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_5.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_6.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_6.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_6.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_6.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_7.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_7.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_7.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_7.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_8.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_8.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_8.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/portable_grid/portable_grid_8.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/quartz_enriched_copper_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/quartz_enriched_copper_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/quartz_enriched_copper_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/quartz_enriched_copper_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/quartz_enriched_iron_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/quartz_enriched_iron_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/quartz_enriched_iron_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/quartz_enriched_iron_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/.gitignore b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/.gitignore similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/.gitignore rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/.gitignore diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/in/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/in.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/in.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/in.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/in.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/out.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/out.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/out.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/relay/out.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/back.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/back.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/back.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/back.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/back/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/front/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/left/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/right/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/cutouts/top/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/front.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/front.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/front.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/front.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/left.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/left.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/left.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/left.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/right.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/right.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/right.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/right.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/top.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/top.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/top.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/security_manager/top.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/side.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/side.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/side.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/side.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/16k_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/16k_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/16k_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/16k_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/1k_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/1k_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/1k_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/1k_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/4k_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/4k_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/4k_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/4k_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/64k_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/64k_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/64k_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/64k_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/creative_storage_block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/creative_storage_block.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/creative_storage_block.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_block/creative_storage_block.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/back.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/back.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/back.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/back.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/front.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/front.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/front.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/front.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/left.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/left.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/left.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/left.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/right.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/right.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/right.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/right.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/top.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/top.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/top.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/storage_monitor/top.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/base.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/base.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/base.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/base.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/black.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/black.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/black.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/brown.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/brown.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/brown.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/cyan.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/cyan.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/cyan.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/green.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/green.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/green.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/light_blue.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/light_blue.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/light_blue.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/light_gray.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/light_gray.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/light_gray.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/lime.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/lime.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/lime.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/magenta.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/magenta.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/magenta.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/orange.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/orange.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/orange.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/pink.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/pink.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/pink.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/purple.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/purple.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/purple.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/red.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/red.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/red.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/white.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/white.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/white.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/yellow.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/yellow.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/wireless_transmitter/cutouts/yellow.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/advancements.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/advancements.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/advancements.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/advancements.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/amount_with_inventory.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/amount_with_inventory.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/amount_with_inventory.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/amount_with_inventory.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/book.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/book.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/book.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/book.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/controller.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/controller.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/controller.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/controller.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/crafting.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/crafting.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/crafting.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/crafting.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/crafting_grid.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/crafting_grid.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/crafting_grid.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/crafting_grid.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/disk_drive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/disk_drive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/disk_drive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/disk_drive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/disk_interface.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/disk_interface.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/disk_interface.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/disk_interface.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/generic_filter.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/generic_filter.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/generic_filter.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/generic_filter.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/grid.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/grid.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/grid.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/grid.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/interface.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/interface.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/interface.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/interface.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/network_transmitter.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/network_transmitter.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/network_transmitter.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/network_transmitter.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/portable_grid.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/portable_grid.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/portable_grid.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/portable_grid.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/priority.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/priority.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/priority.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/priority.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/resource_amount.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/resource_amount.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/resource_amount.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/resource_amount.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/security_card.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/security_card.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/security_card.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/security_card.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/security_manager.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/security_manager.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/security_manager.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/security_manager.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down_disabled.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down_disabled.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down_disabled.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down_disabled.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down_focused.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down_focused.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down_focused.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_down_focused.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up_disabled.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up_disabled.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up_disabled.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up_disabled.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up_focused.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up_focused.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up_focused.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/move_up_focused.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/storage.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/storage.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/storage.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/storage.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/storage_monitor.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/storage_monitor.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/storage_monitor.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/storage_monitor.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/widgets.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/widgets.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/widgets.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/widgets.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/wireless_transmitter.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/wireless_transmitter.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/gui/wireless_transmitter.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/wireless_transmitter.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/icons.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/icons.png new file mode 100644 index 000000000..280fe5627 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/icons.png differ diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/1024b_fluid_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/1024b_fluid_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/1024b_fluid_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/1024b_fluid_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/1024b_fluid_storage_part.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/1024b_fluid_storage_part.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/1024b_fluid_storage_part.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/1024b_fluid_storage_part.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/16k_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/16k_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/16k_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/16k_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/16k_storage_part.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/16k_storage_part.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/16k_storage_part.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/16k_storage_part.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/1k_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/1k_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/1k_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/1k_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/1k_storage_part.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/1k_storage_part.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/1k_storage_part.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/1k_storage_part.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/256b_fluid_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/256b_fluid_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/256b_fluid_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/256b_fluid_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/256b_fluid_storage_part.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/256b_fluid_storage_part.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/256b_fluid_storage_part.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/256b_fluid_storage_part.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/4096b_fluid_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/4096b_fluid_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/4096b_fluid_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/4096b_fluid_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/4096b_fluid_storage_part.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/4096b_fluid_storage_part.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/4096b_fluid_storage_part.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/4096b_fluid_storage_part.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/4k_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/4k_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/4k_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/4k_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/4k_storage_part.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/4k_storage_part.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/4k_storage_part.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/4k_storage_part.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/64b_fluid_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/64b_fluid_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/64b_fluid_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/64b_fluid_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/64b_fluid_storage_part.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/64b_fluid_storage_part.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/64b_fluid_storage_part.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/64b_fluid_storage_part.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/64k_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/64k_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/64k_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/64k_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/64k_storage_part.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/64k_storage_part.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/64k_storage_part.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/64k_storage_part.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/advanced_processor.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/advanced_processor.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/advanced_processor.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/advanced_processor.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/basic_processor.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/basic_processor.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/basic_processor.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/basic_processor.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/book.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/book.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/book.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/book.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/configuration_card/active.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/configuration_card/active.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/configuration_card/active.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/configuration_card/active.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/configuration_card/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/configuration_card/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/configuration_card/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/configuration_card/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/construction_core.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/construction_core.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/construction_core.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/construction_core.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/creative_fluid_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/creative_fluid_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/creative_fluid_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/creative_fluid_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/creative_range_upgrade.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/creative_range_upgrade.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/creative_range_upgrade.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/creative_range_upgrade.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/creative_storage_disk.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/creative_storage_disk.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/creative_storage_disk.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/creative_storage_disk.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/destruction_core.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/destruction_core.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/destruction_core.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/destruction_core.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/fortune_upgrade.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/fortune_upgrade.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/fortune_upgrade.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/fortune_upgrade.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/improved_processor.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/improved_processor.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/improved_processor.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/improved_processor.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/network_card/active.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/network_card/active.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/network_card/active.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/network_card/active.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/network_card/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/network_card/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/network_card/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/network_card/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/processor_binding.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/processor_binding.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/processor_binding.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/processor_binding.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/quartz_enriched_copper.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/quartz_enriched_copper.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/quartz_enriched_copper.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/quartz_enriched_copper.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/quartz_enriched_iron.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/quartz_enriched_iron.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/quartz_enriched_iron.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/quartz_enriched_iron.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/range_upgrade.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/range_upgrade.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/range_upgrade.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/range_upgrade.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/raw_advanced_processor.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/raw_advanced_processor.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/raw_advanced_processor.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/raw_advanced_processor.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/raw_basic_processor.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/raw_basic_processor.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/raw_basic_processor.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/raw_basic_processor.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/raw_improved_processor.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/raw_improved_processor.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/raw_improved_processor.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/raw_improved_processor.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/regulator_upgrade.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/regulator_upgrade.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/regulator_upgrade.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/regulator_upgrade.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/security_card/active.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/security_card/active.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/security_card/active.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/security_card/active.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/security_card/fallback.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/security_card/fallback.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/security_card/fallback.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/security_card/fallback.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/security_card/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/security_card/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/security_card/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/security_card/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/silicon.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/silicon.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/silicon.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/silicon.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/silk_touch_upgrade.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/silk_touch_upgrade.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/silk_touch_upgrade.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/silk_touch_upgrade.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/speed_upgrade.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/speed_upgrade.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/speed_upgrade.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/speed_upgrade.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/stack_upgrade.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/stack_upgrade.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/stack_upgrade.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/stack_upgrade.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/storage_housing.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/storage_housing.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/storage_housing.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/storage_housing.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/upgrade.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/upgrade.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/upgrade.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/upgrade.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/wireless_grid/active.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/wireless_grid/active.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/wireless_grid/active.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/wireless_grid/active.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/wireless_grid/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/wireless_grid/inactive.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/wireless_grid/inactive.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/wireless_grid/inactive.png diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/wrench.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/wrench.png similarity index 100% rename from refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/item/wrench.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/item/wrench.png diff --git a/refinedstorage-common/src/main/resources/data/c/tags/item/silicon.json b/refinedstorage-common/src/main/resources/data/c/tags/item/silicon.json new file mode 100644 index 000000000..bb6bc4f43 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/c/tags/item/silicon.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "refinedstorage:silicon" + ] +} diff --git a/refinedstorage-platform-common/src/main/resources/data/c/tags/item/tools/wrench.json b/refinedstorage-common/src/main/resources/data/c/tags/item/tools/wrench.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/c/tags/item/tools/wrench.json rename to refinedstorage-common/src/main/resources/data/c/tags/item/tools/wrench.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/better_than_a_barrel.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/better_than_a_barrel.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/better_than_a_barrel.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/better_than_a_barrel.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/conditional_connecting.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/conditional_connecting.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/conditional_connecting.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/conditional_connecting.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/connecting.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/connecting.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/connecting.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/connecting.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/construction.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/construction.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/construction.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/construction.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/destruction.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/destruction.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/destruction.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/destruction.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/detecting.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/detecting.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/detecting.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/detecting.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/drives.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/drives.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/drives.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/drives.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/exporting.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/exporting.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/exporting.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/exporting.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/importing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/importing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/importing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/importing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/interface_to_the_world.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/interface_to_the_world.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/interface_to_the_world.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/interface_to_the_world.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/interfacing_with_disks.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/interfacing_with_disks.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/interfacing_with_disks.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/interfacing_with_disks.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/no_cables_required.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/no_cables_required.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/no_cables_required.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/no_cables_required.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/portable_storage.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/portable_storage.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/portable_storage.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/portable_storage.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/root.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/root.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/root.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/root.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/security.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/security.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/security.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/security.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/storing_externally.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/storing_externally.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/storing_externally.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/storing_externally.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/storing_fluids.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/storing_fluids.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/storing_fluids.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/storing_fluids.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/storing_items.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/storing_items.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/storing_items.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/storing_items.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/upgrading.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/upgrading.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/upgrading.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/upgrading.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/upgrading_your_grid.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/upgrading_your_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/upgrading_your_grid.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/upgrading_your_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/viewing_your_storage.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/viewing_your_storage.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/viewing_your_storage.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/viewing_your_storage.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/wireless.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/wireless.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/advancement/wireless.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/advancement/wireless.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/1024b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1024b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/1024b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1024b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/16k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/16k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/16k_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/16k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/1k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/1k_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/256b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/256b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/256b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/256b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/4096b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4096b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/4096b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4096b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/4k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/4k_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/64b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/64b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/64k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/64k_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_portable_grid.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_portable_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_portable_grid.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_portable_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/disk_drive.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/disk_drive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/disk_drive.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/disk_drive.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/exporter.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/exporter.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/exporter.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/exporter.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/external_storage.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/external_storage.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/external_storage.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/importer.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/importer.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/importer.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/importer.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/interface.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/interface.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/interface.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/interface.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/machine_casing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/machine_casing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/machine_casing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/machine_casing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/portable_grid.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/portable_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/portable_grid.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/portable_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/quartz_enriched_iron_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/quartz_enriched_iron_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/quartz_enriched_iron_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/quartz_enriched_iron_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/storage_monitor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/storage_monitor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/loot_table/blocks/storage_monitor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/storage_monitor.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk_from_storage_housing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk_from_storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk_from_storage_housing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk_from_storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_part.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_part.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/16k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/16k_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk_from_storage_housing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk_from_storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk_from_storage_housing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk_from_storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/16k_storage_part.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/16k_storage_part.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1k_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1k_storage_disk.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1k_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1k_storage_disk.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1k_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1k_storage_disk_from_storage_housing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1k_storage_disk_from_storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1k_storage_disk_from_storage_housing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1k_storage_disk_from_storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1k_storage_part.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1k_storage_part.json similarity index 90% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1k_storage_part.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1k_storage_part.json index ed749ef7a..4fb7cb9d4 100644 --- a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/1k_storage_part.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1k_storage_part.json @@ -7,7 +7,7 @@ ], "key": { "S": { - "item": "refinedstorage:silicon" + "tag": "c:silicon" }, "E": { "item": "refinedstorage:quartz_enriched_iron" diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk_from_storage_housing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk_from_storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk_from_storage_housing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk_from_storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_part.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_part.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk_from_storage_housing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk_from_storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk_from_storage_housing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk_from_storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_part.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_part.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4k_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk_from_storage_housing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk_from_storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk_from_storage_housing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk_from_storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4k_storage_part.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/4k_storage_part.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_disk.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_disk.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_disk_from_storage_housing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_disk_from_storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_disk_from_storage_housing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_disk_from_storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_part.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_part.json similarity index 90% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_part.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_part.json index 36ff7f29c..1d4848803 100644 --- a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_part.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64b_fluid_storage_part.json @@ -7,7 +7,7 @@ ], "key": { "S": { - "item": "refinedstorage:silicon" + "tag": "c:silicon" }, "E": { "item": "refinedstorage:quartz_enriched_iron" diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64k_storage_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk_from_storage_housing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk_from_storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk_from_storage_housing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk_from_storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64k_storage_part.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_part.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/64k_storage_part.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_part.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/advanced_processor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/advanced_processor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/advanced_processor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/advanced_processor.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/basic_processor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/basic_processor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/basic_processor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/basic_processor.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/cable.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/cable.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/cable.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/cable.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/configuration_card.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/configuration_card.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/configuration_card.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/configuration_card.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/construction_core.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/construction_core.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/construction_core.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/construction_core.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/constructor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/constructor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/constructor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/constructor.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/controller.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/controller.json similarity index 90% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/controller.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/controller.json index 70ef12fd8..3f46658ff 100644 --- a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/controller.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/controller.json @@ -13,7 +13,7 @@ "item": "refinedstorage:advanced_processor" }, "S": { - "item": "refinedstorage:silicon" + "tag": "c:silicon" }, "M": { "item": "refinedstorage:machine_casing" diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/crafting_grid.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/crafting_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/crafting_grid.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/crafting_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/destruction_core.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/destruction_core.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/destruction_core.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/destruction_core.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/destructor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/destructor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/destructor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/destructor.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/detector.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/detector.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/detector.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/detector.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/disk_drive.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/disk_drive.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/disk_drive.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/disk_drive.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/disk_interface.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/disk_interface.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/disk_interface.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/disk_interface.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/exporter.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/exporter.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/exporter.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/exporter.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/external_storage.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/external_storage.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/external_storage.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/external_storage.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/fallback_security_card.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/fallback_security_card.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/fallback_security_card.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/fallback_security_card.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/fortune_1_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/fortune_1_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/fortune_1_upgrade.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/fortune_1_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/fortune_2_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/fortune_2_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/fortune_2_upgrade.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/fortune_2_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/fortune_3_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/fortune_3_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/fortune_3_upgrade.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/fortune_3_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/grid.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/grid.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/grid.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/importer.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/importer.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/importer.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/importer.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/improved_processor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/improved_processor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/improved_processor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/improved_processor.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/interface.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/interface.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/interface.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/interface.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/machine_casing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/machine_casing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/machine_casing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/machine_casing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/network_card.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/network_card.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/network_card.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/network_card.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/network_receiver.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/network_receiver.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/network_receiver.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/network_receiver.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/network_transmitter.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/network_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/network_transmitter.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/network_transmitter.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/portable_grid.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/portable_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/portable_grid.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/portable_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/processor_binding.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/processor_binding.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/processor_binding.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/processor_binding.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper_from_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper_from_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper_from_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_copper_from_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron_from_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron_from_block.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron_from_block.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/quartz_enriched_iron_from_block.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/range_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/range_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/range_upgrade.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/range_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/raw_advanced_processor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/raw_advanced_processor.json similarity index 88% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/raw_advanced_processor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/raw_advanced_processor.json index b7e4bb07e..9880d2935 100644 --- a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/raw_advanced_processor.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/raw_advanced_processor.json @@ -8,7 +8,7 @@ "tag": "c:gems/diamond" }, { - "item": "refinedstorage:silicon" + "tag": "c:silicon" }, { "tag": "c:dusts/redstone" diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/raw_basic_processor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/raw_basic_processor.json similarity index 88% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/raw_basic_processor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/raw_basic_processor.json index 813373564..86ccd4346 100644 --- a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/raw_basic_processor.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/raw_basic_processor.json @@ -8,7 +8,7 @@ "tag": "c:ingots/iron" }, { - "item": "refinedstorage:silicon" + "tag": "c:silicon" }, { "tag": "c:dusts/redstone" diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/raw_improved_processor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/raw_improved_processor.json similarity index 88% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/raw_improved_processor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/raw_improved_processor.json index 7e59524f6..c50897d1d 100644 --- a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/raw_improved_processor.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/raw_improved_processor.json @@ -8,7 +8,7 @@ "tag": "c:ingots/gold" }, { - "item": "refinedstorage:silicon" + "tag": "c:silicon" }, { "tag": "c:dusts/redstone" diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/regulator_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/regulator_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/regulator_upgrade.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/regulator_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/relay.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/relay.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/relay.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/relay.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/security_card.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/security_card.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/security_card.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/security_card.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/security_manager.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/security_manager.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/security_manager.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/security_manager.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/silicon.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/silicon.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/silicon.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/silicon.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/silk_touch_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/silk_touch_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/silk_touch_upgrade.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/silk_touch_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/speed_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/speed_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/speed_upgrade.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/speed_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/stack_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/stack_upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/stack_upgrade.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/stack_upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/storage_housing.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/storage_housing.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/storage_housing.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/storage_housing.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/storage_monitor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/storage_monitor.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/storage_monitor.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/storage_monitor.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/upgrade.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/upgrade.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/upgrade.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/wireless_grid.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/wireless_grid.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/wireless_grid.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/wireless_grid.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/wireless_transmitter.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/wireless_transmitter.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/wireless_transmitter.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/wireless_transmitter.json diff --git a/refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/wrench.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/wrench.json similarity index 100% rename from refinedstorage-platform-common/src/main/resources/data/refinedstorage/recipe/wrench.json rename to refinedstorage-common/src/main/resources/data/refinedstorage/recipe/wrench.json diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/SetupMinecraft.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/SetupMinecraft.java similarity index 88% rename from refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/SetupMinecraft.java rename to refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/SetupMinecraft.java index eaf1044bf..4c817ab4d 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/SetupMinecraft.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/SetupMinecraft.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common; +package com.refinedmods.refinedstorage.common; import net.minecraft.SharedConstants; import net.minecraft.server.Bootstrap; diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/TestPlatform.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/TestPlatform.java similarity index 75% rename from refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/TestPlatform.java rename to refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/TestPlatform.java index 5aa7118d1..1a7fc620a 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/TestPlatform.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/TestPlatform.java @@ -1,18 +1,23 @@ -package com.refinedmods.refinedstorage.platform.common; +package com.refinedmods.refinedstorage.common; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.MenuOpener; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.TransferManager; -import com.refinedmods.refinedstorage.platform.common.support.render.FluidRenderer; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; +import com.refinedmods.refinedstorage.common.support.containermenu.MenuOpener; +import com.refinedmods.refinedstorage.common.support.containermenu.TransferManager; +import com.refinedmods.refinedstorage.common.support.render.FluidRenderer; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import java.io.File; import java.util.List; import java.util.Optional; import java.util.UUID; +import java.util.function.BiConsumer; import javax.annotation.Nullable; import net.minecraft.client.KeyMapping; @@ -21,6 +26,7 @@ import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.core.NonNullList; import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; @@ -40,6 +46,7 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.saveddata.SavedData; import net.minecraft.world.phys.BlockHitResult; public class TestPlatform implements Platform { @@ -95,12 +102,18 @@ public FluidRenderer getFluidRenderer() { } @Override - public Optional getContainedFluid(final ItemStack stack) { + public Optional drainContainer(final ItemStack container) { + throw new UnsupportedOperationException(); + } + + @Override + public Optional fillContainer(final ItemStack container, + final ResourceAmount resourceAmount) { throw new UnsupportedOperationException(); } @Override - public Optional convertToBucket(final FluidResource fluidResource) { + public Optional getFilledBucket(final FluidResource fluidResource) { throw new UnsupportedOperationException(); } @@ -194,4 +207,24 @@ public void sendPacketToServer(final T packet) { public void sendPacketToClient(final ServerPlayer player, final T packet) { throw new UnsupportedOperationException(); } + + @Override + public void saveSavedData(final SavedData savedData, final File file, final HolderLookup.Provider provider, + final BiConsumer defaultSaveFunction) { + throw new UnsupportedOperationException(); + } + + @Nullable + @Override + public NetworkNodeContainerProvider getContainerProvider(final Level level, final BlockPos pos, + @Nullable final Direction direction) { + throw new UnsupportedOperationException(); + } + + @Nullable + @Override + public NetworkNodeContainerProvider getContainerProviderSafely(final Level level, final BlockPos pos, + @Nullable final Direction direction) { + throw new UnsupportedOperationException(); + } } diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/grid/GridSortingTypesTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/grid/GridSortingTypesTest.java similarity index 94% rename from refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/grid/GridSortingTypesTest.java rename to refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/grid/GridSortingTypesTest.java index 367c0be1c..3d22021ab 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/grid/GridSortingTypesTest.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/grid/GridSortingTypesTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.grid; +package com.refinedmods.refinedstorage.common.grid; import com.refinedmods.refinedstorage.api.grid.view.GridResource; import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; @@ -7,9 +7,9 @@ import com.refinedmods.refinedstorage.api.grid.view.GridViewBuilder; import com.refinedmods.refinedstorage.api.grid.view.GridViewBuilderImpl; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage.platform.common.SetupMinecraft; -import com.refinedmods.refinedstorage.platform.common.grid.view.AbstractItemGridResourceFactory; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.SetupMinecraft; +import com.refinedmods.refinedstorage.common.grid.view.AbstractItemGridResourceFactory; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.Comparator; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/grid/screen/LastModifiedTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/grid/screen/LastModifiedTest.java similarity index 98% rename from refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/grid/screen/LastModifiedTest.java rename to refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/grid/screen/LastModifiedTest.java index 2f50d9b97..ef9dcb8b5 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/grid/screen/LastModifiedTest.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/grid/screen/LastModifiedTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; +package com.refinedmods.refinedstorage.common.grid.screen; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/storage/ClientStorageRepositoryTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepositoryTest.java similarity index 91% rename from refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/storage/ClientStorageRepositoryTest.java rename to refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepositoryTest.java index beb96e358..548c59d95 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/storage/ClientStorageRepositoryTest.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepositoryTest.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.storage; +package com.refinedmods.refinedstorage.common.storage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; +import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImplTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/registry/PlatformRegistryImplTest.java similarity index 93% rename from refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImplTest.java rename to refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/registry/PlatformRegistryImplTest.java index 104b7cda0..7d819860d 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImplTest.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/registry/PlatformRegistryImplTest.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.common.support.registry; +package com.refinedmods.refinedstorage.common.support.registry; -import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage.common.api.support.registry.PlatformRegistry; import java.util.List; @@ -43,6 +43,7 @@ void shouldNotBeAbleToModifyUnderlyingRegistryList() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldRegisterAndRetrieve() { // Act sut.register(A, 10); diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceRenderingTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRenderingTest.java similarity index 89% rename from refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceRenderingTest.java rename to refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRenderingTest.java index ed9367865..e72d9b78a 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceRenderingTest.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRenderingTest.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; +package com.refinedmods.refinedstorage.common.support.resource; -import com.refinedmods.refinedstorage.platform.common.PlatformProxy; -import com.refinedmods.refinedstorage.platform.common.TestPlatform; +import com.refinedmods.refinedstorage.common.PlatformProxy; +import com.refinedmods.refinedstorage.common.TestPlatform; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImplTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/list/FuzzyResourceListImplTest.java similarity index 94% rename from refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImplTest.java rename to refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/list/FuzzyResourceListImplTest.java index 83de1f629..dfc5dfcc3 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImplTest.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/list/FuzzyResourceListImplTest.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource.list; +package com.refinedmods.refinedstorage.common.support.resource.list; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; -import com.refinedmods.refinedstorage.platform.api.support.resource.list.FuzzyResourceList; -import com.refinedmods.refinedstorage.platform.common.SetupMinecraft; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.SetupMinecraft; +import com.refinedmods.refinedstorage.common.api.support.resource.list.FuzzyResourceList; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.Collection; import java.util.Optional; @@ -37,6 +37,7 @@ void setUp() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void testRetrievingFuzzy() { // Arrange sut.add(DUMMY_A, 5); @@ -92,6 +93,7 @@ void testRetrievingFuzzy() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldRemoveEntireResourceFromFuzzyIndexAfterRemoval() { // Arrange sut.add(DUMMY_A, 5); @@ -137,6 +139,7 @@ void shouldRemoveEntireResourceFromFuzzyIndexAfterRemoval() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldRemoveSingleResourceFromFuzzyIndexAfterRemoval() { // Arrange sut.add(DUMMY_A, 5); diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/widget/HistoryTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/widget/HistoryTest.java similarity index 97% rename from refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/widget/HistoryTest.java rename to refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/widget/HistoryTest.java index 647c35726..389f8a5cb 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/widget/HistoryTest.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/widget/HistoryTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; +package com.refinedmods.refinedstorage.common.support.widget; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/NullableType.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/NullableType.java new file mode 100644 index 000000000..47f3cc15f --- /dev/null +++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/NullableType.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage.api.core; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import javax.annotation.Nullable; + +@Nullable +@Target({ElementType.TYPE_USE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface NullableType { +} diff --git a/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java index 8f1579162..770a781d3 100644 --- a/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java +++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java @@ -26,7 +26,6 @@ public ComponentMapFactory copy() { return new ComponentMapFactory<>(new LinkedHashMap<>(factories)); } - @SuppressWarnings("unchecked") public ComponentMap buildComponentMap(final X context) { final Map, C> components = new LinkedHashMap<>(); factories.forEach((componentType, factory) -> { diff --git a/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java b/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java index 3bcb34c4a..a1c3c3e94 100644 --- a/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java +++ b/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java @@ -35,6 +35,7 @@ void shouldValidateEquals() { } @Test + @SuppressWarnings("ObviousNullCheck") void shouldValidateNull() { // Act & assert final Exception e = assertThrows( @@ -47,6 +48,7 @@ void shouldValidateNull() { } @Test + @SuppressWarnings("ObviousNullCheck") void shouldValidateNotNull() { // Act & assert final Exception e = assertThrows( diff --git a/refinedstorage-fabric-api/build.gradle.kts b/refinedstorage-fabric-api/build.gradle.kts new file mode 100644 index 000000000..108799777 --- /dev/null +++ b/refinedstorage-fabric-api/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + id("refinedarchitect.fabric") +} + +refinedarchitect { + fabric() +} + +dependencies { + compileOnly(project(":refinedstorage-common-api")) + api(libs.apiguardian) +} + +base { + archivesName.set("refinedstorage-fabric-api") +} diff --git a/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/RefinedStorageFabricApi.java b/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/RefinedStorageFabricApi.java new file mode 100644 index 000000000..557acb7ea --- /dev/null +++ b/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/RefinedStorageFabricApi.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage.fabric.api; + +import com.refinedmods.refinedstorage.api.core.NullableType; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; + +import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup; +import net.minecraft.core.Direction; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.5") +public interface RefinedStorageFabricApi { + RefinedStorageFabricApi INSTANCE = new RefinedStorageFabricApiProxy(); + + BlockApiLookup getNetworkNodeContainerProviderLookup(); +} diff --git a/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/RefinedStorageFabricApiProxy.java b/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/RefinedStorageFabricApiProxy.java new file mode 100644 index 000000000..26b313b03 --- /dev/null +++ b/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/RefinedStorageFabricApiProxy.java @@ -0,0 +1,32 @@ +package com.refinedmods.refinedstorage.fabric.api; + +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; + +import javax.annotation.Nullable; + +import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup; +import net.minecraft.core.Direction; + +public class RefinedStorageFabricApiProxy implements RefinedStorageFabricApi { + @Nullable + private RefinedStorageFabricApi delegate; + + public void setDelegate(final RefinedStorageFabricApi delegate) { + if (this.delegate != null) { + throw new IllegalStateException("Fabric API already injected"); + } + this.delegate = delegate; + } + + private RefinedStorageFabricApi ensureLoaded() { + if (delegate == null) { + throw new IllegalStateException("Fabric API not loaded yet"); + } + return delegate; + } + + @Override + public BlockApiLookup getNetworkNodeContainerProviderLookup() { + return ensureLoaded().getNetworkNodeContainerProviderLookup(); + } +} diff --git a/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/RefinedStoragePlugin.java b/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/RefinedStoragePlugin.java new file mode 100644 index 000000000..dc609dcaa --- /dev/null +++ b/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/RefinedStoragePlugin.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage.fabric.api; + +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.13") +@FunctionalInterface +public interface RefinedStoragePlugin { + void onApiAvailable(RefinedStorageApi api); +} diff --git a/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/package-info.java b/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/package-info.java new file mode 100644 index 000000000..b32ccb141 --- /dev/null +++ b/refinedstorage-fabric-api/src/main/java/com/refinedmods/refinedstorage/fabric/api/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.api; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-fabric/build.gradle.kts b/refinedstorage-fabric/build.gradle.kts new file mode 100644 index 000000000..c730faadc --- /dev/null +++ b/refinedstorage-fabric/build.gradle.kts @@ -0,0 +1,50 @@ +plugins { + id("refinedarchitect.fabric") +} + +repositories { + maven { + name = "ModMenu" + url = uri("https://maven.terraformersmc.com/") + } + maven { + name = "Cloth Config" + url = uri("https://maven.shedaniel.me/") + } +} + +refinedarchitect { + modId = "refinedstorage" + fabric() + compileWithProject(project(":refinedstorage-common")) + compileWithProject(project(":refinedstorage-common-api")) + compileWithProject(project(":refinedstorage-fabric-api")) + addProject(project(":refinedstorage-core-api")) + addProject(project(":refinedstorage-resource-api")) + addProject(project(":refinedstorage-storage-api")) + addProject(project(":refinedstorage-network-api")) + addProject(project(":refinedstorage-network")) + addProject(project(":refinedstorage-grid-api")) + addProject(project(":refinedstorage-query-parser")) + publishing { + maven = true + // curseForge = "243076" + // modrinth = "refined-storage" + } +} + +base { + archivesName.set("refinedstorage-fabric") +} + +dependencies { + modApi(libs.cloth.config) { + exclude(group = "net.fabricmc.fabric-api") + } + modApi(libs.teamreborn.energy) { + exclude(group = "net.fabricmc.fabric-api") + } + modApi(libs.modmenu) + include(libs.cloth.config) + include(libs.teamreborn.energy) +} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ClientModInitializerImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java similarity index 82% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ClientModInitializerImpl.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java index e8d34a1b1..cb00fd976 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ClientModInitializerImpl.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java @@ -1,46 +1,46 @@ -package com.refinedmods.refinedstorage.platform.fabric; +package com.refinedmods.refinedstorage.fabric; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.upgrade.AbstractUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.AbstractClientModInitializer; -import com.refinedmods.refinedstorage.platform.common.configurationcard.ConfigurationCardItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.content.KeyMappings; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkCardItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.StorageMonitorBlockEntityRenderer; -import com.refinedmods.refinedstorage.platform.common.support.network.bounditem.NetworkBoundItemItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketHandler; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.EnergyInfoPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridActivePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridClearPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridUpdatePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.NetworkTransmitterStatusPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.NoPermissionPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.ResourceSlotUpdatePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.StorageInfoResponsePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.WirelessTransmitterRangePacket; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.CompositeClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.HelpClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.ResourceClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinationClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil; -import com.refinedmods.refinedstorage.platform.fabric.mixin.ItemPropertiesAccessor; -import com.refinedmods.refinedstorage.platform.fabric.storage.diskdrive.DiskDriveBlockEntityRendererImpl; -import com.refinedmods.refinedstorage.platform.fabric.storage.diskdrive.DiskDriveUnbakedModel; -import com.refinedmods.refinedstorage.platform.fabric.storage.diskinterface.DiskInterfaceBlockEntityRendererImpl; -import com.refinedmods.refinedstorage.platform.fabric.storage.diskinterface.DiskInterfaceUnbakedModel; -import com.refinedmods.refinedstorage.platform.fabric.storage.portablegrid.PortableGridBlockEntityRendererImpl; -import com.refinedmods.refinedstorage.platform.fabric.storage.portablegrid.PortableGridUnbakedModel; -import com.refinedmods.refinedstorage.platform.fabric.support.render.EmissiveModelRegistry; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadRotators; +import com.refinedmods.refinedstorage.common.AbstractClientModInitializer; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.upgrade.AbstractUpgradeItem; +import com.refinedmods.refinedstorage.common.configurationcard.ConfigurationCardItemPropertyFunction; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.content.KeyMappings; +import com.refinedmods.refinedstorage.common.controller.ControllerItemPropertyFunction; +import com.refinedmods.refinedstorage.common.networking.NetworkCardItemPropertyFunction; +import com.refinedmods.refinedstorage.common.security.SecurityCardItemPropertyFunction; +import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorBlockEntityRenderer; +import com.refinedmods.refinedstorage.common.support.network.item.NetworkItemPropertyFunction; +import com.refinedmods.refinedstorage.common.support.packet.PacketHandler; +import com.refinedmods.refinedstorage.common.support.packet.s2c.EnergyInfoPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.GridActivePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.GridClearPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.GridUpdatePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.NetworkTransmitterStatusPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.NoPermissionPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.ResourceSlotUpdatePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.StorageInfoResponsePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.WirelessTransmitterRangePacket; +import com.refinedmods.refinedstorage.common.support.tooltip.CompositeClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.tooltip.HelpClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.tooltip.ResourceClientTooltipComponent; +import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeItem; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinationClientTooltipComponent; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; +import com.refinedmods.refinedstorage.fabric.mixin.ItemPropertiesAccessor; +import com.refinedmods.refinedstorage.fabric.storage.diskdrive.DiskDriveBlockEntityRendererImpl; +import com.refinedmods.refinedstorage.fabric.storage.diskdrive.DiskDriveUnbakedModel; +import com.refinedmods.refinedstorage.fabric.storage.diskinterface.DiskInterfaceBlockEntityRendererImpl; +import com.refinedmods.refinedstorage.fabric.storage.diskinterface.DiskInterfaceUnbakedModel; +import com.refinedmods.refinedstorage.fabric.storage.portablegrid.PortableGridBlockEntityRendererImpl; +import com.refinedmods.refinedstorage.fabric.storage.portablegrid.PortableGridUnbakedModel; +import com.refinedmods.refinedstorage.fabric.support.render.EmissiveModelRegistry; +import com.refinedmods.refinedstorage.fabric.support.render.QuadRotators; import java.util.List; @@ -68,7 +68,7 @@ import net.minecraft.world.level.block.Block; import org.lwjgl.glfw.GLFW; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class ClientModInitializerImpl extends AbstractClientModInitializer implements ClientModInitializer { private static final String BLOCK_PREFIX = "block"; @@ -423,13 +423,13 @@ private void registerModelPredicates() { private void registerItemProperties() { ItemProperties.register( Items.INSTANCE.getWirelessGrid(), - NetworkBoundItemItemPropertyFunction.NAME, - new NetworkBoundItemItemPropertyFunction() + NetworkItemPropertyFunction.NAME, + new NetworkItemPropertyFunction() ); ItemProperties.register( Items.INSTANCE.getCreativeWirelessGrid(), - NetworkBoundItemItemPropertyFunction.NAME, - new NetworkBoundItemItemPropertyFunction() + NetworkItemPropertyFunction.NAME, + new NetworkItemPropertyFunction() ); ItemProperties.register( Items.INSTANCE.getConfigurationCard(), diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ConfigImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ConfigImpl.java new file mode 100644 index 000000000..440f1fcbf --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ConfigImpl.java @@ -0,0 +1,696 @@ +package com.refinedmods.refinedstorage.fabric; + +import com.refinedmods.refinedstorage.api.grid.view.GridSortingDirection; +import com.refinedmods.refinedstorage.common.content.DefaultEnergyUsage; +import com.refinedmods.refinedstorage.common.grid.CraftingGridMatrixCloseBehavior; +import com.refinedmods.refinedstorage.common.grid.GridSortingTypes; +import com.refinedmods.refinedstorage.common.support.stretching.ScreenSize; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; + +import java.util.Optional; + +import me.shedaniel.autoconfig.AutoConfig; +import me.shedaniel.autoconfig.ConfigData; +import me.shedaniel.autoconfig.annotation.Config; +import me.shedaniel.autoconfig.annotation.ConfigEntry; +import net.minecraft.resources.ResourceLocation; + +@SuppressWarnings({"FieldCanBeLocal", "FieldMayBeFinal", "CanBeFinal"}) +@Config(name = IdentifierUtil.MOD_ID) +public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage.common.Config { + private ScreenSize screenSize = ScreenSize.STRETCH; + + private boolean smoothScrolling = true; + + @ConfigEntry.BoundedDiscrete(min = 3L, max = 256) + private int maxRowsStretch = 256; + + @ConfigEntry.Gui.CollapsibleObject + private GridEntryImpl grid = new GridEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private CraftingGridEntryImpl craftingGrid = new CraftingGridEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private ControllerEntryImpl controller = new ControllerEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private DiskDriveEntryImpl diskDrive = new DiskDriveEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private DiskInterfaceEntryImpl diskInterface = new DiskInterfaceEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl cable = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.CABLE); + + @ConfigEntry.Gui.CollapsibleObject + private StorageBlockEntryImpl storageBlock = new StorageBlockEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private FluidStorageBlockEntryImpl fluidStorageBlock = new FluidStorageBlockEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl importer = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.IMPORTER); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl exporter = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.EXPORTER); + + @ConfigEntry.Gui.CollapsibleObject + private UpgradeEntryImpl upgrade = new UpgradeEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl iface = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.INTERFACE); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl externalStorage = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.EXTERNAL_STORAGE + ); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl detector = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.DETECTOR); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl destructor = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.DESTRUCTOR); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl constructor = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.CONSTRUCTOR); + + @ConfigEntry.Gui.CollapsibleObject + private WirelessGridEntryImpl wirelessGrid = new WirelessGridEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private WirelessTransmitterEntryImpl wirelessTransmitter = new WirelessTransmitterEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl storageMonitor = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.STORAGE_MONITOR + ); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl networkReceiver = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.NETWORK_RECEIVER + ); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl networkTransmitter = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.NETWORK_TRANSMITTER + ); + + @ConfigEntry.Gui.CollapsibleObject + private PortableGridEntryImpl portableGrid = new PortableGridEntryImpl(); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl securityCard = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.SECURITY_CARD); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl fallbackSecurityCard = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.FALLBACK_SECURITY_CARD + ); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl securityManager = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.SECURITY_MANAGER + ); + + @ConfigEntry.Gui.CollapsibleObject + private RelayEntryImpl relay = new RelayEntryImpl(); + + public static ConfigImpl get() { + return AutoConfig.getConfigHolder(ConfigImpl.class).getConfig(); + } + + @Override + public ScreenSize getScreenSize() { + return screenSize; + } + + @Override + public void setScreenSize(final ScreenSize screenSize) { + this.screenSize = screenSize; + AutoConfig.getConfigHolder(ConfigImpl.class).save(); + } + + @Override + public boolean isSmoothScrolling() { + return smoothScrolling; + } + + @Override + public int getMaxRowsStretch() { + return maxRowsStretch; + } + + @Override + public GridEntry getGrid() { + return grid; + } + + @Override + public CraftingGridEntry getCraftingGrid() { + return craftingGrid; + } + + @Override + public ControllerEntry getController() { + return controller; + } + + @Override + public DiskDriveEntry getDiskDrive() { + return diskDrive; + } + + @Override + public DiskInterfaceEntry getDiskInterface() { + return diskInterface; + } + + @Override + public SimpleEnergyUsageEntry getCable() { + return cable; + } + + @Override + public StorageBlockEntry getStorageBlock() { + return storageBlock; + } + + @Override + public FluidStorageBlockEntry getFluidStorageBlock() { + return fluidStorageBlock; + } + + @Override + public SimpleEnergyUsageEntry getImporter() { + return importer; + } + + @Override + public SimpleEnergyUsageEntry getExporter() { + return exporter; + } + + @Override + public UpgradeEntry getUpgrade() { + return upgrade; + } + + @Override + public SimpleEnergyUsageEntry getInterface() { + return iface; + } + + @Override + public SimpleEnergyUsageEntry getExternalStorage() { + return externalStorage; + } + + @Override + public SimpleEnergyUsageEntry getDetector() { + return detector; + } + + @Override + public SimpleEnergyUsageEntry getDestructor() { + return destructor; + } + + @Override + public SimpleEnergyUsageEntry getConstructor() { + return constructor; + } + + @Override + public WirelessGridEntry getWirelessGrid() { + return wirelessGrid; + } + + @Override + public WirelessTransmitterEntry getWirelessTransmitter() { + return wirelessTransmitter; + } + + @Override + public SimpleEnergyUsageEntry getStorageMonitor() { + return storageMonitor; + } + + @Override + public SimpleEnergyUsageEntry getNetworkReceiver() { + return networkReceiver; + } + + @Override + public SimpleEnergyUsageEntry getNetworkTransmitter() { + return networkTransmitter; + } + + @Override + public PortableGridEntry getPortableGrid() { + return portableGrid; + } + + @Override + public SimpleEnergyUsageEntry getSecurityCard() { + return securityCard; + } + + @Override + public SimpleEnergyUsageEntry getFallbackSecurityCard() { + return fallbackSecurityCard; + } + + @Override + public SimpleEnergyUsageEntry getSecurityManager() { + return securityManager; + } + + @Override + public RelayEntry getRelay() { + return relay; + } + + private static class GridEntryImpl implements GridEntry { + private boolean largeFont = false; + + private long energyUsage = DefaultEnergyUsage.GRID; + + private boolean preventSortingWhileShiftIsDown = true; + + private boolean detailedTooltip = true; + + private boolean rememberSearchQuery = false; + + private boolean autoSelected = false; + + private String synchronizer = ""; + + private String resourceType = ""; + + private GridSortingDirection sortingDirection = GridSortingDirection.ASCENDING; + + private GridSortingTypes sortingType = GridSortingTypes.QUANTITY; + + @Override + public boolean isLargeFont() { + return largeFont; + } + + @Override + public boolean isPreventSortingWhileShiftIsDown() { + return preventSortingWhileShiftIsDown; + } + + @Override + public boolean isDetailedTooltip() { + return detailedTooltip; + } + + @Override + public boolean isRememberSearchQuery() { + return rememberSearchQuery; + } + + @Override + public long getEnergyUsage() { + return energyUsage; + } + + @Override + public boolean isAutoSelected() { + return autoSelected; + } + + @Override + public void setAutoSelected(final boolean autoSelected) { + this.autoSelected = autoSelected; + save(); + } + + @Override + public Optional getSynchronizer() { + if (synchronizer.trim().isBlank()) { + return Optional.empty(); + } + return Optional.of(synchronizer).map(ResourceLocation::tryParse); + } + + @Override + public void setSynchronizer(final ResourceLocation synchronizerId) { + this.synchronizer = synchronizerId.toString(); + save(); + } + + @Override + public void clearSynchronizer() { + this.synchronizer = ""; + save(); + } + + @Override + public GridSortingDirection getSortingDirection() { + return sortingDirection; + } + + @Override + public void setSortingDirection(final GridSortingDirection sortingDirection) { + this.sortingDirection = sortingDirection; + save(); + } + + @Override + public GridSortingTypes getSortingType() { + return sortingType; + } + + @Override + public void setSortingType(final GridSortingTypes sortingType) { + this.sortingType = sortingType; + save(); + } + + @Override + public Optional getResourceType() { + if (resourceType.trim().isBlank()) { + return Optional.empty(); + } + return Optional.of(resourceType).map(ResourceLocation::tryParse); + } + + @Override + public void setResourceType(final ResourceLocation resourceType) { + this.resourceType = resourceType.toString(); + save(); + } + + @Override + public void clearResourceType() { + this.resourceType = ""; + save(); + } + + private static void save() { + AutoConfig.getConfigHolder(ConfigImpl.class).save(); + } + } + + private static class CraftingGridEntryImpl implements CraftingGridEntry { + private long energyUsage = DefaultEnergyUsage.CRAFTING_GRID; + + private CraftingGridMatrixCloseBehavior craftingMatrixCloseBehavior = CraftingGridMatrixCloseBehavior.NONE; + + @Override + public long getEnergyUsage() { + return energyUsage; + } + + @Override + public CraftingGridMatrixCloseBehavior getCraftingMatrixCloseBehavior() { + return craftingMatrixCloseBehavior; + } + } + + private static class DiskDriveEntryImpl implements DiskDriveEntry { + private long energyUsage = DefaultEnergyUsage.DISK_DRIVE; + + private long energyUsagePerDisk = DefaultEnergyUsage.DISK_DRIVE_PER_DISK; + + @Override + public long getEnergyUsage() { + return energyUsage; + } + + @Override + public long getEnergyUsagePerDisk() { + return energyUsagePerDisk; + } + } + + private static class DiskInterfaceEntryImpl implements DiskInterfaceEntry { + private long energyUsage = DefaultEnergyUsage.DISK_INTERFACE; + + private long energyUsagePerDisk = DefaultEnergyUsage.DISK_INTERFACE_PER_DISK; + + @Override + public long getEnergyUsage() { + return energyUsage; + } + + @Override + public long getEnergyUsagePerDisk() { + return energyUsagePerDisk; + } + } + + private static class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry { + private long energyUsage; + + SimpleEnergyUsageEntryImpl(final long energyUsage) { + this.energyUsage = energyUsage; + } + + @Override + public long getEnergyUsage() { + return energyUsage; + } + } + + private static class ControllerEntryImpl implements ControllerEntry { + private long energyCapacity = DefaultEnergyUsage.CONTROLLER_CAPACITY; + + public long getEnergyCapacity() { + return energyCapacity; + } + } + + private static class StorageBlockEntryImpl implements StorageBlockEntry { + private long oneKEnergyUsage = DefaultEnergyUsage.ONE_K_STORAGE_BLOCK; + private long fourKEnergyUsage = DefaultEnergyUsage.FOUR_K_STORAGE_BLOCK; + private long sixteenKEnergyUsage = DefaultEnergyUsage.SIXTEEN_K_STORAGE_BLOCK; + private long sixtyFourKEnergyUsage = DefaultEnergyUsage.SIXTY_FOUR_K_STORAGE_BLOCK; + private long creativeEnergyUsage = DefaultEnergyUsage.CREATIVE_STORAGE_BLOCK; + + @Override + public long get1kEnergyUsage() { + return oneKEnergyUsage; + } + + @Override + public long get4kEnergyUsage() { + return fourKEnergyUsage; + } + + @Override + public long get16kEnergyUsage() { + return sixteenKEnergyUsage; + } + + @Override + public long get64kEnergyUsage() { + return sixtyFourKEnergyUsage; + } + + @Override + public long getCreativeEnergyUsage() { + return creativeEnergyUsage; + } + } + + private static class FluidStorageBlockEntryImpl implements FluidStorageBlockEntry { + private long sixtyFourBEnergyUsage = DefaultEnergyUsage.SIXTY_FOUR_B_FLUID_STORAGE_BLOCK; + private long twoHundredFiftySixBEnergyUsage = DefaultEnergyUsage.TWO_HUNDRED_FIFTY_SIX_B_FLUID_STORAGE_BLOCK; + private long thousandTwentyFourBEnergyUsage = DefaultEnergyUsage.THOUSAND_TWENTY_FOUR_B_FLUID_STORAGE_BLOCK; + private long fourThousandNinetySixBEnergyUsage = + DefaultEnergyUsage.FOUR_THOUSAND_NINETY_SIX_B_FLUID_STORAGE_BLOCK; + private long creativeEnergyUsage = DefaultEnergyUsage.CREATIVE_FLUID_STORAGE_BLOCK; + + @Override + public long get64bEnergyUsage() { + return sixtyFourBEnergyUsage; + } + + @Override + public long get256bEnergyUsage() { + return twoHundredFiftySixBEnergyUsage; + } + + @Override + public long get1024bEnergyUsage() { + return thousandTwentyFourBEnergyUsage; + } + + @Override + public long get4096bEnergyUsage() { + return fourThousandNinetySixBEnergyUsage; + } + + @Override + public long getCreativeEnergyUsage() { + return creativeEnergyUsage; + } + } + + private static class UpgradeEntryImpl implements UpgradeEntry { + private long speedUpgradeEnergyUsage = DefaultEnergyUsage.SPEED_UPGRADE; + + private long stackUpgradeEnergyUsage = DefaultEnergyUsage.STACK_UPGRADE; + + private long fortune1UpgradeEnergyUsage = DefaultEnergyUsage.FORTUNE_1_UPGRADE; + + private long fortune2UpgradeEnergyUsage = DefaultEnergyUsage.FORTUNE_2_UPGRADE; + + private long fortune3UpgradeEnergyUsage = DefaultEnergyUsage.FORTUNE_3_UPGRADE; + + private long silkTouchUpgradeEnergyUsage = DefaultEnergyUsage.SILK_TOUCH_UPGRADE; + + private long regulatorUpgradeEnergyUsage = DefaultEnergyUsage.REGULATOR_UPGRADE; + + private long rangeUpgradeEnergyUsage = DefaultEnergyUsage.RANGE_UPGRADE; + + private long creativeRangeUpgradeEnergyUsage = DefaultEnergyUsage.CREATIVE_RANGE_UPGRADE; + + private int rangeUpgradeRange = DefaultEnergyUsage.RANGE_UPGRADE_RANGE; + + @Override + public long getSpeedUpgradeEnergyUsage() { + return speedUpgradeEnergyUsage; + } + + @Override + public long getStackUpgradeEnergyUsage() { + return stackUpgradeEnergyUsage; + } + + @Override + public long getFortune1UpgradeEnergyUsage() { + return fortune1UpgradeEnergyUsage; + } + + @Override + public long getFortune2UpgradeEnergyUsage() { + return fortune2UpgradeEnergyUsage; + } + + @Override + public long getFortune3UpgradeEnergyUsage() { + return fortune3UpgradeEnergyUsage; + } + + @Override + public long getSilkTouchUpgradeEnergyUsage() { + return silkTouchUpgradeEnergyUsage; + } + + @Override + public long getRegulatorUpgradeEnergyUsage() { + return regulatorUpgradeEnergyUsage; + } + + @Override + public long getRangeUpgradeEnergyUsage() { + return rangeUpgradeEnergyUsage; + } + + @Override + public long getCreativeRangeUpgradeEnergyUsage() { + return creativeRangeUpgradeEnergyUsage; + } + + @Override + public int getRangeUpgradeRange() { + return rangeUpgradeRange; + } + } + + private static class WirelessGridEntryImpl implements WirelessGridEntry { + private long energyCapacity = DefaultEnergyUsage.WIRELESS_GRID_CAPACITY; + + private long openEnergyUsage = DefaultEnergyUsage.WIRELESS_GRID_OPEN; + + private long insertEnergyUsage = DefaultEnergyUsage.WIRELESS_GRID_INSERT; + + private long extractEnergyUsage = DefaultEnergyUsage.WIRELESS_GRID_EXTRACT; + + @Override + public long getEnergyCapacity() { + return energyCapacity; + } + + @Override + public long getOpenEnergyUsage() { + return openEnergyUsage; + } + + @Override + public long getInsertEnergyUsage() { + return insertEnergyUsage; + } + + @Override + public long getExtractEnergyUsage() { + return extractEnergyUsage; + } + } + + private static class WirelessTransmitterEntryImpl implements WirelessTransmitterEntry { + private long energyUsage = DefaultEnergyUsage.WIRELESS_TRANSMITTER; + + private int baseRange = DefaultEnergyUsage.WIRELESS_TRANSMITTER_BASE_RANGE; + + @Override + public long getEnergyUsage() { + return energyUsage; + } + + @Override + public int getBaseRange() { + return baseRange; + } + } + + private static class PortableGridEntryImpl implements PortableGridEntry { + private long energyCapacity = DefaultEnergyUsage.PORTABLE_GRID_CAPACITY; + + private long openEnergyUsage = DefaultEnergyUsage.PORTABLE_GRID_OPEN; + + private long insertEnergyUsage = DefaultEnergyUsage.PORTABLE_GRID_INSERT; + + private long extractEnergyUsage = DefaultEnergyUsage.PORTABLE_GRID_EXTRACT; + + @Override + public long getEnergyCapacity() { + return energyCapacity; + } + + @Override + public long getOpenEnergyUsage() { + return openEnergyUsage; + } + + @Override + public long getInsertEnergyUsage() { + return insertEnergyUsage; + } + + @Override + public long getExtractEnergyUsage() { + return extractEnergyUsage; + } + } + + private static class RelayEntryImpl implements RelayEntry { + private long inputNetworkEnergyUsage = DefaultEnergyUsage.RELAY_INPUT_NETWORK; + + private long outputNetworkEnergyUsage = DefaultEnergyUsage.RELAY_OUTPUT_NETWORK; + + @Override + public long getInputNetworkEnergyUsage() { + return inputNetworkEnergyUsage; + } + + @Override + public long getOutputNetworkEnergyUsage() { + return outputNetworkEnergyUsage; + } + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ModInitializerImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ModInitializerImpl.java new file mode 100644 index 000000000..8387e7aef --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ModInitializerImpl.java @@ -0,0 +1,659 @@ +package com.refinedmods.refinedstorage.fabric; + +import com.refinedmods.refinedstorage.common.AbstractModInitializer; +import com.refinedmods.refinedstorage.common.PlatformProxy; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.AbstractNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.BlockEntityTypeFactory; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.content.CreativeModeTabItems; +import com.refinedmods.refinedstorage.common.content.DirectRegistryCallback; +import com.refinedmods.refinedstorage.common.content.ExtendedMenuTypeFactory; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.content.MenuTypeFactory; +import com.refinedmods.refinedstorage.common.content.RegistryCallback; +import com.refinedmods.refinedstorage.common.grid.WirelessGridItem; +import com.refinedmods.refinedstorage.common.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.iface.InterfacePlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.common.security.FallbackSecurityCardItem; +import com.refinedmods.refinedstorage.common.security.SecurityCardItem; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockItem; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridType; +import com.refinedmods.refinedstorage.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage.common.support.packet.PacketHandler; +import com.refinedmods.refinedstorage.common.support.packet.c2s.CraftingGridClearPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.CraftingGridRecipeTransferPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.GridExtractPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.GridInsertPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.GridScrollPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.PropertyChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.ResourceFilterSlotChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.ResourceSlotAmountChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.ResourceSlotChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.SecurityCardBoundPlayerPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.SecurityCardPermissionPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.SecurityCardResetPermissionPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.SingleAmountChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.StorageInfoRequestPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.UseSlotReferencedItemPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.EnergyInfoPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.GridActivePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.GridClearPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.GridUpdatePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.NetworkTransmitterStatusPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.NoPermissionPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.ResourceSlotUpdatePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.StorageInfoResponsePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.WirelessTransmitterRangePacket; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeItem; +import com.refinedmods.refinedstorage.common.util.ServerEventQueue; +import com.refinedmods.refinedstorage.fabric.api.RefinedStorageFabricApi; +import com.refinedmods.refinedstorage.fabric.api.RefinedStorageFabricApiProxy; +import com.refinedmods.refinedstorage.fabric.api.RefinedStoragePlugin; +import com.refinedmods.refinedstorage.fabric.exporter.FabricStorageExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.fabric.grid.strategy.FluidGridExtractionStrategy; +import com.refinedmods.refinedstorage.fabric.grid.strategy.FluidGridInsertionStrategy; +import com.refinedmods.refinedstorage.fabric.grid.strategy.ItemGridExtractionStrategy; +import com.refinedmods.refinedstorage.fabric.grid.strategy.ItemGridScrollingStrategy; +import com.refinedmods.refinedstorage.fabric.importer.FabricStorageImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.fabric.security.NetworkNodeBreakSecurityEventListener; +import com.refinedmods.refinedstorage.fabric.storage.diskdrive.FabricDiskDriveBlockEntity; +import com.refinedmods.refinedstorage.fabric.storage.diskinterface.FabricDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.fabric.storage.externalstorage.FabricStoragePlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.fabric.storage.portablegrid.FabricPortableGridBlockEntity; +import com.refinedmods.refinedstorage.fabric.support.energy.EnergyStorageAdapter; +import com.refinedmods.refinedstorage.fabric.support.resource.ResourceContainerFluidStorageAdapter; +import com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.function.Function; +import java.util.function.Predicate; + +import me.shedaniel.autoconfig.AutoConfig; +import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer; +import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; +import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; +import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; +import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; +import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.Storage; +import net.fabricmc.fabric.api.transfer.v1.storage.base.CombinedStorage; +import net.fabricmc.fabric.api.transfer.v1.storage.base.FilteringStorage; +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.world.Container; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.flag.FeatureFlags; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import team.reborn.energy.api.EnergyStorage; + +import static com.refinedmods.refinedstorage.common.content.ContentIds.CREATIVE_PORTABLE_GRID; +import static com.refinedmods.refinedstorage.common.content.ContentIds.CREATIVE_WIRELESS_GRID; +import static com.refinedmods.refinedstorage.common.content.ContentIds.FALLBACK_SECURITY_CARD; +import static com.refinedmods.refinedstorage.common.content.ContentIds.PORTABLE_GRID; +import static com.refinedmods.refinedstorage.common.content.ContentIds.REGULATOR_UPGRADE; +import static com.refinedmods.refinedstorage.common.content.ContentIds.SECURITY_CARD; +import static com.refinedmods.refinedstorage.common.content.ContentIds.WIRELESS_GRID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toFluidVariant; +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toItemVariant; + +public class ModInitializerImpl extends AbstractModInitializer implements ModInitializer { + private static final Logger LOGGER = LoggerFactory.getLogger(ModInitializerImpl.class); + private static final String PLUGIN_ENTRYPOINT_KEY = "refinedstorage_plugin"; + + @Override + public void onInitialize() { + AutoConfig.register(ConfigImpl.class, Toml4jConfigSerializer::new); + PlatformProxy.loadPlatform(new PlatformImpl()); + initializePlatformApi(); + ((RefinedStorageFabricApiProxy) RefinedStorageFabricApi.INSTANCE).setDelegate( + new RefinedStorageFabricApiImpl() + ); + registerAdditionalGridInsertionStrategyFactories(); + registerGridExtractionStrategyFactories(); + registerGridScrollingStrategyFactories(); + registerImporterTransferStrategyFactories(); + registerExporterTransferStrategyFactories(); + registerExternalStorageProviderFactories(); + registerContent(); + registerPackets(); + registerPacketHandlers(); + registerSounds(new DirectRegistryCallback<>(BuiltInRegistries.SOUND_EVENT)); + registerRecipeSerializers(new DirectRegistryCallback<>(BuiltInRegistries.RECIPE_SERIALIZER)); + registerCapabilities(); + registerTickHandler(); + registerWrenchingEvent(); + registerSecurityBlockBreakEvent(); + + final List pluginEntrypoints = FabricLoader.getInstance() + .getEntrypoints(PLUGIN_ENTRYPOINT_KEY, RefinedStoragePlugin.class); + LOGGER.debug("Loading {} Refined Storage plugin entrypoints.", pluginEntrypoints.size()); + pluginEntrypoints.forEach(plugin -> plugin.onApiAvailable(RefinedStorageApi.INSTANCE)); + + LOGGER.debug("Refined Storage has loaded."); + } + + private void registerAdditionalGridInsertionStrategyFactories() { + RefinedStorageApi.INSTANCE.addGridInsertionStrategyFactory(FluidGridInsertionStrategy::new); + } + + private void registerGridExtractionStrategyFactories() { + RefinedStorageApi.INSTANCE.addGridExtractionStrategyFactory(ItemGridExtractionStrategy::new); + RefinedStorageApi.INSTANCE.addGridExtractionStrategyFactory(FluidGridExtractionStrategy::new); + } + + private void registerGridScrollingStrategyFactories() { + RefinedStorageApi.INSTANCE.addGridScrollingStrategyFactory(ItemGridScrollingStrategy::new); + } + + private void registerImporterTransferStrategyFactories() { + RefinedStorageApi.INSTANCE.getImporterTransferStrategyRegistry().register( + createIdentifier("item"), + new FabricStorageImporterTransferStrategyFactory<>( + ItemStorage.SIDED, + VariantUtil::ofItemVariant, + resource -> resource instanceof ItemResource itemResource + ? toItemVariant(itemResource) : null, + 1 + ) + ); + RefinedStorageApi.INSTANCE.getImporterTransferStrategyRegistry().register( + createIdentifier("fluid"), + new FabricStorageImporterTransferStrategyFactory<>( + FluidStorage.SIDED, + VariantUtil::ofFluidVariant, + resource -> resource instanceof FluidResource fluidResource + ? toFluidVariant(fluidResource) : null, + FluidConstants.BUCKET + ) + ); + } + + private void registerExporterTransferStrategyFactories() { + RefinedStorageApi.INSTANCE.getExporterTransferStrategyRegistry().register( + createIdentifier("item"), + new FabricStorageExporterTransferStrategyFactory<>( + ItemStorage.SIDED, + resource -> resource instanceof ItemResource itemResource + ? toItemVariant(itemResource) : null, + 1 + ) + ); + RefinedStorageApi.INSTANCE.getExporterTransferStrategyRegistry().register( + createIdentifier("fluid"), + new FabricStorageExporterTransferStrategyFactory<>( + FluidStorage.SIDED, + resource -> resource instanceof FluidResource fluidResource + ? toFluidVariant(fluidResource) : null, + FluidConstants.BUCKET + ) + ); + } + + private void registerExternalStorageProviderFactories() { + RefinedStorageApi.INSTANCE.addExternalStorageProviderFactory( + new InterfacePlatformExternalStorageProviderFactory() + ); + RefinedStorageApi.INSTANCE.addExternalStorageProviderFactory( + new FabricStoragePlatformExternalStorageProviderFactory<>( + ItemStorage.SIDED, + VariantUtil::ofItemVariant, + resource -> resource instanceof ItemResource itemResource + ? toItemVariant(itemResource) : null + ) + ); + RefinedStorageApi.INSTANCE.addExternalStorageProviderFactory( + new FabricStoragePlatformExternalStorageProviderFactory<>( + FluidStorage.SIDED, + VariantUtil::ofFluidVariant, + resource -> resource instanceof FluidResource fluidResource + ? toFluidVariant(fluidResource) : null + ) + ); + } + + private void registerContent() { + registerBlocks( + new DirectRegistryCallback<>(BuiltInRegistries.BLOCK), + FabricDiskDriveBlockEntity::new, + (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.NORMAL, pos, state), + (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.CREATIVE, pos, state), + FabricDiskInterfaceBlockEntity::new + ); + final DirectRegistryCallback itemRegistryCallback = new DirectRegistryCallback<>(BuiltInRegistries.ITEM); + registerItems(itemRegistryCallback); + registerCustomItems(itemRegistryCallback); + registerUpgradeMappings(); + registerCreativeModeTab(); + registerBlockEntities( + new DirectRegistryCallback<>(BuiltInRegistries.BLOCK_ENTITY_TYPE), + new BlockEntityTypeFactory() { + @SuppressWarnings("DataFlowIssue") // data type can be null + @Override + public BlockEntityType create(final BlockEntitySupplier factory, + final Block... allowedBlocks) { + return new BlockEntityType<>(factory::create, new HashSet<>(Arrays.asList(allowedBlocks)), null); + } + }, + FabricDiskDriveBlockEntity::new, + (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.NORMAL, pos, state), + (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.CREATIVE, pos, state), + FabricDiskInterfaceBlockEntity::new + ); + registerMenus(new DirectRegistryCallback<>(BuiltInRegistries.MENU), new MenuTypeFactory() { + @Override + public MenuType create(final MenuSupplier supplier) { + return new MenuType<>(supplier::create, FeatureFlags.DEFAULT_FLAGS); + } + }, new ExtendedMenuTypeFactory() { + @Override + public MenuType create(final MenuSupplier supplier, + final StreamCodec + streamCodec) { + return new ExtendedScreenHandlerType<>(supplier::create, streamCodec); + } + }); + registerLootFunctions(new DirectRegistryCallback<>(BuiltInRegistries.LOOT_FUNCTION_TYPE)); + registerDataComponents(new DirectRegistryCallback<>(BuiltInRegistries.DATA_COMPONENT_TYPE)); + } + + private void registerCustomItems(final RegistryCallback callback) { + Items.INSTANCE.setRegulatorUpgrade(callback.register(REGULATOR_UPGRADE, () -> new RegulatorUpgradeItem( + RefinedStorageApi.INSTANCE.getUpgradeRegistry() + ) { + @Override + public boolean allowComponentsUpdateAnimation(final Player player, + final InteractionHand hand, + final ItemStack oldStack, + final ItemStack newStack) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + })); + Items.INSTANCE.setWirelessGrid(callback.register(WIRELESS_GRID, () -> new WirelessGridItem() { + @Override + public boolean allowComponentsUpdateAnimation(final Player player, + final InteractionHand hand, + final ItemStack oldStack, + final ItemStack newStack) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + })); + Items.INSTANCE.setCreativeWirelessGrid(callback.register( + CREATIVE_WIRELESS_GRID, + () -> new WirelessGridItem() { + @Override + public boolean allowComponentsUpdateAnimation(final Player player, + final InteractionHand hand, + final ItemStack oldStack, + final ItemStack newStack) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + } + )); + Items.INSTANCE.setPortableGrid(callback.register(PORTABLE_GRID, () -> new PortableGridBlockItem( + Blocks.INSTANCE.getPortableGrid(), PortableGridType.NORMAL + ) { + @Override + public boolean allowComponentsUpdateAnimation(final Player player, + final InteractionHand hand, + final ItemStack oldStack, + final ItemStack newStack) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + })); + Items.INSTANCE.setCreativePortableGrid(callback.register( + CREATIVE_PORTABLE_GRID, + () -> new PortableGridBlockItem(Blocks.INSTANCE.getCreativePortableGrid(), PortableGridType.CREATIVE) { + @Override + public boolean allowComponentsUpdateAnimation(final Player player, + final InteractionHand hand, + final ItemStack oldStack, + final ItemStack newStack) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + } + )); + Items.INSTANCE.setSecurityCard(callback.register(SECURITY_CARD, () -> new SecurityCardItem() { + @Override + public boolean allowComponentsUpdateAnimation(final Player player, + final InteractionHand hand, + final ItemStack oldStack, + final ItemStack newStack) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + })); + Items.INSTANCE.setFallbackSecurityCard(callback.register( + FALLBACK_SECURITY_CARD, + () -> new FallbackSecurityCardItem() { + @Override + public boolean allowComponentsUpdateAnimation(final Player player, + final InteractionHand hand, + final ItemStack oldStack, + final ItemStack newStack) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + } + )); + } + + private void registerCreativeModeTab() { + Registry.register( + BuiltInRegistries.CREATIVE_MODE_TAB, + createIdentifier("general"), + CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0) + .title(ContentNames.MOD) + .icon(() -> new ItemStack(Blocks.INSTANCE.getCreativeController().getDefault())) + .displayItems((params, output) -> CreativeModeTabItems.append(output::accept)) + .build() + ); + } + + private void registerPackets() { + registerServerToClientPackets(); + registerClientToServerPackets(); + } + + private void registerServerToClientPackets() { + PayloadTypeRegistry.playS2C().register(EnergyInfoPacket.PACKET_TYPE, EnergyInfoPacket.STREAM_CODEC); + PayloadTypeRegistry.playS2C().register( + WirelessTransmitterRangePacket.PACKET_TYPE, + WirelessTransmitterRangePacket.STREAM_CODEC + ); + PayloadTypeRegistry.playS2C().register(GridActivePacket.PACKET_TYPE, GridActivePacket.STREAM_CODEC); + PayloadTypeRegistry.playS2C().register(GridClearPacket.PACKET_TYPE, GridClearPacket.STREAM_CODEC); + PayloadTypeRegistry.playS2C().register(GridUpdatePacket.PACKET_TYPE, GridUpdatePacket.STREAM_CODEC); + PayloadTypeRegistry.playS2C().register( + NetworkTransmitterStatusPacket.PACKET_TYPE, + NetworkTransmitterStatusPacket.STREAM_CODEC + ); + PayloadTypeRegistry.playS2C().register( + NoPermissionPacket.PACKET_TYPE, + NoPermissionPacket.STREAM_CODEC + ); + PayloadTypeRegistry.playS2C().register( + ResourceSlotUpdatePacket.PACKET_TYPE, + ResourceSlotUpdatePacket.STREAM_CODEC + ); + PayloadTypeRegistry.playS2C().register( + StorageInfoResponsePacket.PACKET_TYPE, + StorageInfoResponsePacket.STREAM_CODEC + ); + } + + private void registerClientToServerPackets() { + PayloadTypeRegistry.playC2S().register( + CraftingGridClearPacket.PACKET_TYPE, + CraftingGridClearPacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register( + CraftingGridRecipeTransferPacket.PACKET_TYPE, + CraftingGridRecipeTransferPacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register(GridExtractPacket.PACKET_TYPE, GridExtractPacket.STREAM_CODEC); + PayloadTypeRegistry.playC2S().register(GridInsertPacket.PACKET_TYPE, GridInsertPacket.STREAM_CODEC); + PayloadTypeRegistry.playC2S().register(GridScrollPacket.PACKET_TYPE, GridScrollPacket.STREAM_CODEC); + PayloadTypeRegistry.playC2S().register(PropertyChangePacket.PACKET_TYPE, PropertyChangePacket.STREAM_CODEC); + PayloadTypeRegistry.playC2S().register( + ResourceFilterSlotChangePacket.PACKET_TYPE, + ResourceFilterSlotChangePacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register( + ResourceSlotAmountChangePacket.PACKET_TYPE, + ResourceSlotAmountChangePacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register( + ResourceSlotChangePacket.PACKET_TYPE, + ResourceSlotChangePacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register( + SecurityCardBoundPlayerPacket.PACKET_TYPE, + SecurityCardBoundPlayerPacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register( + SecurityCardPermissionPacket.PACKET_TYPE, + SecurityCardPermissionPacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register( + SecurityCardResetPermissionPacket.PACKET_TYPE, + SecurityCardResetPermissionPacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register( + SingleAmountChangePacket.PACKET_TYPE, + SingleAmountChangePacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register( + StorageInfoRequestPacket.PACKET_TYPE, + StorageInfoRequestPacket.STREAM_CODEC + ); + PayloadTypeRegistry.playC2S().register( + UseSlotReferencedItemPacket.PACKET_TYPE, + UseSlotReferencedItemPacket.STREAM_CODEC + ); + } + + private void registerPacketHandlers() { + ServerPlayNetworking.registerGlobalReceiver( + StorageInfoRequestPacket.PACKET_TYPE, + wrapHandler(StorageInfoRequestPacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + GridInsertPacket.PACKET_TYPE, + wrapHandler(GridInsertPacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + GridExtractPacket.PACKET_TYPE, + wrapHandler(GridExtractPacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + GridScrollPacket.PACKET_TYPE, + wrapHandler(GridScrollPacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + CraftingGridClearPacket.PACKET_TYPE, + wrapHandler(CraftingGridClearPacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + CraftingGridRecipeTransferPacket.PACKET_TYPE, + wrapHandler(CraftingGridRecipeTransferPacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + PropertyChangePacket.PACKET_TYPE, + wrapHandler(PropertyChangePacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + ResourceSlotAmountChangePacket.PACKET_TYPE, + wrapHandler(ResourceSlotAmountChangePacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + ResourceFilterSlotChangePacket.PACKET_TYPE, + wrapHandler(ResourceFilterSlotChangePacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + ResourceSlotChangePacket.PACKET_TYPE, + wrapHandler(ResourceSlotChangePacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + SingleAmountChangePacket.PACKET_TYPE, + wrapHandler(SingleAmountChangePacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + UseSlotReferencedItemPacket.PACKET_TYPE, + wrapHandler(UseSlotReferencedItemPacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + SecurityCardPermissionPacket.PACKET_TYPE, + wrapHandler(SecurityCardPermissionPacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + SecurityCardResetPermissionPacket.PACKET_TYPE, + wrapHandler(SecurityCardResetPermissionPacket::handle) + ); + ServerPlayNetworking.registerGlobalReceiver( + SecurityCardBoundPlayerPacket.PACKET_TYPE, + wrapHandler(SecurityCardBoundPlayerPacket::handle) + ); + } + + private static ServerPlayNetworking.PlayPayloadHandler wrapHandler( + final PacketHandler handler + ) { + return (packet, ctx) -> handler.handle(packet, ctx::player); + } + + private void registerCapabilities() { + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getCable()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getConstructor()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getController()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getCraftingGrid()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getCreativeController()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getDestructor()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getDetector()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getDiskDrive()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getDiskInterface()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getExporter()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getExternalStorage()); + Arrays.stream(FluidStorageVariant.values()).forEach(type -> + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getFluidStorageBlock(type))); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getGrid()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getImporter()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getInterface()); + Arrays.stream(ItemStorageVariant.values()).forEach(type -> + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getItemStorageBlock(type))); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getNetworkReceiver()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getNetworkTransmitter()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getRelay()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getSecurityManager()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getStorageMonitor()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getWirelessTransmitter()); + registerItemStorage( + AbstractDiskDriveBlockEntity.class::isInstance, + AbstractDiskDriveBlockEntity.class::cast, + AbstractDiskDriveBlockEntity::getDiskInventory, + BlockEntities.INSTANCE.getDiskDrive() + ); + registerItemStorage( + InterfaceBlockEntity.class::isInstance, + InterfaceBlockEntity.class::cast, + InterfaceBlockEntity::getExportedResourcesAsContainer, + BlockEntities.INSTANCE.getInterface() + ); + ItemStorage.SIDED.registerForBlockEntity((blockEntity, context) -> { + final InventoryStorage storage = InventoryStorage.of(blockEntity.getDiskInventory(), context); + final List> parts = new ArrayList<>(); + for (int i = 0; i < AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS; ++i) { + final var slot = storage.getSlot(i); + parts.add(i < 3 ? FilteringStorage.insertOnlyOf(slot) : FilteringStorage.extractOnlyOf(slot)); + } + return new CombinedStorage<>(parts); + }, BlockEntities.INSTANCE.getDiskInterface()); + FluidStorage.SIDED.registerForBlockEntity( + (blockEntity, context) -> new ResourceContainerFluidStorageAdapter(blockEntity.getExportedResources()), + BlockEntities.INSTANCE.getInterface() + ); + registerEnergyBlockEntityProviders(); + registerEnergyItemProviders(); + } + + private void registerNetworkNodeContainerProvider( + final BlockEntityType> type + ) { + RefinedStorageFabricApi.INSTANCE.getNetworkNodeContainerProviderLookup().registerForBlockEntity( + (be, dir) -> be.getContainerProvider(), + type + ); + } + + private void registerItemStorage(final Predicate test, + final Function caster, + final Function containerSupplier, + final BlockEntityType type) { + ItemStorage.SIDED.registerForBlockEntities((blockEntity, context) -> { + if (test.test(blockEntity)) { + final T casted = caster.apply(blockEntity); + return InventoryStorage.of(containerSupplier.apply(casted), context); + } + return null; + }, type); + } + + private void registerEnergyBlockEntityProviders() { + EnergyStorage.SIDED.registerForBlockEntity( + (blockEntity, context) -> new EnergyStorageAdapter(blockEntity.getEnergyStorage()), + BlockEntities.INSTANCE.getController() + ); + EnergyStorage.SIDED.registerForBlockEntity( + (blockEntity, context) -> new EnergyStorageAdapter(blockEntity.getEnergyStorage()), + BlockEntities.INSTANCE.getPortableGrid() + ); + } + + private void registerEnergyItemProviders() { + EnergyStorage.ITEM.registerForItems( + (stack, context) -> new EnergyStorageAdapter(Items.INSTANCE.getWirelessGrid().createEnergyStorage(stack)), + Items.INSTANCE.getWirelessGrid() + ); + Items.INSTANCE.getControllers().forEach(controller -> EnergyStorage.ITEM.registerForItems( + (stack, context) -> new EnergyStorageAdapter(controller.get().createEnergyStorage(stack)), + controller.get() + )); + EnergyStorage.ITEM.registerForItems( + (stack, context) -> new EnergyStorageAdapter(PortableGridBlockItem.createEnergyStorage(stack)), + Items.INSTANCE.getPortableGrid() + ); + } + + private void registerTickHandler() { + ServerTickEvents.START_SERVER_TICK.register(server -> ServerEventQueue.runQueuedActions()); + } + + private void registerWrenchingEvent() { + UseBlockCallback.EVENT.register((player, level, hand, hitResult) -> { + final BlockState state = level.getBlockState(hitResult.getBlockPos()); + if (!(state.getBlock() instanceof AbstractBaseBlock block)) { + return InteractionResult.PASS; + } + return block.tryUseWrench(state, level, hitResult, player, hand) + .or(() -> block.tryUpdateColor(state, level, hitResult.getBlockPos(), player, hand)) + .orElse(InteractionResult.PASS); + }); + } + + private void registerSecurityBlockBreakEvent() { + PlayerBlockBreakEvents.BEFORE.register(new NetworkNodeBreakSecurityEventListener()); + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/PlatformImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/PlatformImpl.java new file mode 100644 index 000000000..169862220 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/PlatformImpl.java @@ -0,0 +1,487 @@ +package com.refinedmods.refinedstorage.fabric; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.AbstractPlatform; +import com.refinedmods.refinedstorage.common.Config; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; +import com.refinedmods.refinedstorage.common.support.containermenu.TransferManager; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.util.CustomBlockPlaceContext; +import com.refinedmods.refinedstorage.fabric.api.RefinedStorageFabricApi; +import com.refinedmods.refinedstorage.fabric.grid.strategy.ItemGridInsertionStrategy; +import com.refinedmods.refinedstorage.fabric.grid.view.FabricFluidGridResourceFactory; +import com.refinedmods.refinedstorage.fabric.grid.view.FabricItemGridResourceFactory; +import com.refinedmods.refinedstorage.fabric.mixin.EditBoxAccessor; +import com.refinedmods.refinedstorage.fabric.mixin.KeyMappingAccessor; +import com.refinedmods.refinedstorage.fabric.support.containermenu.ContainerTransferDestination; +import com.refinedmods.refinedstorage.fabric.support.containermenu.MenuOpenerImpl; +import com.refinedmods.refinedstorage.fabric.support.energy.EnergyStorageAdapter; +import com.refinedmods.refinedstorage.fabric.support.render.FluidVariantFluidRenderer; +import com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil; +import com.refinedmods.refinedstorage.fabric.util.SimpleSingleStackStorage; + +import java.io.File; +import java.io.IOException; +import java.nio.file.AtomicMoveNotSupportedException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.function.BiConsumer; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +import com.mojang.blaze3d.platform.InputConstants; +import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; +import net.fabricmc.fabric.api.entity.FakePlayer; +import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; +import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; +import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.Storage; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil; +import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; +import net.fabricmc.fabric.impl.transfer.context.ConstantContainerItemContext; +import net.minecraft.client.KeyMapping; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.components.EditBox; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.client.gui.screens.inventory.tooltip.DefaultTooltipPositioner; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.NonNullList; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtIo; +import net.minecraft.nbt.NbtUtils; +import net.minecraft.network.chat.Component; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.tags.FluidTags; +import net.minecraft.world.Container; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.CraftingContainer; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.item.crafting.CraftingInput; +import net.minecraft.world.item.crafting.CraftingRecipe; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.LiquidBlock; +import net.minecraft.world.level.block.LiquidBlockContainer; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.chunk.LevelChunk; +import net.minecraft.world.level.gameevent.GameEvent; +import net.minecraft.world.level.material.FlowingFluid; +import net.minecraft.world.level.material.Fluid; +import net.minecraft.world.level.material.Fluids; +import net.minecraft.world.level.saveddata.SavedData; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.Vec3; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toFluidVariant; +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toItemVariant; + +public final class PlatformImpl extends AbstractPlatform { + private static final Logger LOGGER = LoggerFactory.getLogger(PlatformImpl.class); + + public PlatformImpl() { + super(new MenuOpenerImpl(), new FluidVariantFluidRenderer(), ItemGridInsertionStrategy::new); + } + + @Override + public long getBucketAmount() { + return FluidConstants.BUCKET; + } + + @Override + public Config getConfig() { + return ConfigImpl.get(); + } + + @Override + public boolean canEditBoxLoseFocus(final EditBox editBox) { + return ((EditBoxAccessor) editBox).getCanLoseFocus(); + } + + @Override + public boolean isKeyDown(final KeyMapping keyMapping) { + return !keyMapping.isUnbound() && InputConstants.isKeyDown( + Minecraft.getInstance().getWindow().getWindow(), + ((KeyMappingAccessor) keyMapping).getKey().getValue() + ); + } + + @Override + public GridResourceFactory getItemGridResourceFactory() { + return new FabricItemGridResourceFactory(); + } + + @Override + public GridResourceFactory getFluidGridResourceFactory() { + return new FabricFluidGridResourceFactory(); + } + + @Override + public Optional drainContainer(final ItemStack container) { + if (container.isEmpty()) { + return Optional.empty(); + } + final SimpleSingleStackStorage interceptingStorage = new SimpleSingleStackStorage(container); + final Storage storage = FluidStorage.ITEM.find(container, ContainerItemContext.ofSingleSlot( + interceptingStorage + )); + try (Transaction tx = Transaction.openOuter()) { + final var extracted = StorageUtil.extractAny(storage, Long.MAX_VALUE, tx); + if (extracted == null) { + return Optional.empty(); + } + return Optional.of(new FluidOperationResult( + interceptingStorage.getStack(), + VariantUtil.ofFluidVariant(extracted.resource()), + extracted.amount() + )); + } + } + + @Override + public Optional fillContainer(final ItemStack container, + final ResourceAmount resourceAmount) { + if (!(resourceAmount.getResource() instanceof FluidResource fluidResource)) { + return Optional.empty(); + } + final SimpleSingleStackStorage interceptingStorage = new SimpleSingleStackStorage(container); + final Storage storage = FluidStorage.ITEM.find(container, ContainerItemContext.ofSingleSlot( + interceptingStorage + )); + if (storage == null) { + return Optional.empty(); + } + try (Transaction tx = Transaction.openOuter()) { + final long inserted = storage.insert(toFluidVariant(fluidResource), resourceAmount.getAmount(), tx); + return Optional.of(new FluidOperationResult( + interceptingStorage.getStack(), + fluidResource, + inserted + )); + } + } + + @Override + public Optional getFilledBucket(final FluidResource fluidResource) { + final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); + final Storage destination = FluidStorage.ITEM.find( + interceptingStorage.getStack(), + ContainerItemContext.ofSingleSlot(interceptingStorage) + ); + if (destination == null) { + return Optional.empty(); + } + try (Transaction tx = Transaction.openOuter()) { + destination.insert(toFluidVariant(fluidResource), FluidConstants.BUCKET, tx); + return Optional.of(interceptingStorage.getStack()); + } + } + + @Override + public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) { + return new TransferManager(containerMenu, ContainerTransferDestination::new); + } + + @Override + public long insertIntoContainer(final Container container, + final ItemResource itemResource, + final long amount, + final Action action) { + try (Transaction tx = Transaction.openOuter()) { + final long inserted = InventoryStorage + .of(container, null) + .insert(toItemVariant(itemResource), amount, tx); + if (action == Action.EXECUTE) { + tx.commit(); + } + return inserted; + } + } + + @Override + public ItemStack getCloneItemStack(final BlockState state, + final Level level, + final BlockHitResult hitResult, + final Player player) { + return state.getBlock().getCloneItemStack(level, hitResult.getBlockPos(), state); + } + + @Override + public NonNullList getRemainingCraftingItems(final Player player, + final CraftingRecipe craftingRecipe, + final CraftingInput input) { + return craftingRecipe.getRemainingItems(input); + } + + @Override + public void onItemCrafted(final Player player, final ItemStack craftedStack, final CraftingContainer container) { + // no op + } + + @Override + public Player getFakePlayer(final ServerLevel level, @Nullable final UUID playerId) { + return Optional.ofNullable(playerId) + .flatMap(id -> level.getServer().getProfileCache().get(id)) + .map(profile -> FakePlayer.get(level, profile)) + .orElseGet(() -> FakePlayer.get(level)); + } + + @Override + public boolean canBreakBlock(final Level level, final BlockPos pos, final BlockState state, final Player player) { + return PlayerBlockBreakEvents.BEFORE.invoker().beforeBlockBreak( + level, + player, + pos, + state, + level.getBlockEntity(pos) + ); + } + + @Override + public boolean placeBlock( + final Level level, + final BlockPos pos, + final Direction direction, + final Player player, + final ItemStack stack + ) { + final BlockPlaceContext ctx = new CustomBlockPlaceContext( + level, + player, + InteractionHand.MAIN_HAND, + stack, + new BlockHitResult(Vec3.ZERO, direction, pos, false) + ); + final InteractionResult result = stack.useOn(ctx); + return result.consumesAction(); + } + + @Override + public boolean placeFluid( + final Level level, + final BlockPos pos, + final Direction direction, + final Player player, + final FluidResource fluidResource + ) { + // Stolen from BucketItem#emptyContents + final Fluid content = fluidResource.fluid(); + if (!(content instanceof FlowingFluid)) { + return false; + } + final BlockState blockState = level.getBlockState(pos); + final Block block = blockState.getBlock(); + final boolean replaceable = blockState.canBeReplaced(content); + final boolean canPlace = blockState.isAir() + || replaceable + || (block instanceof LiquidBlockContainer lbc + && lbc.canPlaceLiquid(player, level, pos, blockState, content)); + if (!canPlace || blockState.getFluidState().isSource()) { + return false; + } else if (block instanceof LiquidBlockContainer lbc && content == Fluids.WATER) { + lbc.placeLiquid(level, pos, blockState, ((FlowingFluid) content).getSource(false)); + playEmptySound(content, player, level, pos); + return true; + } + return doPlaceFluid(level, pos, player, content, blockState, replaceable); + } + + @SuppressWarnings("deprecation") + private boolean doPlaceFluid(final Level level, + final BlockPos pos, + final Player player, + final Fluid content, + final BlockState blockState, + final boolean replaceable) { + if (replaceable && !blockState.liquid()) { + level.destroyBlock(pos, true); + } + if (!level.setBlock(pos, content.defaultFluidState().createLegacyBlock(), 11) + && !blockState.getFluidState().isSource()) { + return false; + } + playEmptySound(content, player, level, pos); + return true; + } + + @SuppressWarnings("deprecation") + private void playEmptySound(final Fluid content, final Player player, final LevelAccessor level, + final BlockPos pos) { + final SoundEvent soundEvent = content.is(FluidTags.LAVA) + ? SoundEvents.BUCKET_EMPTY_LAVA + : SoundEvents.BUCKET_EMPTY; + level.playSound(player, pos, soundEvent, SoundSource.BLOCKS, 1.0F, 1.0F); + level.gameEvent(player, GameEvent.FLUID_PLACE, pos); + } + + @Override + public ItemStack getBlockAsItemStack(final Block block, + final BlockState state, + final Direction direction, + final LevelReader level, + final BlockPos position, + final Player player) { + return block.getCloneItemStack(level, position, state); + } + + @Override + public Optional getBucketPickupSound(final LiquidBlock liquidBlock, final BlockState state) { + return liquidBlock.getPickupSound(); + } + + @Override + public List processTooltipComponents(final ItemStack stack, + final GuiGraphics graphics, + final int mouseX, + final Optional imageComponent, + final List components) { + final List processedComponents = components + .stream() + .map(Component::getVisualOrderText) + .map(ClientTooltipComponent::create) + .collect(Collectors.toList()); + imageComponent.ifPresent(image -> processedComponents.add(1, ClientTooltipComponent.create(image))); + return processedComponents; + } + + @Override + public void renderTooltip(final GuiGraphics graphics, + final List components, + final int x, + final int y) { + graphics.renderTooltipInternal( + Minecraft.getInstance().font, + components, + x, + y, + DefaultTooltipPositioner.INSTANCE + ); + } + + @Override + public Optional getEnergyStorage(final ItemStack stack) { + final ConstantContainerItemContext ctx = new ConstantContainerItemContext( + ItemVariant.of(stack), + stack.getCount() + ); + return Optional.ofNullable(team.reborn.energy.api.EnergyStorage.ITEM.find(stack, ctx)) + .filter(EnergyStorageAdapter.class::isInstance) + .map(EnergyStorageAdapter.class::cast) + .map(EnergyStorageAdapter::getEnergyStorage); + } + + @Override + public void sendPacketToServer(final T packet) { + ClientPlayNetworking.send(packet); + } + + @Override + public void sendPacketToClient(final ServerPlayer player, final T packet) { + ServerPlayNetworking.send(player, packet); + } + + @Override + public void saveSavedData(final SavedData savedData, + final File file, + final HolderLookup.Provider provider, + final BiConsumer defaultSaveFunction) { + if (!savedData.isDirty()) { + return; + } + final var targetPath = file.toPath().toAbsolutePath(); + final var tempFile = targetPath.getParent().resolve(file.getName() + ".temp"); + final CompoundTag compoundTag = new CompoundTag(); + compoundTag.put("data", savedData.save(new CompoundTag(), provider)); + NbtUtils.addCurrentDataVersion(compoundTag); + try { + doSave(compoundTag, tempFile, targetPath); + } catch (final IOException e) { + LOGGER.error("Could not save data", e); + } + savedData.setDirty(false); + } + + @Nullable + @Override + public NetworkNodeContainerProvider getContainerProvider(final Level level, + final BlockPos pos, + @Nullable final Direction direction) { + return RefinedStorageFabricApi.INSTANCE.getNetworkNodeContainerProviderLookup().find(level, pos, direction); + } + + @Nullable + @Override + public NetworkNodeContainerProvider getContainerProviderSafely(final Level level, + final BlockPos pos, + @Nullable final Direction direction) { + if (!level.isLoaded(pos)) { + return null; + } + // Avoid using EntityCreationType.IMMEDIATE. + // By default, the block is removed first and then the block entity (see BaseBlock#onRemove). + // But, when using mods like "Carrier", "Carpet" or "Carry On" that allow for moving block entities, + // they remove the block entity first and then the block. + // When removing a block with Carrier for example, + // this causes a problematic situation that the block entity IS gone, + // but that the #getBlockEntity() call here with type IMMEDIATE would recreate the block entity because + // the block is still there. + // If the block entity is returned here again even if it is removed, the preconditions in NetworkBuilder will + // fail as the "removed" block entity/connection would still be present. + final BlockEntity safeBlockEntity = level.getChunkAt(pos).getBlockEntity( + pos, + LevelChunk.EntityCreationType.CHECK + ); + if (safeBlockEntity == null) { + return null; + } + return RefinedStorageFabricApi.INSTANCE.getNetworkNodeContainerProviderLookup().find( + level, + pos, + level.getBlockState(pos), + safeBlockEntity, + direction + ); + } + + private void doSave(final CompoundTag compoundTag, final Path tempFile, final Path targetPath) throws IOException { + // Write to temp file first. + NbtIo.writeCompressed(compoundTag, tempFile); + // Try atomic move + try { + Files.move(tempFile, targetPath, StandardCopyOption.ATOMIC_MOVE); + } catch (final AtomicMoveNotSupportedException ignored) { + Files.move(tempFile, targetPath, StandardCopyOption.REPLACE_EXISTING); + } + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/RefinedStorageFabricApiImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/RefinedStorageFabricApiImpl.java new file mode 100644 index 000000000..e129a4bdf --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/RefinedStorageFabricApiImpl.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.fabric; + +import com.refinedmods.refinedstorage.api.core.NullableType; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.fabric.api.RefinedStorageFabricApi; + +import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup; +import net.minecraft.core.Direction; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public class RefinedStorageFabricApiImpl implements RefinedStorageFabricApi { + private final BlockApiLookup networkNodeContainerProvider = + BlockApiLookup.get( + createIdentifier("network_node_container_provider"), + NetworkNodeContainerProvider.class, + Direction.class + ); + + @Override + public BlockApiLookup getNetworkNodeContainerProviderLookup() { + return networkNodeContainerProvider; + } +} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java similarity index 82% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java index d8b7465cc..21cdd0551 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage.platform.fabric.exporter; +package com.refinedmods.refinedstorage.fabric.exporter; import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterTransferStrategyImpl; import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.exporter.FuzzyExporterTransferStrategy; -import com.refinedmods.refinedstorage.platform.fabric.storage.FabricStorageInsertableStorage; +import com.refinedmods.refinedstorage.common.api.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.exporter.FuzzyExporterTransferStrategy; +import com.refinedmods.refinedstorage.fabric.storage.FabricStorageInsertableStorage; import java.util.function.Function; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/exporter/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/exporter/package-info.java new file mode 100644 index 000000000..095587579 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/exporter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.exporter; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridExtractionStrategy.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridExtractionStrategy.java new file mode 100644 index 000000000..fab9c3b53 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridExtractionStrategy.java @@ -0,0 +1,149 @@ +package com.refinedmods.refinedstorage.fabric.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.api.storage.EmptyActor; +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; +import com.refinedmods.refinedstorage.fabric.util.SimpleSingleStackStorage; + +import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.Items; + +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toFluidVariant; + +public class FluidGridExtractionStrategy implements GridExtractionStrategy { + private static final ItemVariant BUCKET_ITEM_VARIANT = ItemVariant.of(Items.BUCKET); + private static final ItemResource BUCKET_ITEM_RESOURCE = new ItemResource(Items.BUCKET); + + private final GridOperations gridOperations; + private final PlayerInventoryStorage playerInventoryStorage; + private final net.fabricmc.fabric.api.transfer.v1.storage.Storage playerCursorStorage; + private final Storage itemStorage; + + public FluidGridExtractionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + this.gridOperations = grid.createOperations(ResourceTypes.FLUID, player); + this.playerInventoryStorage = PlayerInventoryStorage.of(player.getInventory()); + this.playerCursorStorage = PlayerInventoryStorage.getCursorStorage(containerMenu); + this.itemStorage = grid.getItemStorage(); + } + + @Override + public boolean onExtract(final PlatformResourceKey resource, + final GridExtractMode extractMode, + final boolean cursor) { + if (resource instanceof FluidResource fluidResource) { + final boolean bucketInInventory = hasBucketInInventory(); + final boolean bucketInStorage = hasBucketInStorage(); + if (bucketInInventory) { + extractWithBucketInInventory(fluidResource, extractMode, cursor); + } else if (bucketInStorage) { + extractWithBucketInStorage(fluidResource, extractMode, cursor); + } + return true; + } + return false; + } + + private void extractWithBucketInStorage(final FluidResource fluidResource, + final GridExtractMode mode, + final boolean cursor) { + final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); + final net.fabricmc.fabric.api.transfer.v1.storage.Storage destination = FluidStorage.ITEM.find( + interceptingStorage.getStack(), + ContainerItemContext.ofSingleSlot(interceptingStorage) + ); + if (destination == null) { + return; + } + gridOperations.extract(fluidResource, mode, (resource, amount, action, source) -> { + if (!(resource instanceof FluidResource fluidResource2)) { + return 0; + } + try (Transaction tx = Transaction.openOuter()) { + final long inserted = destination.insert(toFluidVariant(fluidResource2), amount, tx); + final boolean couldInsertBucket = insertResultingBucketIntoInventory(interceptingStorage, cursor, tx); + if (!couldInsertBucket) { + return 0; + } + if (action == Action.EXECUTE) { + itemStorage.extract(BUCKET_ITEM_RESOURCE, 1, Action.EXECUTE, source); + tx.commit(); + } + return inserted; + } + }); + } + + private void extractWithBucketInInventory(final FluidResource fluidResource, + final GridExtractMode mode, + final boolean cursor) { + try (Transaction tx = Transaction.openOuter()) { + playerInventoryStorage.extract(BUCKET_ITEM_VARIANT, 1, tx); + final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); + final net.fabricmc.fabric.api.transfer.v1.storage.Storage dest = FluidStorage.ITEM.find( + interceptingStorage.getStack(), + ContainerItemContext.ofSingleSlot(interceptingStorage) + ); + if (dest == null) { + return; + } + gridOperations.extract(fluidResource, mode, (resource, amount, action, source) -> { + if (!(resource instanceof FluidResource fluidResource2)) { + return 0; + } + try (Transaction innerTx = tx.openNested()) { + final long inserted = dest.insert(toFluidVariant(fluidResource2), amount, innerTx); + final boolean couldInsertBucket = insertResultingBucketIntoInventory( + interceptingStorage, + cursor, + innerTx + ); + if (!couldInsertBucket) { + return 0; + } + if (action == Action.EXECUTE) { + innerTx.commit(); + tx.commit(); + } + return inserted; + } + }); + } + } + + private boolean insertResultingBucketIntoInventory(final SimpleSingleStackStorage interceptingStorage, + final boolean cursor, + final Transaction innerTx) { + final net.fabricmc.fabric.api.transfer.v1.storage.Storage relevantStorage = cursor + ? playerCursorStorage + : playerInventoryStorage; + final ItemVariant itemVariant = ItemVariant.of(interceptingStorage.getStack()); + return relevantStorage.insert(itemVariant, 1, innerTx) != 0; + } + + private boolean hasBucketInInventory() { + try (Transaction tx = Transaction.openOuter()) { + return playerInventoryStorage.extract(BUCKET_ITEM_VARIANT, 1, tx) == 1; + } + } + + private boolean hasBucketInStorage() { + return itemStorage.extract(BUCKET_ITEM_RESOURCE, 1, Action.SIMULATE, EmptyActor.INSTANCE) == 1; + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridInsertionStrategy.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridInsertionStrategy.java new file mode 100644 index 000000000..c61f43376 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridInsertionStrategy.java @@ -0,0 +1,112 @@ +package com.refinedmods.refinedstorage.fabric.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; + +import javax.annotation.Nullable; + +import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.storage.Storage; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil; +import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; +import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; + +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.ofFluidVariant; +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toFluidVariant; + +public class FluidGridInsertionStrategy implements GridInsertionStrategy { + private final AbstractContainerMenu containerMenu; + private final GridOperations gridOperations; + private final Player player; + private final PlayerInventoryStorage playerInventoryStorage; + + public FluidGridInsertionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + this.containerMenu = containerMenu; + this.gridOperations = grid.createOperations(ResourceTypes.FLUID, player); + this.player = player; + this.playerInventoryStorage = PlayerInventoryStorage.of(player.getInventory()); + } + + @Override + public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { + final Storage cursorStorage = getFluidCursorStorage(); + if (cursorStorage == null) { + return false; + } + final FluidVariant extractableResource = StorageUtil.findExtractableResource(cursorStorage, null); + if (extractableResource == null) { + return false; + } + final FluidResource fluidResource = ofFluidVariant(extractableResource); + gridOperations.insert(fluidResource, insertMode, (resource, amount, action, source) -> { + if (!(resource instanceof FluidResource fluidResource2)) { + return 0; + } + final FluidVariant fluidVariant = toFluidVariant(fluidResource2); + try (Transaction tx = Transaction.openOuter()) { + final long extracted = cursorStorage.extract(fluidVariant, amount, tx); + if (action == Action.EXECUTE) { + tx.commit(); + } + return extracted; + } + }); + return true; + } + + @Nullable + private Storage getFluidCursorStorage() { + return FluidStorage.ITEM.find( + containerMenu.getCarried(), + ContainerItemContext.ofPlayerCursor(player, containerMenu) + ); + } + + @Override + public boolean onTransfer(final int slotIndex) { + final SingleSlotStorage itemSlotStorage = playerInventoryStorage.getSlot(slotIndex); + if (itemSlotStorage == null) { + return false; + } + final Storage fluidSlotStorage = FluidStorage.ITEM.find( + itemSlotStorage.getResource().toStack(), + ContainerItemContext.ofPlayerSlot(player, itemSlotStorage) + ); + if (fluidSlotStorage == null) { + return false; + } + final FluidVariant extractableResource = StorageUtil.findExtractableResource(fluidSlotStorage, null); + if (extractableResource == null) { + return false; + } + final FluidResource fluidResource = ofFluidVariant(extractableResource); + gridOperations.insert(fluidResource, GridInsertMode.ENTIRE_RESOURCE, (resource, amount, action, source) -> { + if (!(resource instanceof FluidResource fluidResource2)) { + return 0; + } + final FluidVariant fluidVariant = toFluidVariant(fluidResource2); + try (Transaction tx = Transaction.openOuter()) { + final long extracted = fluidSlotStorage.extract(fluidVariant, amount, tx); + if (action == Action.EXECUTE) { + tx.commit(); + } + return extracted; + } + }); + return true; + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/ItemGridExtractionStrategy.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/ItemGridExtractionStrategy.java new file mode 100644 index 000000000..b7687abe7 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/ItemGridExtractionStrategy.java @@ -0,0 +1,62 @@ +package com.refinedmods.refinedstorage.fabric.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; + +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.storage.Storage; +import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; +import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; + +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toItemVariant; + +public class ItemGridExtractionStrategy implements GridExtractionStrategy { + private final GridOperations gridOperations; + private final PlayerInventoryStorage playerInventoryStorage; + private final SingleSlotStorage playerCursorStorage; + + public ItemGridExtractionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); + this.playerInventoryStorage = PlayerInventoryStorage.of(player.getInventory()); + this.playerCursorStorage = PlayerInventoryStorage.getCursorStorage(containerMenu); + } + + @Override + public boolean onExtract(final PlatformResourceKey resource, + final GridExtractMode extractMode, + final boolean cursor) { + if (resource instanceof ItemResource itemResource) { + gridOperations.extract(itemResource, extractMode, (r, amount, action, source) -> { + if (!(r instanceof ItemResource itemResource2)) { + return 0; + } + final ItemVariant itemVariant = toItemVariant(itemResource2); + try (Transaction tx = Transaction.openOuter()) { + final long inserted = insert(itemVariant, amount, tx, cursor); + if (action == Action.EXECUTE) { + tx.commit(); + } + return inserted; + } + }); + return true; + } + return false; + } + + private long insert(final ItemVariant itemVariant, final long amount, final Transaction tx, final boolean cursor) { + final Storage relevantStorage = cursor ? playerCursorStorage : playerInventoryStorage; + return relevantStorage.insert(itemVariant, amount, tx); + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/ItemGridInsertionStrategy.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/ItemGridInsertionStrategy.java new file mode 100644 index 000000000..c77df10d0 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/ItemGridInsertionStrategy.java @@ -0,0 +1,86 @@ +package com.refinedmods.refinedstorage.fabric.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; + +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil; +import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; +import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.Slot; +import net.minecraft.world.item.ItemStack; + +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.ofItemVariant; +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toItemVariant; + +public class ItemGridInsertionStrategy implements GridInsertionStrategy { + private final AbstractContainerMenu containerMenu; + private final GridOperations gridOperations; + private final SingleSlotStorage playerCursorStorage; + + public ItemGridInsertionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + this.containerMenu = containerMenu; + this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); + this.playerCursorStorage = PlayerInventoryStorage.getCursorStorage(containerMenu); + } + + @Override + public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { + final ItemStack carried = containerMenu.getCarried(); + if (carried.isEmpty()) { + return false; + } + final ItemResource itemResource = ItemResource.ofItemStack(carried); + gridOperations.insert(itemResource, insertMode, (resource, amount, action, source) -> { + if (!(resource instanceof ItemResource itemResource2)) { + return 0; + } + try (Transaction tx = Transaction.openOuter()) { + final ItemVariant itemVariant = toItemVariant(itemResource2); + final long extracted = playerCursorStorage.extract(itemVariant, amount, tx); + if (action == Action.EXECUTE) { + tx.commit(); + } + return extracted; + } + }); + return true; + } + + @Override + public boolean onTransfer(final int slotIndex) { + final Slot slot = containerMenu.getSlot(slotIndex); + final InventoryStorage inventoryStorage = InventoryStorage.of(slot.container, null); + final SingleSlotStorage storage = inventoryStorage.getSlot(slot.getContainerSlot()); + final ItemVariant itemVariantInSlot = StorageUtil.findExtractableResource(storage, null); + if (itemVariantInSlot == null) { + return false; + } + final ItemResource itemResource = ofItemVariant(itemVariantInSlot); + gridOperations.insert(itemResource, GridInsertMode.ENTIRE_RESOURCE, (resource, amount, action, source) -> { + if (!(resource instanceof ItemResource itemResource2)) { + return 0; + } + try (Transaction tx = Transaction.openOuter()) { + final ItemVariant itemVariant = toItemVariant(itemResource2); + final long extracted = storage.extract(itemVariant, amount, tx); + if (action == Action.EXECUTE) { + tx.commit(); + } + return extracted; + } + }); + return true; + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/ItemGridScrollingStrategy.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/ItemGridScrollingStrategy.java new file mode 100644 index 000000000..c1aa1b03f --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/ItemGridScrollingStrategy.java @@ -0,0 +1,86 @@ +package com.refinedmods.refinedstorage.fabric.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; + +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.storage.Storage; +import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; +import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; + +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toItemVariant; + +public class ItemGridScrollingStrategy implements GridScrollingStrategy { + private final GridOperations gridOperations; + private final PlayerInventoryStorage playerInventoryStorage; + private final SingleSlotStorage playerCursorStorage; + + public ItemGridScrollingStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); + this.playerInventoryStorage = PlayerInventoryStorage.of(player.getInventory()); + this.playerCursorStorage = PlayerInventoryStorage.getCursorStorage(containerMenu); + } + + @Override + public boolean onScroll(final PlatformResourceKey resource, final GridScrollMode scrollMode, final int slotIndex) { + if (resource instanceof ItemResource itemResource) { + final Storage playerStorage = slotIndex >= 0 + ? playerInventoryStorage.getSlot(slotIndex) + : playerInventoryStorage; + switch (scrollMode) { + case GRID_TO_INVENTORY -> handleGridToInventoryScroll(itemResource, playerStorage); + case INVENTORY_TO_GRID -> handleInventoryToGridScroll(itemResource, playerStorage); + case GRID_TO_CURSOR -> handleGridToInventoryScroll(itemResource, playerCursorStorage); + } + return true; + } + return false; + } + + private void handleInventoryToGridScroll(final ItemResource itemResource, + final Storage sourceStorage) { + gridOperations.insert(itemResource, GridInsertMode.SINGLE_RESOURCE, (resource, amount, action, source) -> { + if (!(resource instanceof ItemResource itemResource2)) { + return 0; + } + try (Transaction tx = Transaction.openOuter()) { + final ItemVariant itemVariant = toItemVariant(itemResource2); + final long extracted = sourceStorage.extract(itemVariant, amount, tx); + if (action == Action.EXECUTE) { + tx.commit(); + } + return extracted; + } + }); + } + + private void handleGridToInventoryScroll(final ItemResource itemResource, + final Storage destinationStorage) { + gridOperations.extract(itemResource, GridExtractMode.SINGLE_RESOURCE, (resource, amount, action, source) -> { + if (!(resource instanceof ItemResource itemResource2)) { + return 0; + } + final ItemVariant itemVariant = toItemVariant(itemResource2); + try (Transaction tx = Transaction.openOuter()) { + final long inserted = destinationStorage.insert(itemVariant, amount, tx); + if (action == Action.EXECUTE) { + tx.commit(); + } + return inserted; + } + }); + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/package-info.java new file mode 100644 index 000000000..266a1fea1 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/view/FabricFluidGridResourceFactory.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/view/FabricFluidGridResourceFactory.java similarity index 77% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/view/FabricFluidGridResourceFactory.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/view/FabricFluidGridResourceFactory.java index f9fb4b98a..50535f1c8 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/view/FabricFluidGridResourceFactory.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/view/FabricFluidGridResourceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.fabric.grid.view; +package com.refinedmods.refinedstorage.fabric.grid.view; -import com.refinedmods.refinedstorage.platform.common.grid.view.AbstractFluidGridResourceFactory; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.grid.view.AbstractFluidGridResourceFactory; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.stream.Collectors; @@ -12,7 +12,7 @@ import net.fabricmc.loader.api.metadata.ModMetadata; import net.minecraft.network.chat.Component; -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.toFluidVariant; +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toFluidVariant; public class FabricFluidGridResourceFactory extends AbstractFluidGridResourceFactory { @Override diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/view/FabricItemGridResourceFactory.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/view/FabricItemGridResourceFactory.java similarity index 82% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/view/FabricItemGridResourceFactory.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/view/FabricItemGridResourceFactory.java index 20807aefc..510bfd152 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/view/FabricItemGridResourceFactory.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/view/FabricItemGridResourceFactory.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.fabric.grid.view; +package com.refinedmods.refinedstorage.fabric.grid.view; -import com.refinedmods.refinedstorage.platform.common.grid.view.AbstractItemGridResourceFactory; +import com.refinedmods.refinedstorage.common.grid.view.AbstractItemGridResourceFactory; import java.util.Optional; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/view/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/view/package-info.java new file mode 100644 index 000000000..208ed15fc --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/view/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.grid.view; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/importer/FabricStorageImporterSource.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/importer/FabricStorageImporterSource.java similarity index 90% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/importer/FabricStorageImporterSource.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/importer/FabricStorageImporterSource.java index ce716f89f..046d711b8 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/importer/FabricStorageImporterSource.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/importer/FabricStorageImporterSource.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage.platform.fabric.importer; +package com.refinedmods.refinedstorage.fabric.importer; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterSource; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.fabric.storage.FabricStorageExtractableStorage; -import com.refinedmods.refinedstorage.platform.fabric.storage.FabricStorageInsertableStorage; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.fabric.storage.FabricStorageExtractableStorage; +import com.refinedmods.refinedstorage.fabric.storage.FabricStorageInsertableStorage; import java.util.Collections; import java.util.Iterator; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/importer/FabricStorageImporterTransferStrategyFactory.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/importer/FabricStorageImporterTransferStrategyFactory.java similarity index 86% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/importer/FabricStorageImporterTransferStrategyFactory.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/importer/FabricStorageImporterTransferStrategyFactory.java index dd30ebd6f..b3ecf4120 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/importer/FabricStorageImporterTransferStrategyFactory.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/importer/FabricStorageImporterTransferStrategyFactory.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.fabric.importer; +package com.refinedmods.refinedstorage.fabric.importer; import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterSource; import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterTransferStrategyImpl; import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.common.content.Items; +import com.refinedmods.refinedstorage.common.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.content.Items; import java.util.function.Function; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/importer/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/importer/package-info.java new file mode 100644 index 000000000..c8b200d74 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/importer/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.importer; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/AbstractModelBakerImplMixin.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/AbstractModelBakerImplMixin.java similarity index 86% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/AbstractModelBakerImplMixin.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/AbstractModelBakerImplMixin.java index 25846afc7..a0f0b3ca3 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/AbstractModelBakerImplMixin.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/AbstractModelBakerImplMixin.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.fabric.mixin; +package com.refinedmods.refinedstorage.fabric.mixin; -import com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil; -import com.refinedmods.refinedstorage.platform.fabric.support.render.EmissiveModelRegistry; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; +import com.refinedmods.refinedstorage.fabric.support.render.EmissiveModelRegistry; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.resources.model.BakedModel; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/EditBoxAccessor.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/EditBoxAccessor.java similarity index 81% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/EditBoxAccessor.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/EditBoxAccessor.java index 6762f6ad8..53130a198 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/EditBoxAccessor.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/EditBoxAccessor.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.mixin; +package com.refinedmods.refinedstorage.fabric.mixin; import net.minecraft.client.gui.components.EditBox; import org.spongepowered.asm.mixin.Mixin; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/ItemPropertiesAccessor.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/ItemPropertiesAccessor.java similarity index 89% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/ItemPropertiesAccessor.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/ItemPropertiesAccessor.java index 960690ccc..485e304b3 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/ItemPropertiesAccessor.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/ItemPropertiesAccessor.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.mixin; +package com.refinedmods.refinedstorage.fabric.mixin; import net.minecraft.client.renderer.item.ClampedItemPropertyFunction; import net.minecraft.client.renderer.item.ItemProperties; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/KeyMappingAccessor.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/KeyMappingAccessor.java similarity index 83% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/KeyMappingAccessor.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/KeyMappingAccessor.java index e2f156577..00438427a 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/KeyMappingAccessor.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/KeyMappingAccessor.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.mixin; +package com.refinedmods.refinedstorage.fabric.mixin; import com.mojang.blaze3d.platform.InputConstants; import net.minecraft.client.KeyMapping; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/ModelBakeryAccessor.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/ModelBakeryAccessor.java similarity index 86% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/ModelBakeryAccessor.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/ModelBakeryAccessor.java index d1b188ad2..f9f3cc161 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/ModelBakeryAccessor.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/ModelBakeryAccessor.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.mixin; +package com.refinedmods.refinedstorage.fabric.mixin; import java.util.Map; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/package-info.java new file mode 100644 index 000000000..713409b05 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/mixin/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.mixin; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/modmenu/ModMenuApiImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/modmenu/ModMenuApiImpl.java similarity index 78% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/modmenu/ModMenuApiImpl.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/modmenu/ModMenuApiImpl.java index b5b032811..bb16679c8 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/modmenu/ModMenuApiImpl.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/modmenu/ModMenuApiImpl.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.fabric.modmenu; +package com.refinedmods.refinedstorage.fabric.modmenu; -import com.refinedmods.refinedstorage.platform.fabric.ConfigImpl; +import com.refinedmods.refinedstorage.fabric.ConfigImpl; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/modmenu/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/modmenu/package-info.java new file mode 100644 index 000000000..77fbdbdfd --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/modmenu/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.modmenu; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/package-info.java new file mode 100644 index 000000000..b4501e1d2 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/security/NetworkNodeBreakSecurityEventListener.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/security/NetworkNodeBreakSecurityEventListener.java new file mode 100644 index 000000000..fe993f2e2 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/security/NetworkNodeBreakSecurityEventListener.java @@ -0,0 +1,36 @@ +package com.refinedmods.refinedstorage.fabric.security; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; + +import javax.annotation.Nullable; + +import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +public class NetworkNodeBreakSecurityEventListener implements PlayerBlockBreakEvents.Before { + @Override + public boolean beforeBlockBreak(final Level world, + final Player player, + final BlockPos pos, + final BlockState state, + @Nullable final BlockEntity blockEntity) { + final NetworkNodeContainerProvider provider = Platform.INSTANCE.getContainerProvider(world, pos, null); + if (provider != null && player instanceof ServerPlayer serverPlayer && !provider.canBuild(serverPlayer)) { + RefinedStorageApi.INSTANCE.sendNoPermissionMessage( + serverPlayer, + createTranslation("misc", "no_permission.build.break", state.getBlock().getName()) + ); + return false; + } + return true; + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/security/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/security/package-info.java new file mode 100644 index 000000000..4e2b9342b --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/security/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.security; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/AbstractDiskContainerBakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/AbstractDiskContainerBakedModel.java similarity index 94% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/AbstractDiskContainerBakedModel.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/AbstractDiskContainerBakedModel.java index ff40801cf..eab952169 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/AbstractDiskContainerBakedModel.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/AbstractDiskContainerBakedModel.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage; +package com.refinedmods.refinedstorage.fabric.storage; import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.common.storage.AbstractDiskContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadTranslator; +import com.refinedmods.refinedstorage.common.storage.AbstractDiskContainerBlockEntity; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.fabric.support.render.QuadTranslator; import java.util.Map; import java.util.function.Supplier; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/FabricStorageExtractableStorage.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/FabricStorageExtractableStorage.java similarity index 95% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/FabricStorageExtractableStorage.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/FabricStorageExtractableStorage.java index ad0c0839f..5fae1ec64 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/FabricStorageExtractableStorage.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/FabricStorageExtractableStorage.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage; +package com.refinedmods.refinedstorage.fabric.storage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; import java.util.function.Function; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/FabricStorageInsertableStorage.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/FabricStorageInsertableStorage.java similarity index 92% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/FabricStorageInsertableStorage.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/FabricStorageInsertableStorage.java index 4285c2d17..2c3aa9342 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/FabricStorageInsertableStorage.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/FabricStorageInsertableStorage.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage; +package com.refinedmods.refinedstorage.fabric.storage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; import java.util.function.Function; @@ -41,6 +41,9 @@ public long insert(final ResourceKey resource, final long amount, final Action a return 0; } final T platformResource = toPlatformMapper.apply(resource); + if (platformResource == null) { + return 0; + } final long correctedAmount = amountOverride.overrideAmount( resource, amount, diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/FabricStorageUtil.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/FabricStorageUtil.java similarity index 90% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/FabricStorageUtil.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/FabricStorageUtil.java index 1a5a2b244..56dc3c14a 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/FabricStorageUtil.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/FabricStorageUtil.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage; +package com.refinedmods.refinedstorage.fabric.storage; import net.fabricmc.fabric.api.transfer.v1.storage.Storage; import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/DiskDriveBakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/DiskDriveBakedModel.java new file mode 100644 index 000000000..9b7776cae --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/DiskDriveBakedModel.java @@ -0,0 +1,74 @@ +package com.refinedmods.refinedstorage.fabric.storage.diskdrive; + +import com.refinedmods.refinedstorage.common.storage.diskdrive.DiskDriveBlock; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.fabric.storage.AbstractDiskContainerBakedModel; +import com.refinedmods.refinedstorage.fabric.support.render.QuadRotators; +import com.refinedmods.refinedstorage.fabric.support.render.QuadTranslator; + +import java.util.Map; +import java.util.function.Supplier; + +import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.BlockPos; +import net.minecraft.util.RandomSource; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.block.state.BlockState; + +class DiskDriveBakedModel extends AbstractDiskContainerBakedModel { + private final QuadRotators quadRotators; + + DiskDriveBakedModel(final BakedModel baseModel, + final Map diskModels, + final BakedModel inactiveLedModel, + final QuadRotators quadRotators) { + super(diskModels, inactiveLedModel, getDiskTranslations()); + this.wrapped = baseModel; + this.quadRotators = quadRotators; + } + + private static QuadTranslator[] getDiskTranslations() { + final QuadTranslator[] translations = new QuadTranslator[8]; + int i = 0; + for (int y = 0; y < 4; ++y) { + for (int x = 0; x < 2; ++x) { + translations[i++] = new QuadTranslator( + x == 0 ? -(2F / 16F) : -(9F / 16F), + -((y * 3F) / 16F) - (2F / 16F), + 0 + ); + } + } + return translations; + } + + @Override + public void emitItemQuads(final ItemStack stack, + final Supplier randomSupplier, + final RenderContext context) { + wrapped.emitItemQuads(stack, randomSupplier, context); + super.emitItemQuads(stack, randomSupplier, context); + } + + @Override + public void emitBlockQuads(final BlockAndTintGetter blockView, + final BlockState state, + final BlockPos pos, + final Supplier randomSupplier, + final RenderContext context) { + if (!(state.getBlock() instanceof DiskDriveBlock diskDriveBlock)) { + return; + } + final BiDirection direction = diskDriveBlock.getDirection(state); + if (direction == null) { + return; + } + context.pushTransform(quadRotators.forDirection(direction)); + wrapped.emitBlockQuads(blockView, state, pos, randomSupplier, context); + super.emitBlockQuads(blockView, state, pos, randomSupplier, context); + context.popTransform(); + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java new file mode 100644 index 000000000..29bb5b434 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.fabric.storage.diskdrive; + +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntityRenderer; +import com.refinedmods.refinedstorage.fabric.support.render.RenderTypes; + +public class DiskDriveBlockEntityRendererImpl + extends AbstractDiskDriveBlockEntityRenderer { + public DiskDriveBlockEntityRendererImpl() { + super(RenderTypes.DISK_LED); + } + + @Override + protected Disk[] getDisks(final AbstractDiskDriveBlockEntity blockEntity) { + if (!(blockEntity instanceof FabricDiskDriveBlockEntity fabricBlockEntity)) { + return null; + } + if (fabricBlockEntity.getRenderData() instanceof Disk[] disks) { + return disks; + } + return null; + } +} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/DiskDriveUnbakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/DiskDriveUnbakedModel.java similarity index 80% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/DiskDriveUnbakedModel.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/DiskDriveUnbakedModel.java index fc8a0e901..a6e02f845 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/DiskDriveUnbakedModel.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/DiskDriveUnbakedModel.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.diskdrive; +package com.refinedmods.refinedstorage.fabric.storage.diskdrive; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadRotators; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.fabric.support.render.QuadRotators; import java.util.Collection; import java.util.HashSet; @@ -20,7 +20,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static java.util.Objects.requireNonNull; public class DiskDriveUnbakedModel implements UnbakedModel { @@ -38,14 +38,14 @@ public Collection getDependencies() { final Set dependencies = new HashSet<>(); dependencies.add(BASE_MODEL); dependencies.add(LED_INACTIVE_MODEL); - dependencies.addAll(PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels()); + dependencies.addAll(RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().getDiskModels()); return dependencies; } @Override public void resolveParents(final Function modelGetter) { modelGetter.apply(BASE_MODEL).resolveParents(modelGetter); - PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( diskModel -> modelGetter.apply(diskModel).resolveParents(modelGetter) ); modelGetter.apply(LED_INACTIVE_MODEL).resolveParents(modelGetter); @@ -56,7 +56,7 @@ public void resolveParents(final Function modelG public BakedModel bake(final ModelBaker baker, final Function spriteGetter, final ModelState state) { - final Map diskModels = PlatformApi.INSTANCE.getStorageContainerItemHelper() + final Map diskModels = RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() .getDiskModelsByItem() .entrySet() .stream() diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/FabricDiskDriveBlockEntity.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/FabricDiskDriveBlockEntity.java new file mode 100644 index 000000000..a29466d9c --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/FabricDiskDriveBlockEntity.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage.fabric.storage.diskdrive; + +import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntity; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; + +public class FabricDiskDriveBlockEntity extends AbstractDiskDriveBlockEntity { + public FabricDiskDriveBlockEntity(final BlockPos pos, final BlockState state) { + super(pos, state); + } + + @Override + @Nullable + public Object getRenderData() { + return disks; + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/package-info.java new file mode 100644 index 000000000..190835ac7 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskdrive/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.storage.diskdrive; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/DiskInterfaceBakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/DiskInterfaceBakedModel.java new file mode 100644 index 000000000..f872a8b12 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/DiskInterfaceBakedModel.java @@ -0,0 +1,92 @@ +package com.refinedmods.refinedstorage.fabric.storage.diskinterface; + +import com.refinedmods.refinedstorage.common.storage.diskinterface.DiskInterfaceBlock; +import com.refinedmods.refinedstorage.common.support.AbstractActiveColoredDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.fabric.storage.AbstractDiskContainerBakedModel; +import com.refinedmods.refinedstorage.fabric.support.render.EmissiveTransform; +import com.refinedmods.refinedstorage.fabric.support.render.QuadRotators; +import com.refinedmods.refinedstorage.fabric.support.render.QuadTranslator; + +import java.util.Map; +import java.util.Set; +import java.util.function.Supplier; + +import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.BlockPos; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.RandomSource; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.block.state.BlockState; + +class DiskInterfaceBakedModel extends AbstractDiskContainerBakedModel { + private final BakedModel inactiveModel; + private final QuadRotators quadRotators; + private final EmissiveTransform emissiveTransform; + + DiskInterfaceBakedModel(final BakedModel baseModel, + final BakedModel inactiveModel, + final Map diskModels, + final BakedModel inactiveLedModel, + final QuadRotators quadRotators, + final ResourceLocation emissiveSprite) { + super(diskModels, inactiveLedModel, getDiskTranslations()); + this.wrapped = baseModel; + this.inactiveModel = inactiveModel; + this.quadRotators = quadRotators; + this.emissiveTransform = new EmissiveTransform(Set.of(emissiveSprite)); + } + + private static QuadTranslator[] getDiskTranslations() { + final QuadTranslator[] translations = new QuadTranslator[6]; + for (int i = 0; i < translations.length; ++i) { + final int x = i < 3 ? 0 : 1; + final int y = i % 3; + translations[i] = new QuadTranslator( + x == 0 ? -(2F / 16F) : -(9F / 16F), + -((y * 3F) / 16F) - (6F / 16F), + 0 + ); + } + return translations; + } + + @Override + public void emitItemQuads(final ItemStack stack, + final Supplier randomSupplier, + final RenderContext context) { + context.pushTransform(emissiveTransform); + wrapped.emitItemQuads(stack, randomSupplier, context); + context.popTransform(); + super.emitItemQuads(stack, randomSupplier, context); + } + + @Override + public void emitBlockQuads(final BlockAndTintGetter blockView, + final BlockState state, + final BlockPos pos, + final Supplier randomSupplier, + final RenderContext context) { + if (!(state.getBlock() instanceof DiskInterfaceBlock diskInterfaceBlock)) { + return; + } + final BiDirection direction = diskInterfaceBlock.getDirection(state); + if (direction == null) { + return; + } + context.pushTransform(quadRotators.forDirection(direction)); + final boolean active = state.getValue(AbstractActiveColoredDirectionalBlock.ACTIVE); + if (active) { + context.pushTransform(emissiveTransform); + } + (active ? wrapped : inactiveModel).emitBlockQuads(blockView, state, pos, randomSupplier, context); + super.emitBlockQuads(blockView, state, pos, randomSupplier, context); + if (active) { + context.popTransform(); + } + context.popTransform(); + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java new file mode 100644 index 000000000..6f2ca04c9 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.fabric.storage.diskinterface; + +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntityRenderer; +import com.refinedmods.refinedstorage.fabric.support.render.RenderTypes; + +public class DiskInterfaceBlockEntityRendererImpl + extends AbstractDiskInterfaceBlockEntityRenderer { + public DiskInterfaceBlockEntityRendererImpl() { + super(RenderTypes.DISK_LED); + } + + @Override + protected Disk[] getDisks(final AbstractDiskInterfaceBlockEntity blockEntity) { + if (!(blockEntity instanceof FabricDiskInterfaceBlockEntity fabricBlockEntity)) { + return null; + } + if (fabricBlockEntity.getRenderData() instanceof Disk[] disks) { + return disks; + } + return null; + } +} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/DiskInterfaceUnbakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/DiskInterfaceUnbakedModel.java similarity index 83% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/DiskInterfaceUnbakedModel.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/DiskInterfaceUnbakedModel.java index 0fabc5291..ef4d4b1f3 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/DiskInterfaceUnbakedModel.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/DiskInterfaceUnbakedModel.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.diskinterface; +package com.refinedmods.refinedstorage.fabric.storage.diskinterface; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadRotators; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.fabric.support.render.QuadRotators; import java.util.Collection; import java.util.HashSet; @@ -21,7 +21,7 @@ import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.Item; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static java.util.Objects.requireNonNull; public class DiskInterfaceUnbakedModel implements UnbakedModel { @@ -44,7 +44,7 @@ public Collection getDependencies() { dependencies.add(baseModel); dependencies.add(INACTIVE_MODEL); dependencies.add(LED_INACTIVE_MODEL); - dependencies.addAll(PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels()); + dependencies.addAll(RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().getDiskModels()); return dependencies; } @@ -52,7 +52,7 @@ public Collection getDependencies() { public void resolveParents(final Function modelGetter) { modelGetter.apply(baseModel).resolveParents(modelGetter); modelGetter.apply(INACTIVE_MODEL).resolveParents(modelGetter); - PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( diskModel -> modelGetter.apply(diskModel).resolveParents(modelGetter) ); modelGetter.apply(LED_INACTIVE_MODEL).resolveParents(modelGetter); @@ -63,7 +63,7 @@ public void resolveParents(final Function modelG public BakedModel bake(final ModelBaker baker, final Function spriteGetter, final ModelState state) { - final Map diskModels = PlatformApi.INSTANCE.getStorageContainerItemHelper() + final Map diskModels = RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() .getDiskModelsByItem() .entrySet() .stream() diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/FabricDiskInterfaceBlockEntity.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/FabricDiskInterfaceBlockEntity.java new file mode 100644 index 000000000..17e9efa16 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/FabricDiskInterfaceBlockEntity.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage.fabric.storage.diskinterface; + +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; + +public class FabricDiskInterfaceBlockEntity extends AbstractDiskInterfaceBlockEntity { + public FabricDiskInterfaceBlockEntity(final BlockPos pos, final BlockState state) { + super(pos, state); + } + + @Override + @Nullable + public Object getRenderData() { + return disks; + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/package-info.java new file mode 100644 index 000000000..712bc86f2 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/diskinterface/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.storage.diskinterface; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java similarity index 90% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java index a6f547dbb..939ef2f40 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.externalstorage; +package com.refinedmods.refinedstorage.fabric.storage.externalstorage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.fabric.storage.FabricStorageExtractableStorage; -import com.refinedmods.refinedstorage.platform.fabric.storage.FabricStorageInsertableStorage; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.fabric.storage.FabricStorageExtractableStorage; +import com.refinedmods.refinedstorage.fabric.storage.FabricStorageInsertableStorage; import java.util.Collections; import java.util.Iterator; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java similarity index 89% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java index 35239e7e6..825cbdec2 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.externalstorage; +package com.refinedmods.refinedstorage.fabric.storage.externalstorage; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.common.api.storage.externalstorage.PlatformExternalStorageProviderFactory; import java.util.Optional; import java.util.function.Function; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/externalstorage/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/externalstorage/package-info.java new file mode 100644 index 000000000..865b95a4d --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/externalstorage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.storage.externalstorage; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/package-info.java new file mode 100644 index 000000000..84079f368 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.storage; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/DiskLeds.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/DiskLeds.java similarity index 87% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/DiskLeds.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/DiskLeds.java index 8f9ed1861..bccceb4b6 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/DiskLeds.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/DiskLeds.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.portablegrid; +package com.refinedmods.refinedstorage.fabric.storage.portablegrid; import com.refinedmods.refinedstorage.api.storage.StorageState; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/FabricPortableGridBlockEntity.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/FabricPortableGridBlockEntity.java new file mode 100644 index 000000000..e13319284 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/FabricPortableGridBlockEntity.java @@ -0,0 +1,21 @@ +package com.refinedmods.refinedstorage.fabric.storage.portablegrid; + +import com.refinedmods.refinedstorage.common.storage.portablegrid.AbstractPortableGridBlockEntity; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridType; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; + +public class FabricPortableGridBlockEntity extends AbstractPortableGridBlockEntity { + public FabricPortableGridBlockEntity(final PortableGridType type, final BlockPos pos, final BlockState state) { + super(type, pos, state); + } + + @Override + @Nullable + public Object getRenderData() { + return disk; + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBakedModel.java new file mode 100644 index 000000000..12f8a67a7 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBakedModel.java @@ -0,0 +1,125 @@ +package com.refinedmods.refinedstorage.fabric.storage.portablegrid; + +import com.refinedmods.refinedstorage.api.storage.StorageState; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlock; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockItem; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockItemRenderInfo; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.fabric.support.render.QuadRotators; +import com.refinedmods.refinedstorage.fabric.support.render.QuadTranslator; + +import java.util.Map; +import java.util.function.Supplier; + +import net.fabricmc.fabric.api.renderer.v1.model.ForwardingBakedModel; +import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.BlockPos; +import net.minecraft.util.RandomSource; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.block.state.BlockState; + +public class PortableGridBakedModel extends ForwardingBakedModel { + private static final QuadTranslator MOVE_TO_DISK_LOCATION = new QuadTranslator(0, -12 / 16F, 9 / 16F); + private static final QuadTranslator MOVE_TO_DISK_LED_LOCATION = new QuadTranslator(0, -12 / 16F, 9 / 16F); + + private final BakedModel activeModel; + private final BakedModel inactiveModel; + private final Map diskModels; + private final QuadRotators quadRotators; + private final DiskLeds diskLeds; + + PortableGridBakedModel(final BakedModel activeModel, + final BakedModel inactiveModel, + final Map diskModels, + final QuadRotators quadRotators, + final DiskLeds diskLeds) { + this.wrapped = inactiveModel; + this.activeModel = activeModel; + this.inactiveModel = inactiveModel; + this.diskModels = diskModels; + this.quadRotators = quadRotators; + this.diskLeds = diskLeds; + } + + @Override + public boolean isVanillaAdapter() { + return false; + } + + @Override + public void emitItemQuads(final ItemStack stack, + final Supplier randomSupplier, + final RenderContext context) { + final ClientLevel level = Minecraft.getInstance().level; + if (level == null) { + return; + } + final PortableGridBlockItemRenderInfo renderInfo = PortableGridBlockItem.getRenderInfo(stack, level); + (renderInfo.active() ? activeModel : inactiveModel).emitItemQuads(stack, randomSupplier, context); + if (renderInfo.disk().state() != StorageState.NONE) { + final BakedModel diskModel = diskModels.get(renderInfo.disk().item()); + if (diskModel == null) { + return; + } + context.pushTransform(MOVE_TO_DISK_LOCATION); + context.pushTransform(quadRotators.forDirection(BiDirection.WEST)); + diskModel.emitItemQuads(stack, randomSupplier, context); + context.popTransform(); + context.popTransform(); + + context.pushTransform(MOVE_TO_DISK_LED_LOCATION); + context.pushTransform(quadRotators.forDirection(BiDirection.WEST)); + diskLeds.forState(renderInfo.disk().state()).emitItemQuads(stack, randomSupplier, context); + context.popTransform(); + context.popTransform(); + } + } + + @Override + public void emitBlockQuads(final BlockAndTintGetter blockView, + final BlockState state, + final BlockPos pos, + final Supplier randomSupplier, + final RenderContext context) { + if (!(state.getBlock() instanceof PortableGridBlock portableGridBlock)) { + return; + } + final BiDirection direction = portableGridBlock.getDirection(state); + if (direction == null) { + return; + } + context.pushTransform(quadRotators.forDirection(direction)); + final Object renderAttachment = blockView.getBlockEntityRenderData(pos); + if (renderAttachment instanceof Disk disk) { + emitDiskQuads(blockView, state, pos, randomSupplier, context, disk); + } + final boolean active = state.getValue(PortableGridBlock.ACTIVE); + (active ? activeModel : inactiveModel).emitBlockQuads(blockView, state, pos, randomSupplier, context); + context.popTransform(); + } + + private void emitDiskQuads( + final BlockAndTintGetter blockView, + final BlockState state, + final BlockPos pos, + final Supplier randomSupplier, + final RenderContext context, + final Disk disk + ) { + final BakedModel diskModel = diskModels.get(disk.item()); + if (diskModel == null) { + return; + } + context.pushTransform(MOVE_TO_DISK_LOCATION); + context.pushTransform(quadRotators.forDirection(BiDirection.WEST)); + diskModel.emitBlockQuads(blockView, state, pos, randomSupplier, context); + context.popTransform(); + context.popTransform(); + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBlockEntityRendererImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBlockEntityRendererImpl.java new file mode 100644 index 000000000..5616bdcff --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBlockEntityRendererImpl.java @@ -0,0 +1,27 @@ +package com.refinedmods.refinedstorage.fabric.storage.portablegrid; + +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.portablegrid.AbstractPortableGridBlockEntity; +import com.refinedmods.refinedstorage.common.storage.portablegrid.AbstractPortableGridBlockEntityRenderer; +import com.refinedmods.refinedstorage.fabric.support.render.RenderTypes; + +import javax.annotation.Nullable; + +public class PortableGridBlockEntityRendererImpl + extends AbstractPortableGridBlockEntityRenderer { + public PortableGridBlockEntityRendererImpl() { + super(RenderTypes.DISK_LED); + } + + @Override + @Nullable + protected Disk getDisk(final T blockEntity) { + if (!(blockEntity instanceof FabricPortableGridBlockEntity fabricDiskDriveBlockEntity)) { + return null; + } + if (fabricDiskDriveBlockEntity.getRenderData() instanceof Disk disk) { + return disk; + } + return null; + } +} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/PortableGridUnbakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridUnbakedModel.java similarity index 86% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/PortableGridUnbakedModel.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridUnbakedModel.java index f3e2b957b..1cafd0d1a 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/PortableGridUnbakedModel.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridUnbakedModel.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.portablegrid; +package com.refinedmods.refinedstorage.fabric.storage.portablegrid; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadRotators; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.fabric.support.render.QuadRotators; import java.util.Collection; import java.util.Map; @@ -18,7 +18,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static java.util.Objects.requireNonNull; public class PortableGridUnbakedModel implements UnbakedModel { @@ -48,7 +48,7 @@ public void resolveParents(final Function modelG modelGetter.apply(NORMAL_LED_MODEL).resolveParents(modelGetter); modelGetter.apply(NEAR_CAPACITY_LED_MODEL).resolveParents(modelGetter); modelGetter.apply(FULL_LED_MODEL).resolveParents(modelGetter); - PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( diskModel -> modelGetter.apply(diskModel).resolveParents(modelGetter) ); } @@ -57,7 +57,7 @@ public void resolveParents(final Function modelG public BakedModel bake(final ModelBaker baker, final Function spriteGetter, final ModelState state) { - final Map diskModels = PlatformApi.INSTANCE.getStorageContainerItemHelper() + final Map diskModels = RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() .getDiskModelsByItem() .entrySet() .stream() diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/package-info.java new file mode 100644 index 000000000..9da0baec7 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.storage.portablegrid; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/containermenu/ContainerTransferDestination.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/containermenu/ContainerTransferDestination.java new file mode 100644 index 000000000..627c5c16c --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/containermenu/ContainerTransferDestination.java @@ -0,0 +1,29 @@ +package com.refinedmods.refinedstorage.fabric.support.containermenu; + +import com.refinedmods.refinedstorage.common.support.containermenu.TransferDestination; + +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.Storage; +import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; +import net.minecraft.world.Container; +import net.minecraft.world.item.ItemStack; + +public record ContainerTransferDestination(Container destination) implements TransferDestination { + @Override + public ItemStack transfer(final ItemStack stack) { + final Storage storage = InventoryStorage.of(destination, null); + try (Transaction tx = Transaction.openOuter()) { + final long inserted = storage.insert( + ItemVariant.of(stack), + stack.getCount(), + tx + ); + tx.commit(); + final long remainder = stack.getCount() - inserted; + final ItemStack remainderStack = stack.copy(); + remainderStack.setCount((int) remainder); + return remainderStack; + } + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/containermenu/MenuOpenerImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/containermenu/MenuOpenerImpl.java new file mode 100644 index 000000000..aab2e7b40 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/containermenu/MenuOpenerImpl.java @@ -0,0 +1,45 @@ +package com.refinedmods.refinedstorage.fabric.support.containermenu; + +import com.refinedmods.refinedstorage.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.containermenu.MenuOpener; + +import javax.annotation.Nullable; + +import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.MenuProvider; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; + +public class MenuOpenerImpl implements MenuOpener { + @Override + public void openMenu(final ServerPlayer player, final MenuProvider menuProvider) { + if (menuProvider instanceof ExtendedMenuProvider extendedMenuProvider) { + openExtendedMenu(player, extendedMenuProvider); + } else { + player.openMenu(menuProvider); + } + } + + private void openExtendedMenu(final ServerPlayer player, final ExtendedMenuProvider extendedMenuProvider) { + player.openMenu(new ExtendedScreenHandlerFactory() { + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return extendedMenuProvider.createMenu(syncId, inventory, player); + } + + @Override + public Component getDisplayName() { + return extendedMenuProvider.getDisplayName(); + } + + @Override + public T getScreenOpeningData(final ServerPlayer player) { + return extendedMenuProvider.getMenuData(); + } + }); + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/containermenu/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/containermenu/package-info.java new file mode 100644 index 000000000..75a38e159 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/containermenu/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.support.containermenu; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/energy/EnergyStorageAdapter.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/energy/EnergyStorageAdapter.java new file mode 100644 index 000000000..c0215c518 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/energy/EnergyStorageAdapter.java @@ -0,0 +1,58 @@ +package com.refinedmods.refinedstorage.fabric.support.energy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; + +import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext; +import net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant; + +public class EnergyStorageAdapter extends SnapshotParticipant implements team.reborn.energy.api.EnergyStorage { + private final EnergyStorage energyStorage; + + public EnergyStorageAdapter(final EnergyStorage energyStorage) { + this.energyStorage = energyStorage; + } + + public EnergyStorage getEnergyStorage() { + return energyStorage; + } + + @Override + public long insert(final long maxAmount, final TransactionContext transaction) { + final long insertedSimulated = energyStorage.receive(maxAmount, Action.SIMULATE); + if (insertedSimulated > 0) { + updateSnapshots(transaction); + } + return energyStorage.receive(maxAmount, Action.EXECUTE); + } + + @Override + public long extract(final long maxAmount, final TransactionContext transaction) { + final long extractedSimulated = energyStorage.extract(maxAmount, Action.SIMULATE); + if (extractedSimulated > 0) { + updateSnapshots(transaction); + } + return energyStorage.extract(maxAmount, Action.EXECUTE); + } + + @Override + public long getAmount() { + return energyStorage.getStored(); + } + + @Override + public long getCapacity() { + return energyStorage.getCapacity(); + } + + @Override + protected Long createSnapshot() { + return energyStorage.getStored(); + } + + @Override + protected void readSnapshot(final Long snapshot) { + energyStorage.extract(Long.MAX_VALUE, Action.EXECUTE); + energyStorage.receive(snapshot, Action.EXECUTE); + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/energy/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/energy/package-info.java new file mode 100644 index 000000000..a7a75169f --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/energy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.support.energy; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveBakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/EmissiveBakedModel.java similarity index 96% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveBakedModel.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/EmissiveBakedModel.java index 1cb81cae8..79c153be6 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveBakedModel.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/EmissiveBakedModel.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.render; +package com.refinedmods.refinedstorage.fabric.support.render; import java.util.Set; import java.util.function.Supplier; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveModelRegistry.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/EmissiveModelRegistry.java similarity index 95% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveModelRegistry.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/EmissiveModelRegistry.java index c08392308..f56899ce7 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveModelRegistry.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/EmissiveModelRegistry.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.render; +package com.refinedmods.refinedstorage.fabric.support.render; import java.util.Arrays; import java.util.HashMap; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveTransform.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/EmissiveTransform.java similarity index 94% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveTransform.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/EmissiveTransform.java index f90d173c0..64785b8f9 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveTransform.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/EmissiveTransform.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.render; +package com.refinedmods.refinedstorage.fabric.support.render; import java.util.Set; @@ -24,6 +24,7 @@ public boolean transform(final MutableQuadView quad) { return true; } + @SuppressWarnings("resource") private void doTransform(final MutableQuadView quad) { final SpriteFinder finder = SpriteFinder.get(getAtlas()); if (finder == null) { diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/FluidVariantFluidRenderer.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/FluidVariantFluidRenderer.java similarity index 88% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/FluidVariantFluidRenderer.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/FluidVariantFluidRenderer.java index dc2edf238..c8613f2ee 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/FluidVariantFluidRenderer.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/FluidVariantFluidRenderer.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.render; +package com.refinedmods.refinedstorage.fabric.support.render; -import com.refinedmods.refinedstorage.platform.common.support.render.AbstractFluidRenderer; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil; +import com.refinedmods.refinedstorage.common.support.render.AbstractFluidRenderer; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil; import java.util.HashMap; import java.util.List; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotator.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/QuadRotator.java similarity index 88% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotator.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/QuadRotator.java index bf9e5cf55..d8da63fb0 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotator.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/QuadRotator.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.render; +package com.refinedmods.refinedstorage.fabric.support.render; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; @@ -49,9 +49,9 @@ public boolean transform(final MutableQuadView quad) { if (cullFace != null) { quad.cullFace(rotate(cullFace, mat)); } - - quad.nominalFace(rotate(nominalFace, mat)); - + if (nominalFace != null) { + quad.nominalFace(rotate(nominalFace, mat)); + } return true; } diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/QuadRotators.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/QuadRotators.java new file mode 100644 index 000000000..86bfcd4c4 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/QuadRotators.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage.fabric.support.render; + +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; + +import java.util.EnumMap; +import java.util.Map; + +public class QuadRotators { + private final Map rotators = new EnumMap<>(BiDirection.class); + + public QuadRotators() { + for (final BiDirection direction : BiDirection.values()) { + rotators.put(direction, new QuadRotator(direction)); + } + } + + public QuadRotator forDirection(final BiDirection direction) { + return rotators.get(direction); + } +} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadTranslator.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/QuadTranslator.java similarity index 91% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadTranslator.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/QuadTranslator.java index f812b092a..d1dd08402 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadTranslator.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/QuadTranslator.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.render; +package com.refinedmods.refinedstorage.fabric.support.render; import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/RenderTypes.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/RenderTypes.java new file mode 100644 index 000000000..4a2d9b9e3 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/RenderTypes.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.fabric.support.render; + +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import com.mojang.blaze3d.vertex.VertexFormat; +import net.minecraft.client.renderer.GameRenderer; +import net.minecraft.client.renderer.RenderStateShard; +import net.minecraft.client.renderer.RenderType; + +public final class RenderTypes { + public static final RenderType DISK_LED = RenderType.create( + "disk_led", + DefaultVertexFormat.POSITION_COLOR, + VertexFormat.Mode.QUADS, + 32565, + false, + true, + RenderType.CompositeState.builder() + .setShaderState(new RenderStateShard.ShaderStateShard(GameRenderer::getPositionColorShader)) + .createCompositeState(false) + ); + + private RenderTypes() { + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/package-info.java new file mode 100644 index 000000000..9cf9ced05 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/render/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.support.render; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/resource/ResourceContainerFluidStorageAdapter.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/resource/ResourceContainerFluidStorageAdapter.java similarity index 89% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/resource/ResourceContainerFluidStorageAdapter.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/resource/ResourceContainerFluidStorageAdapter.java index 9f8805e47..ab9b06a3e 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/resource/ResourceContainerFluidStorageAdapter.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/resource/ResourceContainerFluidStorageAdapter.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.resource; +package com.refinedmods.refinedstorage.fabric.support.resource; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.ArrayList; import java.util.Iterator; @@ -18,8 +18,8 @@ import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext; import net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant; -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.ofFluidVariant; -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.toFluidVariant; +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.ofFluidVariant; +import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toFluidVariant; public class ResourceContainerFluidStorageAdapter extends SnapshotParticipant implements Storage { diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/resource/VariantUtil.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/resource/VariantUtil.java new file mode 100644 index 000000000..7e5e5f452 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/resource/VariantUtil.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage.fabric.support.resource; + +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; + +public final class VariantUtil { + private VariantUtil() { + } + + public static ItemVariant toItemVariant(final ItemResource itemResource) { + return ItemVariant.of(itemResource.item(), itemResource.components()); + } + + public static ItemResource ofItemVariant(final ItemVariant itemVariant) { + return new ItemResource(itemVariant.getItem(), itemVariant.getComponents()); + } + + public static FluidVariant toFluidVariant(final FluidResource fluidResource) { + return FluidVariant.of(fluidResource.fluid(), fluidResource.components()); + } + + public static FluidResource ofFluidVariant(final FluidVariant fluidVariant) { + return new FluidResource(fluidVariant.getFluid(), fluidVariant.getComponents()); + } +} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/resource/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/resource/package-info.java new file mode 100644 index 000000000..3bce09478 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/support/resource/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.support.resource; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/util/SimpleSingleStackStorage.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/SimpleSingleStackStorage.java similarity index 91% rename from refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/util/SimpleSingleStackStorage.java rename to refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/SimpleSingleStackStorage.java index cebb1af3d..73b1513a7 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/util/SimpleSingleStackStorage.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/SimpleSingleStackStorage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.fabric.util; +package com.refinedmods.refinedstorage.fabric.util; import net.fabricmc.fabric.api.transfer.v1.item.base.SingleStackStorage; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/package-info.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/package-info.java new file mode 100644 index 000000000..24f3da565 --- /dev/null +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.fabric.util; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/resources/fabric.mod.json b/refinedstorage-fabric/src/main/resources/fabric.mod.json similarity index 83% rename from refinedstorage-platform-fabric/src/main/resources/fabric.mod.json rename to refinedstorage-fabric/src/main/resources/fabric.mod.json index f2599ada8..dfc5a06b2 100644 --- a/refinedstorage-platform-fabric/src/main/resources/fabric.mod.json +++ b/refinedstorage-fabric/src/main/resources/fabric.mod.json @@ -17,13 +17,13 @@ "environment": "*", "entrypoints": { "main": [ - "com.refinedmods.refinedstorage.platform.fabric.ModInitializerImpl" + "com.refinedmods.refinedstorage.fabric.ModInitializerImpl" ], "client": [ - "com.refinedmods.refinedstorage.platform.fabric.ClientModInitializerImpl" + "com.refinedmods.refinedstorage.fabric.ClientModInitializerImpl" ], "modmenu": [ - "com.refinedmods.refinedstorage.platform.fabric.modmenu.ModMenuApiImpl" + "com.refinedmods.refinedstorage.fabric.modmenu.ModMenuApiImpl" ] }, "custom": { diff --git a/refinedstorage-platform-fabric/src/main/resources/refinedstorage.accesswidener b/refinedstorage-fabric/src/main/resources/refinedstorage.accesswidener similarity index 100% rename from refinedstorage-platform-fabric/src/main/resources/refinedstorage.accesswidener rename to refinedstorage-fabric/src/main/resources/refinedstorage.accesswidener diff --git a/refinedstorage-platform-fabric/src/main/resources/refinedstorage.mixins.json b/refinedstorage-fabric/src/main/resources/refinedstorage.mixins.json similarity index 80% rename from refinedstorage-platform-fabric/src/main/resources/refinedstorage.mixins.json rename to refinedstorage-fabric/src/main/resources/refinedstorage.mixins.json index bf26e41ac..f92e1683e 100644 --- a/refinedstorage-platform-fabric/src/main/resources/refinedstorage.mixins.json +++ b/refinedstorage-fabric/src/main/resources/refinedstorage.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "com.refinedmods.refinedstorage.platform.fabric.mixin", + "package": "com.refinedmods.refinedstorage.fabric.mixin", "compatibilityLevel": "JAVA_17", "client": [ "AbstractModelBakerImplMixin", diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperationsImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperationsImpl.java index 5893dd500..d4b1d3476 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperationsImpl.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperationsImpl.java @@ -6,7 +6,7 @@ import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; import com.refinedmods.refinedstorage.api.storage.TransferHelper; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import java.util.function.ToLongFunction; @@ -14,23 +14,23 @@ @API(status = API.Status.STABLE, since = "2.0.0-milestone.1.2") public class GridOperationsImpl implements GridOperations { - private final StorageChannel storageChannel; + private final RootStorage rootStorage; private final Actor actor; private final ToLongFunction maxAmountProvider; private final long singleAmount; /** - * @param storageChannel the storage channel to act on + * @param rootStorage the storage to act on * @param actor the actor performing the grid operations * @param maxAmountProvider provider for the maximum amount of a given resource * @param singleAmount amount that needs to be extracted when using * {@link GridInsertMode#SINGLE_RESOURCE} or {@link GridExtractMode#SINGLE_RESOURCE} */ - public GridOperationsImpl(final StorageChannel storageChannel, + public GridOperationsImpl(final RootStorage rootStorage, final Actor actor, final ToLongFunction maxAmountProvider, final long singleAmount) { - this.storageChannel = storageChannel; + this.rootStorage = rootStorage; this.actor = actor; this.maxAmountProvider = maxAmountProvider; this.singleAmount = singleAmount; @@ -44,7 +44,7 @@ public boolean extract(final ResourceKey resource, if (amount == 0) { return false; } - return TransferHelper.transfer(resource, amount, actor, storageChannel, destination, storageChannel) > 0; + return TransferHelper.transfer(resource, amount, actor, rootStorage, destination, rootStorage) > 0; } private long getExtractableAmount(final ResourceKey resource, final GridExtractMode extractMode) { @@ -53,7 +53,7 @@ private long getExtractableAmount(final ResourceKey resource, final GridExtractM } private long getExtractableAmount(final ResourceKey resource) { - final long totalSize = storageChannel.get(resource).map(ResourceAmount::getAmount).orElse(0L); + final long totalSize = rootStorage.get(resource).map(ResourceAmount::getAmount).orElse(0L); final long maxAmount = maxAmountProvider.applyAsLong(resource); return Math.min(totalSize, maxAmount); } @@ -75,6 +75,6 @@ public boolean insert(final ResourceKey resource, case ENTIRE_RESOURCE -> maxAmountProvider.applyAsLong(resource); case SINGLE_RESOURCE -> singleAmount; }; - return TransferHelper.transfer(resource, amount, actor, source, storageChannel, null) > 0; + return TransferHelper.transfer(resource, amount, actor, source, rootStorage, null) > 0; } } diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java index 6a86c42ae..a7a3e6ea0 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java @@ -45,7 +45,7 @@ public GridQueryParserImpl(final LexerTokenMappings tokenMappings, @Override public Predicate parse(final String query) throws GridQueryParserException { - if ("".equals(query.trim())) { + if (query.trim().isEmpty()) { return resource -> true; } final List tokens = getTokens(query); @@ -82,16 +82,13 @@ private Predicate implicitAnd(final List nodes) throws GridQ } private Predicate parseNode(final Node node) throws GridQueryParserException { - if (node instanceof LiteralNode literalNode) { - return parseLiteral(literalNode); - } else if (node instanceof UnaryOpNode unaryOpNode) { - return parseUnaryOp(unaryOpNode); - } else if (node instanceof BinOpNode binOpNode) { - return parseBinOp(binOpNode); - } else if (node instanceof ParenNode parenNode) { - return implicitAnd(parenNode.nodes()); - } - throw new GridQueryParserException("Unsupported node", null); + return switch (node) { + case LiteralNode literalNode -> parseLiteral(literalNode); + case UnaryOpNode unaryOpNode -> parseUnaryOp(unaryOpNode); + case BinOpNode binOpNode -> parseBinOp(binOpNode); + case ParenNode parenNode -> implicitAnd(parenNode.nodes()); + default -> throw new GridQueryParserException("Unsupported node", null); + }; } private Predicate parseBinOp(final BinOpNode node) throws GridQueryParserException { diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java index d995757e9..9f25238cc 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java @@ -72,7 +72,7 @@ public interface GridView { /** * Applies a change to a resource. Will update the backing list, and will also update the view list (depending - * if the view is preventing sorting). + * on if the view is preventing sorting). * * @param resource the resource * @param amount the amount, can be negative or positive diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java index abdf96a5c..49394645e 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java @@ -215,7 +215,7 @@ private void addIntoView(final GridResource resource) { if (wouldBePosition < 0) { viewList.add(-wouldBePosition - 1, resource); } else { - // If the "would be" position is positive, this means that the resource is already contained in the list, + // If the "would-be" position is positive, this means that the resource is already contained in the list, // comparing with sorting rules. // This doesn't mean that the *exact* resource is already in the list, but that is purely "contained" // in the list when comparing with sorting rules. diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManager.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManager.java index 3287bbc6b..81ce00e10 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManager.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManager.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.api.grid.watcher; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import javax.annotation.Nullable; @@ -9,19 +9,19 @@ /** * This manager helps with attaching and detaching listeners to - * {@link com.refinedmods.refinedstorage.api.storage.channel.StorageChannel}s. + * {@link RootStorage}s. */ @API(status = API.Status.STABLE, since = "2.0.0-milestone.3.3") public interface GridWatcherManager { void addWatcher(GridWatcher watcher, Class actorType, - @Nullable StorageChannel storageChannel); + @Nullable RootStorage rootStorage); - void attachAll(@Nullable StorageChannel storageChannel); + void attachAll(@Nullable RootStorage rootStorage); - void removeWatcher(GridWatcher watcher, @Nullable StorageChannel storageChannel); + void removeWatcher(GridWatcher watcher, @Nullable RootStorage rootStorage); - void detachAll(StorageChannel storageChannel); + void detachAll(RootStorage rootStorage); void activeChanged(boolean active); } diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImpl.java index 1b5f8b937..c363bc680 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImpl.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImpl.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.api.grid.watcher; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import java.util.HashMap; import java.util.Map; @@ -21,21 +21,21 @@ public class GridWatcherManagerImpl implements GridWatcherManager { public void addWatcher( final GridWatcher watcher, final Class actorType, - @Nullable final StorageChannel storageChannel + @Nullable final RootStorage rootStorage ) { if (watchers.containsKey(watcher)) { throw new IllegalArgumentException("Watcher is already registered"); } final GridWatcherRegistration registration = new GridWatcherRegistration(watcher, actorType); - if (storageChannel != null) { - attach(registration, storageChannel, false); + if (rootStorage != null) { + attach(registration, rootStorage, false); } watchers.put(watcher, registration); LOGGER.debug("Added watcher {}, new count is {}", watcher, watchers.size()); } @Override - public void attachAll(@Nullable final StorageChannel storageChannel) { + public void attachAll(@Nullable final RootStorage rootStorage) { // If we get here we are affected by a network split or network merge. // At this point, all the storages that are affected by the split or merge have not yet been processed // as the grid has the highest priority. @@ -43,46 +43,46 @@ public void attachAll(@Nullable final StorageChannel storageChannel) { // Invalidate all watcher data, the resources that were synced earlier are no longer valid because we have // a brand-new network. watcher.invalidate(); - if (storageChannel != null) { + if (rootStorage != null) { // Re-attach the watcher to the new network, and send all the resources from the new network. // Resources from the old network are not part of the new network yet, as mentioned above, // but those will be synced when the storages are re-added. - attach(registration, storageChannel, true); + attach(registration, rootStorage, true); } }); } private void attach( final GridWatcherRegistration registration, - final StorageChannel storageChannel, + final RootStorage rootStorage, final boolean replay ) { - LOGGER.debug("Attaching {} to {}", registration, storageChannel); - registration.attach(storageChannel, replay); + LOGGER.debug("Attaching {} to {}", registration, rootStorage); + registration.attach(rootStorage, replay); } @Override - public void removeWatcher(final GridWatcher watcher, @Nullable final StorageChannel storageChannel) { + public void removeWatcher(final GridWatcher watcher, @Nullable final RootStorage rootStorage) { final GridWatcherRegistration registration = watchers.get(watcher); if (registration == null) { throw new IllegalArgumentException("Watcher is not registered"); } - if (storageChannel != null) { - detach(registration, storageChannel); + if (rootStorage != null) { + detach(registration, rootStorage); } watchers.remove(watcher); LOGGER.debug("Removed watcher {}, remaining {}", watcher, watchers.size()); } @Override - public void detachAll(final StorageChannel storageChannel) { + public void detachAll(final RootStorage rootStorage) { LOGGER.debug("Detaching {} watchers", watchers.size()); - watchers.values().forEach(watcher -> detach(watcher, storageChannel)); + watchers.values().forEach(watcher -> detach(watcher, rootStorage)); } - private void detach(final GridWatcherRegistration registration, final StorageChannel storageChannel) { - LOGGER.debug("Detaching {} from {}", registration, storageChannel); - registration.detach(storageChannel); + private void detach(final GridWatcherRegistration registration, final RootStorage rootStorage) { + LOGGER.debug("Detaching {} from {}", registration, rootStorage); + registration.detach(rootStorage); } @Override diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherRegistration.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherRegistration.java index 7fc89b970..5dae822b6 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherRegistration.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherRegistration.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage.api.resource.list.listenable.ResourceListListener; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import javax.annotation.Nullable; @@ -17,21 +17,21 @@ class GridWatcherRegistration { this.actorType = actorType; } - void attach(final StorageChannel storageChannel, final boolean replay) { + void attach(final RootStorage rootStorage, final boolean replay) { this.listener = change -> watcher.onChanged( change.resourceAmount().getResource(), change.change(), - storageChannel.findTrackedResourceByActorType( + rootStorage.findTrackedResourceByActorType( change.resourceAmount().getResource(), actorType ).orElse(null) ); - storageChannel.addListener(listener); + rootStorage.addListener(listener); if (replay) { - storageChannel.getAll().forEach(resourceAmount -> watcher.onChanged( + rootStorage.getAll().forEach(resourceAmount -> watcher.onChanged( resourceAmount.getResource(), resourceAmount.getAmount(), - storageChannel.findTrackedResourceByActorType( + rootStorage.findTrackedResourceByActorType( resourceAmount.getResource(), actorType ).orElse(null) @@ -39,11 +39,11 @@ void attach(final StorageChannel storageChannel, final boolean replay) { } } - void detach(final StorageChannel storageChannel) { + void detach(final RootStorage rootStorage) { if (listener == null) { return; } - storageChannel.removeListener(listener); + rootStorage.removeListener(listener); listener = null; } } diff --git a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java index e6e5647d5..d6d78513c 100644 --- a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java +++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java @@ -9,9 +9,9 @@ import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.EmptyActor; import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannelImpl; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.api.storage.root.RootStorageImpl; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl; @@ -28,26 +28,27 @@ class GridOperationsImplTest { private static final long MAX_COUNT = 15; - private StorageChannel storageChannel; + private RootStorage rootStorage; private GridOperationsImpl sut; @BeforeEach void setUp() { - storageChannel = new StorageChannelImpl(); - sut = new GridOperationsImpl(storageChannel, GridActor.INSTANCE, r -> MAX_COUNT, 1); + rootStorage = new RootStorageImpl(); + sut = new GridOperationsImpl(rootStorage, GridActor.INSTANCE, r -> MAX_COUNT, 1); } @Nested class InsertTest { @ParameterizedTest @EnumSource(GridInsertMode.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldInsertIntoDestination(final GridInsertMode insertMode) { // Arrange final Storage source = new LimitedStorageImpl(100); source.insert(A, MAX_COUNT * 3, Action.EXECUTE, EmptyActor.INSTANCE); final Storage destination = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(destination); + rootStorage.addSource(destination); // Act final boolean success = sut.insert(A, insertMode, source); @@ -60,13 +61,13 @@ void shouldInsertIntoDestination(final GridInsertMode insertMode) { case SINGLE_RESOURCE -> 1; }; - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, expectedAmount) ); assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, (MAX_COUNT * 3) - expectedAmount) ); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)) + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)) .get() .usingRecursiveComparison() .isEqualTo(new TrackedResource(GridActor.NAME, 0)); @@ -79,16 +80,16 @@ void shouldNotInsertIntoDestinationWhenResourceIsNotPresentInSource(final GridIn final Storage source = new LimitedStorageImpl(100); final Storage destination = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(destination); + rootStorage.addSource(destination); // Act final boolean success = sut.insert(A, insertMode, source); // Assert assertThat(success).isFalse(); - assertThat(storageChannel.getAll()).isEmpty(); + assertThat(rootStorage.getAll()).isEmpty(); assertThat(source.getAll()).isEmpty(); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)).isEmpty(); + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)).isEmpty(); } @ParameterizedTest @@ -99,48 +100,49 @@ void shouldNotInsertIntoDestinationWhenNoSpaceIsPresentInDestination(final GridI source.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); final Storage destination = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(destination); - storageChannel.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); + rootStorage.addSource(destination); + rootStorage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); // Act final boolean success = sut.insert(A, insertMode, source); // Assert assertThat(success).isFalse(); - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, 100) ); assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, 100) ); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)).isEmpty(); + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)).isEmpty(); } } @Nested class InsertEntireResourceTest { @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldInsertIntoDestinationWithRemainder() { // Arrange final Storage source = new LimitedStorageImpl(100); source.insert(A, MAX_COUNT, Action.EXECUTE, EmptyActor.INSTANCE); final Storage destination = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(destination); - storageChannel.insert(A, 100 - MAX_COUNT + 1, Action.EXECUTE, EmptyActor.INSTANCE); + rootStorage.addSource(destination); + rootStorage.insert(A, 100 - MAX_COUNT + 1, Action.EXECUTE, EmptyActor.INSTANCE); // Act final boolean success = sut.insert(A, GridInsertMode.ENTIRE_RESOURCE, source); // Assert assertThat(success).isTrue(); - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, 100) ); assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, 1) ); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)) + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)) .get() .usingRecursiveComparison() .isEqualTo(new TrackedResource(GridActor.NAME, 0)); @@ -170,21 +172,21 @@ public long extract(final ResourceKey resource, source.insert(A, MAX_COUNT, Action.EXECUTE, EmptyActor.INSTANCE); final Storage destination = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(destination); - storageChannel.insert(A, 100 - MAX_COUNT + 1, Action.EXECUTE, EmptyActor.INSTANCE); + rootStorage.addSource(destination); + rootStorage.insert(A, 100 - MAX_COUNT + 1, Action.EXECUTE, EmptyActor.INSTANCE); // Act final boolean success = sut.insert(A, GridInsertMode.ENTIRE_RESOURCE, source); // Assert assertThat(success).isFalse(); - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, 100 - MAX_COUNT + 1) ); assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, MAX_COUNT) ); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)).isEmpty(); + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)).isEmpty(); } } @@ -192,13 +194,14 @@ public long extract(final ResourceKey resource, class ExtractTest { @ParameterizedTest @EnumSource(GridExtractMode.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldExtractFromSourceToDestination(final GridExtractMode extractMode) { // Arrange final Storage destination = new LimitedStorageImpl(100); final Storage source = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(source); - storageChannel.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); + rootStorage.addSource(source); + rootStorage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); // Act final boolean success = sut.extract(A, extractMode, destination); @@ -212,13 +215,13 @@ void shouldExtractFromSourceToDestination(final GridExtractMode extractMode) { case SINGLE_RESOURCE -> 1; }; - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, 100 - expectedExtracted) ); assertThat(destination.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, expectedExtracted) ); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)) + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)) .get() .usingRecursiveComparison() .isEqualTo(new TrackedResource(GridActor.NAME, 0)); @@ -231,16 +234,16 @@ void shouldNotExtractFromSourceWhenResourceIsNotPresentInSource(final GridExtrac final Storage destination = new LimitedStorageImpl(100); final Storage source = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(source); + rootStorage.addSource(source); // Act final boolean success = sut.extract(A, extractMode, destination); // Assert assertThat(success).isFalse(); - assertThat(storageChannel.getAll()).isEmpty(); + assertThat(rootStorage.getAll()).isEmpty(); assertThat(destination.getAll()).isEmpty(); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)).isNotPresent(); + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)).isNotPresent(); } @ParameterizedTest @@ -251,71 +254,73 @@ void shouldNotExtractFromSourceIfThereIsNoSpaceInDestination(final GridExtractMo destination.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); final Storage source = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(source); - storageChannel.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); + rootStorage.addSource(source); + rootStorage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); // Act final boolean success = sut.extract(A, extractMode, destination); // Assert assertThat(success).isFalse(); - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, 100) ); assertThat(destination.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(B, 100) ); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)).isEmpty(); + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)).isEmpty(); } } @Nested class ExtractEntireResourceTest { @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldExtractEntireResourceFromSourceToDestinationIfResourceIsLessThanMaxCount() { // Arrange final Storage destination = new LimitedStorageImpl(100); final Storage source = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(source); - storageChannel.insert(A, MAX_COUNT - 1, Action.EXECUTE, EmptyActor.INSTANCE); + rootStorage.addSource(source); + rootStorage.insert(A, MAX_COUNT - 1, Action.EXECUTE, EmptyActor.INSTANCE); // Act final boolean success = sut.extract(A, GridExtractMode.ENTIRE_RESOURCE, destination); // Assert assertThat(success).isTrue(); - assertThat(storageChannel.getAll()).isEmpty(); + assertThat(rootStorage.getAll()).isEmpty(); assertThat(destination.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, MAX_COUNT - 1) ); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)) + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)) .get() .usingRecursiveComparison() .isEqualTo(new TrackedResource(GridActor.NAME, 0)); } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldExtractEntireResourceWithRemainderFromSourceToDestinationIfThereIsNotEnoughSpaceInDestination() { // Arrange final Storage destination = new LimitedStorageImpl(MAX_COUNT - 1); final Storage source = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(source); - storageChannel.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); + rootStorage.addSource(source); + rootStorage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); // Act final boolean success = sut.extract(A, GridExtractMode.ENTIRE_RESOURCE, destination); // Assert assertThat(success).isTrue(); - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, 100 - MAX_COUNT + 1) ); assertThat(destination.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, MAX_COUNT - 1) ); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)) + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)) .get() .usingRecursiveComparison() .isEqualTo(new TrackedResource(GridActor.NAME, 0)); @@ -325,24 +330,25 @@ void shouldExtractEntireResourceWithRemainderFromSourceToDestinationIfThereIsNot @Nested class ExtractHalfResourceTest { @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldExtractSingleAmountIfResourceHasSingleAmountWhenExtractingHalfResourceFromSourceToDestination() { // Arrange final Storage destination = new LimitedStorageImpl(MAX_COUNT); final Storage source = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L); - storageChannel.addSource(source); - storageChannel.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE); + rootStorage.addSource(source); + rootStorage.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE); // Act final boolean success = sut.extract(A, GridExtractMode.HALF_RESOURCE, destination); // Assert assertThat(success).isTrue(); - assertThat(storageChannel.getAll()).isEmpty(); + assertThat(rootStorage.getAll()).isEmpty(); assertThat(destination.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( new ResourceAmount(A, 1) ); - assertThat(storageChannel.findTrackedResourceByActorType(A, GridActor.class)) + assertThat(rootStorage.findTrackedResourceByActorType(A, GridActor.class)) .get() .usingRecursiveComparison() .isEqualTo(new TrackedResource(GridActor.NAME, 0)); diff --git a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/package-info.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/package-info.java new file mode 100644 index 000000000..7a3c634f8 --- /dev/null +++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.api.grid.service; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java index 32679b515..2837dd328 100644 --- a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java +++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java @@ -28,8 +28,12 @@ class GridViewImplTest { @BeforeEach void setUp() { - viewBuilder = new GridViewBuilderImpl( - resourceAmount -> Optional.of(new GridResourceImpl(resourceAmount)), + viewBuilder = getViewBuilder(resourceAmount -> Optional.of(new GridResourceImpl(resourceAmount))); + } + + private static GridViewBuilderImpl getViewBuilder(final GridResourceFactory resourceFactory) { + return new GridViewBuilderImpl( + resourceFactory, view -> Comparator.comparing(GridResource::getName), view -> Comparator.comparing(GridResource::getAmount) ); @@ -42,10 +46,8 @@ void shouldAddResourcesWithSameNameButDifferentIdentity() { // in the view, but actually isn't because it has a different identity. // Arrange - final GridViewBuilder builder = new GridViewBuilderImpl( - resourceAmount -> Optional.of(new GridResourceWithMetadata(resourceAmount)), - view -> Comparator.comparing(GridResource::getName), - view -> Comparator.comparing(GridResource::getAmount) + final GridViewBuilder builder = getViewBuilder( + resourceAmount -> Optional.of(new GridResourceWithMetadata(resourceAmount)) ); final GridView view = builder.build(); @@ -92,6 +94,7 @@ void shouldPreserveOrderWhenSortingAndTwoResourcesHaveTheSameQuantity() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldLoadResourcesAndRetrieveTrackedResourcesProperly() { // Arrange final GridView view = viewBuilder @@ -344,6 +347,7 @@ void shouldNotReorderExistingResourceWhenPreventingSorting() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldUpdateTrackedResourceAfterReceivingChange() { // Act final GridView view = viewBuilder.build(); diff --git a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java index efcfbf5da..77e0b2814 100644 --- a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java +++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java @@ -3,8 +3,8 @@ import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannelImpl; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.api.storage.root.RootStorageImpl; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -24,24 +24,24 @@ class GridWatcherManagerImplTest { GridWatcherManager sut; - StorageChannel storageChannel; + RootStorage rootStorage; @BeforeEach void setUp() { sut = new GridWatcherManagerImpl(); - storageChannel = new StorageChannelImpl(); - storageChannel.addSource(new InMemoryStorageImpl()); + rootStorage = new RootStorageImpl(); + rootStorage.addSource(new InMemoryStorageImpl()); } @Test void shouldAddWatcherAndNotifyOfChanges() { // Arrange final GridWatcher watcher = mock(GridWatcher.class); - storageChannel.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); + rootStorage.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); // Act - sut.addWatcher(watcher, FakeActor.class, storageChannel); - storageChannel.insert(B, 5, Action.EXECUTE, FakeActor.INSTANCE); + sut.addWatcher(watcher, FakeActor.class, rootStorage); + rootStorage.insert(B, 5, Action.EXECUTE, FakeActor.INSTANCE); // Assert verify(watcher, times(1)).onChanged(B, 5, null); @@ -52,12 +52,12 @@ void shouldAddWatcherAndNotifyOfChanges() { void shouldNotAddDuplicateWatcher() { // Arrange final GridWatcher watcher = mock(GridWatcher.class); - sut.addWatcher(watcher, FakeActor.class, storageChannel); + sut.addWatcher(watcher, FakeActor.class, rootStorage); // Act & assert assertThrows( IllegalArgumentException.class, - () -> sut.addWatcher(watcher, FakeActor.class, storageChannel), + () -> sut.addWatcher(watcher, FakeActor.class, rootStorage), "Watcher is already registered" ); } @@ -66,12 +66,12 @@ void shouldNotAddDuplicateWatcher() { void shouldRemoveWatcher() { // Arrange final GridWatcher watcher = mock(GridWatcher.class); - storageChannel.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); - sut.addWatcher(watcher, FakeActor.class, storageChannel); + rootStorage.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); + sut.addWatcher(watcher, FakeActor.class, rootStorage); // Act - sut.removeWatcher(watcher, storageChannel); - storageChannel.insert(B, 5, Action.EXECUTE, FakeActor.INSTANCE); + sut.removeWatcher(watcher, rootStorage); + rootStorage.insert(B, 5, Action.EXECUTE, FakeActor.INSTANCE); // Assert verifyNoInteractions(watcher); @@ -85,7 +85,7 @@ void shouldNotRemoveWatcherThatIsNotRegistered() { // Act & assert assertThrows( IllegalArgumentException.class, - () -> sut.removeWatcher(watcher, storageChannel), + () -> sut.removeWatcher(watcher, rootStorage), "Watcher is not registered" ); } @@ -94,15 +94,15 @@ void shouldNotRemoveWatcherThatIsNotRegistered() { void shouldAddAndRemoveAndAddWatcherAgain() { // Arrange final GridWatcher watcher = mock(GridWatcher.class); - storageChannel.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); + rootStorage.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); // Act - sut.addWatcher(watcher, FakeActor.class, storageChannel); - storageChannel.insert(B, 5, Action.EXECUTE, FakeActor.INSTANCE); - sut.removeWatcher(watcher, storageChannel); - storageChannel.insert(C, 4, Action.EXECUTE, FakeActor.INSTANCE); - sut.addWatcher(watcher, FakeActor.class, storageChannel); - storageChannel.insert(D, 3, Action.EXECUTE, FakeActor.INSTANCE); + sut.addWatcher(watcher, FakeActor.class, rootStorage); + rootStorage.insert(B, 5, Action.EXECUTE, FakeActor.INSTANCE); + sut.removeWatcher(watcher, rootStorage); + rootStorage.insert(C, 4, Action.EXECUTE, FakeActor.INSTANCE); + sut.addWatcher(watcher, FakeActor.class, rootStorage); + rootStorage.insert(D, 3, Action.EXECUTE, FakeActor.INSTANCE); // Assert verify(watcher, times(1)).onChanged(B, 5, null); @@ -114,16 +114,16 @@ void shouldAddAndRemoveAndAddWatcherAgain() { void shouldDetachAll() { // Arrange final GridWatcher watcher = mock(GridWatcher.class); - storageChannel.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); - sut.addWatcher(watcher, FakeActor.class, storageChannel); + rootStorage.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); + sut.addWatcher(watcher, FakeActor.class, rootStorage); // Act - sut.detachAll(storageChannel); - storageChannel.insert(B, 10, Action.EXECUTE, FakeActor.INSTANCE); + sut.detachAll(rootStorage); + rootStorage.insert(B, 10, Action.EXECUTE, FakeActor.INSTANCE); assertThrows(IllegalArgumentException.class, () -> sut.addWatcher( watcher, FakeActor.class, - storageChannel + rootStorage ), "Watcher is already registered"); // Assert @@ -134,14 +134,14 @@ void shouldDetachAll() { void shouldAttachAll() { // Arrange final GridWatcher watcher = mock(GridWatcher.class); - storageChannel.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); - sut.addWatcher(watcher, FakeActor.class, storageChannel); - sut.detachAll(storageChannel); - storageChannel.insert(B, 5, Action.EXECUTE, FakeActor.INSTANCE); + rootStorage.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE); + sut.addWatcher(watcher, FakeActor.class, rootStorage); + sut.detachAll(rootStorage); + rootStorage.insert(B, 5, Action.EXECUTE, FakeActor.INSTANCE); // Act - sut.attachAll(storageChannel); - storageChannel.insert(C, 4, Action.EXECUTE, FakeActor.INSTANCE); + sut.attachAll(rootStorage); + rootStorage.insert(C, 4, Action.EXECUTE, FakeActor.INSTANCE); // Assert final InOrder inOrder = inOrder(watcher); @@ -157,7 +157,7 @@ void shouldNotifyAboutActivenessChange() { // Arrange final GridWatcher watcher = mock(GridWatcher.class); sut.activeChanged(true); - sut.addWatcher(watcher, FakeActor.class, storageChannel); + sut.addWatcher(watcher, FakeActor.class, rootStorage); // Act sut.activeChanged(false); diff --git a/refinedstorage-neoforge-api/build.gradle.kts b/refinedstorage-neoforge-api/build.gradle.kts new file mode 100644 index 000000000..c0f4728ef --- /dev/null +++ b/refinedstorage-neoforge-api/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + id("refinedarchitect.neoforge") +} + +refinedarchitect { + neoForge() +} + +dependencies { + api(libs.apiguardian) + api(project(":refinedstorage-common-api")) +} + +base { + archivesName.set("refinedstorage-neoforge-api") +} diff --git a/refinedstorage-neoforge-api/src/main/java/com/refinedmods/refinedstorage/neoforge/api/RefinedStorageNeoForgeApi.java b/refinedstorage-neoforge-api/src/main/java/com/refinedmods/refinedstorage/neoforge/api/RefinedStorageNeoForgeApi.java new file mode 100644 index 000000000..ac8fe960a --- /dev/null +++ b/refinedstorage-neoforge-api/src/main/java/com/refinedmods/refinedstorage/neoforge/api/RefinedStorageNeoForgeApi.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage.neoforge.api; + +import com.refinedmods.refinedstorage.api.core.NullableType; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; + +import net.minecraft.core.Direction; +import net.neoforged.neoforge.capabilities.BlockCapability; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.5") +public interface RefinedStorageNeoForgeApi { + RefinedStorageNeoForgeApi INSTANCE = new RefinedStorageNeoForgeApiProxy(); + + BlockCapability getNetworkNodeContainerProviderCapability(); +} diff --git a/refinedstorage-neoforge-api/src/main/java/com/refinedmods/refinedstorage/neoforge/api/RefinedStorageNeoForgeApiProxy.java b/refinedstorage-neoforge-api/src/main/java/com/refinedmods/refinedstorage/neoforge/api/RefinedStorageNeoForgeApiProxy.java new file mode 100644 index 000000000..7512269cd --- /dev/null +++ b/refinedstorage-neoforge-api/src/main/java/com/refinedmods/refinedstorage/neoforge/api/RefinedStorageNeoForgeApiProxy.java @@ -0,0 +1,32 @@ +package com.refinedmods.refinedstorage.neoforge.api; + +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; + +import javax.annotation.Nullable; + +import net.minecraft.core.Direction; +import net.neoforged.neoforge.capabilities.BlockCapability; + +public class RefinedStorageNeoForgeApiProxy implements RefinedStorageNeoForgeApi { + @Nullable + private RefinedStorageNeoForgeApi delegate; + + public void setDelegate(final RefinedStorageNeoForgeApi delegate) { + if (this.delegate != null) { + throw new IllegalStateException("NeoForge API already injected"); + } + this.delegate = delegate; + } + + @Override + public BlockCapability getNetworkNodeContainerProviderCapability() { + return ensureLoaded().getNetworkNodeContainerProviderCapability(); + } + + private RefinedStorageNeoForgeApi ensureLoaded() { + if (delegate == null) { + throw new IllegalStateException("NeoForge API not loaded yet"); + } + return delegate; + } +} diff --git a/refinedstorage-neoforge-api/src/main/java/com/refinedmods/refinedstorage/neoforge/api/package-info.java b/refinedstorage-neoforge-api/src/main/java/com/refinedmods/refinedstorage/neoforge/api/package-info.java new file mode 100644 index 000000000..138971566 --- /dev/null +++ b/refinedstorage-neoforge-api/src/main/java/com/refinedmods/refinedstorage/neoforge/api/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.api; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-neoforge/build.gradle.kts b/refinedstorage-neoforge/build.gradle.kts new file mode 100644 index 000000000..d8bfbe328 --- /dev/null +++ b/refinedstorage-neoforge/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("refinedarchitect.neoforge") +} + +refinedarchitect { + modId = "refinedstorage" + neoForge() + gameTests() + dataGeneration(project(":refinedstorage-common")) + compileWithProject(project(":refinedstorage-common")) + compileWithProject(project(":refinedstorage-common-api")) + compileWithProject(project(":refinedstorage-neoforge-api")) + compileWithProject(project(":refinedstorage-core-api")) + compileWithProject(project(":refinedstorage-resource-api")) + compileWithProject(project(":refinedstorage-storage-api")) + compileWithProject(project(":refinedstorage-network-api")) + compileWithProject(project(":refinedstorage-network")) + compileWithProject(project(":refinedstorage-grid-api")) + compileWithProject(project(":refinedstorage-query-parser")) + publishing { + maven = true + // curseForge = "243076" + // modrinth = "refined-storage" + } +} + +base { + archivesName.set("refinedstorage-neoforge") +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ClientModInitializer.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ClientModInitializer.java new file mode 100644 index 000000000..bba37a5c7 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ClientModInitializer.java @@ -0,0 +1,238 @@ +package com.refinedmods.refinedstorage.neoforge; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.AbstractClientModInitializer; +import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage.common.api.upgrade.AbstractUpgradeItem; +import com.refinedmods.refinedstorage.common.configurationcard.ConfigurationCardItemPropertyFunction; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.content.KeyMappings; +import com.refinedmods.refinedstorage.common.controller.ControllerItemPropertyFunction; +import com.refinedmods.refinedstorage.common.networking.NetworkCardItemPropertyFunction; +import com.refinedmods.refinedstorage.common.security.SecurityCardItemPropertyFunction; +import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorBlockEntityRenderer; +import com.refinedmods.refinedstorage.common.support.network.item.NetworkItemPropertyFunction; +import com.refinedmods.refinedstorage.common.support.tooltip.CompositeClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.tooltip.HelpClientTooltipComponent; +import com.refinedmods.refinedstorage.common.support.tooltip.ResourceClientTooltipComponent; +import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeItem; +import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinationClientTooltipComponent; +import com.refinedmods.refinedstorage.neoforge.storage.diskdrive.DiskDriveBlockEntityRendererImpl; +import com.refinedmods.refinedstorage.neoforge.storage.diskdrive.DiskDriveGeometryLoader; +import com.refinedmods.refinedstorage.neoforge.storage.diskinterface.DiskInterfaceBlockEntityRendererImpl; +import com.refinedmods.refinedstorage.neoforge.storage.diskinterface.DiskInterfaceGeometryLoader; +import com.refinedmods.refinedstorage.neoforge.storage.portablegrid.PortableGridBlockEntityRendererImpl; +import com.refinedmods.refinedstorage.neoforge.storage.portablegrid.PortableGridGeometryLoader; + +import java.util.List; + +import com.mojang.blaze3d.platform.InputConstants; +import net.minecraft.client.KeyMapping; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.gui.screens.inventory.MenuAccess; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; +import net.minecraft.client.renderer.item.ItemProperties; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.MenuType; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.neoforge.client.event.InputEvent; +import net.neoforged.neoforge.client.event.ModelEvent; +import net.neoforged.neoforge.client.event.RegisterClientTooltipComponentFactoriesEvent; +import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; +import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; +import net.neoforged.neoforge.client.settings.KeyConflictContext; +import net.neoforged.neoforge.client.settings.KeyModifier; +import net.neoforged.neoforge.common.NeoForge; +import org.lwjgl.glfw.GLFW; + +import static com.refinedmods.refinedstorage.common.content.ContentIds.DISK_DRIVE; +import static com.refinedmods.refinedstorage.common.content.ContentIds.PORTABLE_GRID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public final class ClientModInitializer extends AbstractClientModInitializer { + private ClientModInitializer() { + } + + @SubscribeEvent + public static void onClientSetup(final FMLClientSetupEvent e) { + NeoForge.EVENT_BUS.addListener(ClientModInitializer::onKeyInput); + e.enqueueWork(ClientModInitializer::registerModelPredicates); + e.enqueueWork(ClientModInitializer::registerItemProperties); + registerBlockEntityRenderer(); + registerResourceRendering(); + registerAlternativeGridHints(); + registerDiskModels(); + } + + @SubscribeEvent + public static void onKeyInput(final InputEvent.Key e) { + handleInputEvents(); + } + + private static void registerModelPredicates() { + Items.INSTANCE.getControllers().forEach(controllerBlockItem -> ItemProperties.register( + controllerBlockItem.get(), + createIdentifier("stored_in_controller"), + new ControllerItemPropertyFunction() + )); + } + + @SubscribeEvent + public static void onRegisterModelGeometry(final ModelEvent.RegisterGeometryLoaders e) { + registerDiskModels(); + e.register(DISK_DRIVE, new DiskDriveGeometryLoader()); + e.register(PORTABLE_GRID, new PortableGridGeometryLoader()); + Blocks.INSTANCE.getDiskInterface().forEach( + (color, id, supplier) -> e.register(id, new DiskInterfaceGeometryLoader(color)) + ); + } + + @SubscribeEvent + public static void onRegisterMenuScreens(final RegisterMenuScreensEvent e) { + registerScreens(new ScreenRegistration() { + @Override + public > void register( + final MenuType type, + final ScreenConstructor factory + ) { + e.register(type, factory::create); + } + }); + } + + @SubscribeEvent + public static void onRegisterKeyMappings(final RegisterKeyMappingsEvent e) { + final KeyMapping focusSearchBarKeyBinding = new KeyMapping( + ContentNames.FOCUS_SEARCH_BAR_TRANSLATION_KEY, + InputConstants.Type.KEYSYM, + GLFW.GLFW_KEY_TAB, + ContentNames.MOD_TRANSLATION_KEY + ); + e.register(focusSearchBarKeyBinding); + KeyMappings.INSTANCE.setFocusSearchBar(focusSearchBarKeyBinding); + + final KeyMapping clearCraftingGridMatrixToNetwork = new KeyMapping( + ContentNames.CLEAR_CRAFTING_MATRIX_TO_NETWORK_TRANSLATION_KEY, + KeyConflictContext.GUI, + KeyModifier.CONTROL, + InputConstants.Type.KEYSYM, + GLFW.GLFW_KEY_X, + ContentNames.MOD_TRANSLATION_KEY + ); + e.register(clearCraftingGridMatrixToNetwork); + KeyMappings.INSTANCE.setClearCraftingGridMatrixToNetwork(clearCraftingGridMatrixToNetwork); + + final KeyMapping clearCraftingGridMatrixToInventory = new KeyMapping( + ContentNames.CLEAR_CRAFTING_MATRIX_TO_INVENTORY_TRANSLATION_KEY, + InputConstants.UNKNOWN.getValue(), + ContentNames.MOD_TRANSLATION_KEY + ); + e.register(clearCraftingGridMatrixToInventory); + KeyMappings.INSTANCE.setClearCraftingGridMatrixToInventory(clearCraftingGridMatrixToInventory); + + final KeyMapping openWirelessGrid = new KeyMapping( + ContentNames.OPEN_WIRELESS_GRID_TRANSLATION_KEY, + KeyConflictContext.IN_GAME, + InputConstants.UNKNOWN, + ContentNames.MOD_TRANSLATION_KEY + ); + e.register(openWirelessGrid); + KeyMappings.INSTANCE.setOpenWirelessGrid(openWirelessGrid); + + final KeyMapping openPortableGrid = new KeyMapping( + ContentNames.OPEN_PORTABLE_GRID_TRANSLATION_KEY, + KeyConflictContext.IN_GAME, + InputConstants.UNKNOWN, + ContentNames.MOD_TRANSLATION_KEY + ); + e.register(openPortableGrid); + KeyMappings.INSTANCE.setOpenPortableGrid(openPortableGrid); + } + + private static void registerBlockEntityRenderer() { + BlockEntityRenderers.register( + BlockEntities.INSTANCE.getDiskDrive(), + ctx -> new DiskDriveBlockEntityRendererImpl<>() + ); + BlockEntityRenderers.register( + BlockEntities.INSTANCE.getStorageMonitor(), + ctx -> new StorageMonitorBlockEntityRenderer() + ); + BlockEntityRenderers.register( + BlockEntities.INSTANCE.getPortableGrid(), + ctx -> new PortableGridBlockEntityRendererImpl<>() + ); + BlockEntityRenderers.register( + BlockEntities.INSTANCE.getCreativePortableGrid(), + ctx -> new PortableGridBlockEntityRendererImpl<>() + ); + BlockEntityRenderers.register( + BlockEntities.INSTANCE.getDiskInterface(), + ctx -> new DiskInterfaceBlockEntityRendererImpl<>() + ); + } + + @SubscribeEvent + public static void onRegisterTooltipFactories(final RegisterClientTooltipComponentFactoriesEvent e) { + e.register( + AbstractUpgradeItem.UpgradeDestinationTooltipComponent.class, + component -> new UpgradeDestinationClientTooltipComponent(component.destinations()) + ); + e.register( + HelpTooltipComponent.class, + component -> HelpClientTooltipComponent.create(component.text()) + ); + e.register( + RegulatorUpgradeItem.RegulatorTooltipComponent.class, + component -> { + final ClientTooltipComponent help = HelpClientTooltipComponent.create(component.helpText()); + return component.configuredResource() == null + ? help + : createRegulatorUpgradeClientTooltipComponent(component.configuredResource(), help); + } + ); + } + + private static CompositeClientTooltipComponent createRegulatorUpgradeClientTooltipComponent( + final ResourceAmount configuredResource, + final ClientTooltipComponent help + ) { + return new CompositeClientTooltipComponent(List.of( + new ResourceClientTooltipComponent(configuredResource), + help + )); + } + + private static void registerItemProperties() { + ItemProperties.register( + Items.INSTANCE.getWirelessGrid(), + NetworkItemPropertyFunction.NAME, + new NetworkItemPropertyFunction() + ); + ItemProperties.register( + Items.INSTANCE.getCreativeWirelessGrid(), + NetworkItemPropertyFunction.NAME, + new NetworkItemPropertyFunction() + ); + ItemProperties.register( + Items.INSTANCE.getConfigurationCard(), + ConfigurationCardItemPropertyFunction.NAME, + new ConfigurationCardItemPropertyFunction() + ); + ItemProperties.register( + Items.INSTANCE.getNetworkCard(), + NetworkCardItemPropertyFunction.NAME, + new NetworkCardItemPropertyFunction() + ); + ItemProperties.register( + Items.INSTANCE.getSecurityCard(), + SecurityCardItemPropertyFunction.NAME, + new SecurityCardItemPropertyFunction() + ); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java new file mode 100644 index 000000000..9a4322505 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java @@ -0,0 +1,872 @@ +package com.refinedmods.refinedstorage.neoforge; + +import com.refinedmods.refinedstorage.api.grid.view.GridSortingDirection; +import com.refinedmods.refinedstorage.common.Config; +import com.refinedmods.refinedstorage.common.content.DefaultEnergyUsage; +import com.refinedmods.refinedstorage.common.grid.CraftingGridMatrixCloseBehavior; +import com.refinedmods.refinedstorage.common.grid.GridSortingTypes; +import com.refinedmods.refinedstorage.common.support.stretching.ScreenSize; + +import java.util.Optional; + +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.common.ModConfigSpec; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslationKey; + +public class ConfigImpl implements Config { + private static final String ENERGY_USAGE = "energyUsage"; + private static final String ENERGY_CAPACITY = "energyCapacity"; + + private final ModConfigSpec.Builder builder = new ModConfigSpec.Builder(); + private final ModConfigSpec spec; + + private final ModConfigSpec.EnumValue screenSize; + private final ModConfigSpec.BooleanValue smoothScrolling; + private final ModConfigSpec.IntValue maxRowsStretch; + private final SimpleEnergyUsageEntry cable; + private final ControllerEntry controller; + private final DiskDriveEntry diskDrive; + private final DiskInterfaceEntry diskInterface; + private final GridEntry grid; + private final CraftingGridEntry craftingGrid; + private final StorageBlockEntry storageBlock; + private final FluidStorageBlockEntry fluidStorageBlock; + private final SimpleEnergyUsageEntry importer; + private final SimpleEnergyUsageEntry exporter; + private final UpgradeEntry upgrade; + private final SimpleEnergyUsageEntry iface; + private final SimpleEnergyUsageEntry externalStorage; + private final SimpleEnergyUsageEntry detector; + private final SimpleEnergyUsageEntry destructor; + private final SimpleEnergyUsageEntry constructor; + private final WirelessGridEntry wirelessGrid; + private final WirelessTransmitterEntry wirelessTransmitter; + private final SimpleEnergyUsageEntry storageMonitor; + private final SimpleEnergyUsageEntry networkReceiver; + private final SimpleEnergyUsageEntry networkTransmitter; + private final PortableGridEntry portableGrid; + private final SimpleEnergyUsageEntry securityCard; + private final SimpleEnergyUsageEntry fallbackSecurityCard; + private final SimpleEnergyUsageEntry securityManager; + private final RelayEntry relay; + + public ConfigImpl() { + screenSize = builder + .translation(translationKey("screenSize")) + .defineEnum("screenSize", ScreenSize.STRETCH); + smoothScrolling = builder + .translation(translationKey("smoothScrolling")) + .define("smoothScrolling", true); + maxRowsStretch = builder + .translation(translationKey("maxRowsStretch")) + .defineInRange("maxRowsStretch", 256, 3, 256); + cable = new SimpleEnergyUsageEntryImpl("cable", DefaultEnergyUsage.CABLE); + controller = new ControllerEntryImpl(); + diskDrive = new DiskDriveEntryImpl(); + diskInterface = new DiskInterfaceEntryImpl(); + grid = new GridEntryImpl(); + craftingGrid = new CraftingGridEntryImpl(); + storageBlock = new StorageBlockEntryImpl(); + fluidStorageBlock = new FluidStorageBlockEntryImpl(); + importer = new SimpleEnergyUsageEntryImpl("importer", DefaultEnergyUsage.IMPORTER); + exporter = new SimpleEnergyUsageEntryImpl("exporter", DefaultEnergyUsage.EXPORTER); + upgrade = new UpgradeEntryImpl(); + iface = new SimpleEnergyUsageEntryImpl("interface", DefaultEnergyUsage.INTERFACE); + externalStorage = new SimpleEnergyUsageEntryImpl("externalStorage", DefaultEnergyUsage.EXTERNAL_STORAGE); + detector = new SimpleEnergyUsageEntryImpl("detector", DefaultEnergyUsage.DETECTOR); + destructor = new SimpleEnergyUsageEntryImpl("destructor", DefaultEnergyUsage.DESTRUCTOR); + constructor = new SimpleEnergyUsageEntryImpl("constructor", DefaultEnergyUsage.CONSTRUCTOR); + wirelessGrid = new WirelessGridEntryImpl(); + wirelessTransmitter = new WirelessTransmitterEntryImpl(); + storageMonitor = new SimpleEnergyUsageEntryImpl("storageMonitor", DefaultEnergyUsage.STORAGE_MONITOR); + networkReceiver = new SimpleEnergyUsageEntryImpl("networkReceiver", DefaultEnergyUsage.NETWORK_RECEIVER); + networkTransmitter = new SimpleEnergyUsageEntryImpl( + "networkTransmitter", + DefaultEnergyUsage.NETWORK_TRANSMITTER + ); + portableGrid = new PortableGridEntryImpl(); + securityCard = new SimpleEnergyUsageEntryImpl("securityCard", DefaultEnergyUsage.SECURITY_CARD); + fallbackSecurityCard = new SimpleEnergyUsageEntryImpl( + "fallbackSecurityCard", + DefaultEnergyUsage.FALLBACK_SECURITY_CARD + ); + securityManager = new SimpleEnergyUsageEntryImpl("securityManager", DefaultEnergyUsage.SECURITY_MANAGER); + relay = new RelayEntryImpl(); + spec = builder.build(); + } + + public ModConfigSpec getSpec() { + return spec; + } + + @Override + public ScreenSize getScreenSize() { + return screenSize.get(); + } + + @Override + public boolean isSmoothScrolling() { + return smoothScrolling.get(); + } + + @Override + public int getMaxRowsStretch() { + return maxRowsStretch.get(); + } + + @Override + public void setScreenSize(final ScreenSize screenSize) { + this.screenSize.set(screenSize); + } + + @Override + public GridEntry getGrid() { + return grid; + } + + @Override + public CraftingGridEntry getCraftingGrid() { + return craftingGrid; + } + + @Override + public ControllerEntry getController() { + return controller; + } + + @Override + public DiskDriveEntry getDiskDrive() { + return diskDrive; + } + + @Override + public DiskInterfaceEntry getDiskInterface() { + return diskInterface; + } + + @Override + public SimpleEnergyUsageEntry getCable() { + return cable; + } + + @Override + public StorageBlockEntry getStorageBlock() { + return storageBlock; + } + + @Override + public FluidStorageBlockEntry getFluidStorageBlock() { + return fluidStorageBlock; + } + + @Override + public SimpleEnergyUsageEntry getImporter() { + return importer; + } + + @Override + public SimpleEnergyUsageEntry getExporter() { + return exporter; + } + + @Override + public UpgradeEntry getUpgrade() { + return upgrade; + } + + @Override + public SimpleEnergyUsageEntry getInterface() { + return iface; + } + + @Override + public SimpleEnergyUsageEntry getExternalStorage() { + return externalStorage; + } + + @Override + public SimpleEnergyUsageEntry getDetector() { + return detector; + } + + @Override + public SimpleEnergyUsageEntry getDestructor() { + return destructor; + } + + @Override + public SimpleEnergyUsageEntry getConstructor() { + return constructor; + } + + @Override + public WirelessGridEntry getWirelessGrid() { + return wirelessGrid; + } + + @Override + public WirelessTransmitterEntry getWirelessTransmitter() { + return wirelessTransmitter; + } + + @Override + public SimpleEnergyUsageEntry getStorageMonitor() { + return storageMonitor; + } + + @Override + public SimpleEnergyUsageEntry getNetworkReceiver() { + return networkReceiver; + } + + @Override + public SimpleEnergyUsageEntry getNetworkTransmitter() { + return networkTransmitter; + } + + @Override + public PortableGridEntry getPortableGrid() { + return portableGrid; + } + + @Override + public SimpleEnergyUsageEntry getSecurityCard() { + return securityCard; + } + + @Override + public SimpleEnergyUsageEntry getFallbackSecurityCard() { + return fallbackSecurityCard; + } + + @Override + public SimpleEnergyUsageEntry getSecurityManager() { + return securityManager; + } + + @Override + public RelayEntry getRelay() { + return relay; + } + + private static String translationKey(final String value) { + return createTranslationKey("text.autoconfig", "option." + value); + } + + private class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry { + private final ModConfigSpec.LongValue energyUsage; + + SimpleEnergyUsageEntryImpl(final String path, final long defaultValue) { + final String correctedPath = "interface".equals(path) ? "iface" : path; + builder.translation(translationKey(correctedPath)).push(path); + energyUsage = builder + .translation(translationKey(correctedPath + "." + ENERGY_USAGE)) + .defineInRange(ENERGY_USAGE, defaultValue, 0, Long.MAX_VALUE); + builder.pop(); + } + + @Override + public long getEnergyUsage() { + return energyUsage.get(); + } + } + + private class ControllerEntryImpl implements ControllerEntry { + private final ModConfigSpec.LongValue energyCapacity; + + private ControllerEntryImpl() { + builder.translation(translationKey("controller")).push("controller"); + energyCapacity = builder + .translation(translationKey("controller." + ENERGY_CAPACITY)) + .defineInRange(ENERGY_CAPACITY, DefaultEnergyUsage.CONTROLLER_CAPACITY, 0, Long.MAX_VALUE); + builder.pop(); + } + + @Override + public long getEnergyCapacity() { + return energyCapacity.get(); + } + } + + private class DiskDriveEntryImpl implements DiskDriveEntry { + private final ModConfigSpec.LongValue energyUsage; + private final ModConfigSpec.LongValue energyUsagePerDisk; + + private DiskDriveEntryImpl() { + builder.translation(translationKey("diskDrive")).push("diskDrive"); + energyUsage = builder + .translation(translationKey("diskDrive." + ENERGY_USAGE)) + .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.DISK_DRIVE, 0, Long.MAX_VALUE); + energyUsagePerDisk = builder + .translation(translationKey("diskDrive.energyUsagePerDisk")) + .defineInRange("energyUsagePerDisk", DefaultEnergyUsage.DISK_DRIVE_PER_DISK, 0, Long.MAX_VALUE); + builder.pop(); + } + + @Override + public long getEnergyUsage() { + return energyUsage.get(); + } + + @Override + public long getEnergyUsagePerDisk() { + return energyUsagePerDisk.get(); + } + } + + private class DiskInterfaceEntryImpl implements DiskInterfaceEntry { + private final ModConfigSpec.LongValue energyUsage; + private final ModConfigSpec.LongValue energyUsagePerDisk; + + private DiskInterfaceEntryImpl() { + builder.translation(translationKey("diskInterface")).push("diskInterface"); + energyUsage = builder + .translation(translationKey("diskInterface." + ENERGY_USAGE)) + .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.DISK_INTERFACE, 0, Long.MAX_VALUE); + energyUsagePerDisk = builder + .translation(translationKey("diskInterface.energyUsagePerDisk")) + .defineInRange("energyUsagePerDisk", DefaultEnergyUsage.DISK_INTERFACE_PER_DISK, 0, Long.MAX_VALUE); + builder.pop(); + } + + @Override + public long getEnergyUsage() { + return energyUsage.get(); + } + + @Override + public long getEnergyUsagePerDisk() { + return energyUsagePerDisk.get(); + } + } + + private class GridEntryImpl implements GridEntry { + private final ModConfigSpec.BooleanValue largeFont; + private final ModConfigSpec.BooleanValue preventSortingWhileShiftIsDown; + private final ModConfigSpec.BooleanValue detailedTooltip; + private final ModConfigSpec.BooleanValue rememberSearchQuery; + private final ModConfigSpec.LongValue energyUsage; + private final ModConfigSpec.BooleanValue autoSelected; + private final ModConfigSpec.ConfigValue synchronizer; + private final ModConfigSpec.ConfigValue resourceType; + private final ModConfigSpec.EnumValue sortingDirection; + private final ModConfigSpec.EnumValue sortingType; + + GridEntryImpl() { + builder.translation(translationKey("grid")).push("grid"); + largeFont = builder + .translation(translationKey("grid.largeFont")) + .define("largeFont", false); + preventSortingWhileShiftIsDown = builder + .translation(translationKey("grid.preventSortingWhileShiftIsDown")) + .define("preventSortingWhileShiftIsDown", true); + detailedTooltip = builder + .translation(translationKey("grid.detailedTooltip")) + .define("detailedTooltip", true); + rememberSearchQuery = builder + .translation(translationKey("grid.rememberSearchQuery")) + .define("rememberSearchQuery", false); + energyUsage = builder + .translation(translationKey("grid." + ENERGY_USAGE)) + .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.GRID, 0, Long.MAX_VALUE); + autoSelected = builder + .translation(translationKey("grid.autoSelected")) + .define("autoSelected", false); + synchronizer = builder + .translation(translationKey("grid.synchronizer")) + .define("synchronizer", ""); + resourceType = builder + .translation(translationKey("grid.resourceType")) + .define("resourceType", ""); + sortingDirection = builder + .translation(translationKey("grid.sortingDirection")) + .defineEnum("sortingDirection", GridSortingDirection.ASCENDING); + sortingType = builder + .translation(translationKey("grid.sortingType")) + .defineEnum("sortingType", GridSortingTypes.QUANTITY); + builder.pop(); + } + + @Override + public boolean isLargeFont() { + return largeFont.get(); + } + + @Override + public boolean isPreventSortingWhileShiftIsDown() { + return preventSortingWhileShiftIsDown.get(); + } + + @Override + public boolean isDetailedTooltip() { + return detailedTooltip.get(); + } + + @Override + public boolean isRememberSearchQuery() { + return rememberSearchQuery.get(); + } + + @Override + public long getEnergyUsage() { + return energyUsage.get(); + } + + @Override + public boolean isAutoSelected() { + return autoSelected.get(); + } + + @Override + public void setAutoSelected(final boolean autoSelected) { + this.autoSelected.set(autoSelected); + } + + @Override + public Optional getSynchronizer() { + if (synchronizer.get().trim().isBlank()) { + return Optional.empty(); + } + return Optional.of(synchronizer.get()).map(ResourceLocation::tryParse); + } + + @Override + public void setSynchronizer(final ResourceLocation synchronizerId) { + this.synchronizer.set(synchronizerId.toString()); + } + + @Override + public void clearSynchronizer() { + this.synchronizer.set(""); + } + + @Override + public GridSortingDirection getSortingDirection() { + return sortingDirection.get(); + } + + @Override + public void setSortingDirection(final GridSortingDirection sortingDirection) { + this.sortingDirection.set(sortingDirection); + } + + @Override + public GridSortingTypes getSortingType() { + return sortingType.get(); + } + + @Override + public void setSortingType(final GridSortingTypes sortingType) { + this.sortingType.set(sortingType); + } + + @Override + public Optional getResourceType() { + if (resourceType.get().trim().isBlank()) { + return Optional.empty(); + } + return Optional.of(resourceType.get()).map(ResourceLocation::tryParse); + } + + @Override + public void setResourceType(final ResourceLocation resourceTypeId) { + this.resourceType.set(resourceTypeId.toString()); + } + + @Override + public void clearResourceType() { + this.resourceType.set(""); + } + } + + private class CraftingGridEntryImpl implements CraftingGridEntry { + private final ModConfigSpec.LongValue energyUsage; + private final ModConfigSpec.EnumValue craftingMatrixCloseBehavior; + + CraftingGridEntryImpl() { + builder.translation(translationKey("craftingGrid")).push("craftingGrid"); + energyUsage = builder + .translation(translationKey("craftingGrid." + ENERGY_USAGE)) + .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.CRAFTING_GRID, 0, Long.MAX_VALUE); + craftingMatrixCloseBehavior = builder + .translation(translationKey("craftingGrid.craftingMatrixCloseBehavior")) + .defineEnum("craftingMatrixCloseBehavior", CraftingGridMatrixCloseBehavior.NONE); + builder.pop(); + } + + @Override + public long getEnergyUsage() { + return energyUsage.get(); + } + + @Override + public CraftingGridMatrixCloseBehavior getCraftingMatrixCloseBehavior() { + return craftingMatrixCloseBehavior.get(); + } + } + + private class StorageBlockEntryImpl implements StorageBlockEntry { + private final ModConfigSpec.LongValue oneKEnergyUsage; + private final ModConfigSpec.LongValue fourKEnergyUsage; + private final ModConfigSpec.LongValue sixteenKEnergyUsage; + private final ModConfigSpec.LongValue sixtyFourKEnergyUsage; + private final ModConfigSpec.LongValue creativeEnergyUsage; + + StorageBlockEntryImpl() { + builder.translation(translationKey("storageBlock")).push("storageBlock"); + oneKEnergyUsage = builder + .translation(translationKey("storageBlock.oneKEnergyUsage")) + .defineInRange("1kEnergyUsage", DefaultEnergyUsage.ONE_K_STORAGE_BLOCK, 0, Long.MAX_VALUE); + fourKEnergyUsage = builder + .translation(translationKey("storageBlock.fourKEnergyUsage")) + .defineInRange("4kEnergyUsage", DefaultEnergyUsage.FOUR_K_STORAGE_BLOCK, 0, Long.MAX_VALUE); + sixteenKEnergyUsage = builder + .translation(translationKey("storageBlock.sixteenKEnergyUsage")) + .defineInRange("16kEnergyUsage", DefaultEnergyUsage.SIXTEEN_K_STORAGE_BLOCK, 0, Long.MAX_VALUE); + sixtyFourKEnergyUsage = builder + .translation(translationKey("storageBlock.sixtyFourKEnergyUsage")) + .defineInRange("64kEnergyUsage", DefaultEnergyUsage.SIXTY_FOUR_K_STORAGE_BLOCK, 0, Long.MAX_VALUE); + creativeEnergyUsage = builder + .translation(translationKey("storageBlock.creativeEnergyUsage")) + .defineInRange("creativeEnergyUsage", DefaultEnergyUsage.CREATIVE_STORAGE_BLOCK, 0, Long.MAX_VALUE); + builder.pop(); + } + + @Override + public long get1kEnergyUsage() { + return oneKEnergyUsage.get(); + } + + @Override + public long get4kEnergyUsage() { + return fourKEnergyUsage.get(); + } + + @Override + public long get16kEnergyUsage() { + return sixteenKEnergyUsage.get(); + } + + @Override + public long get64kEnergyUsage() { + return sixtyFourKEnergyUsage.get(); + } + + @Override + public long getCreativeEnergyUsage() { + return creativeEnergyUsage.get(); + } + } + + private class FluidStorageBlockEntryImpl implements FluidStorageBlockEntry { + private final ModConfigSpec.LongValue sixtyFourBEnergyUsage; + private final ModConfigSpec.LongValue twoHundredFiftySixBEnergyUsage; + private final ModConfigSpec.LongValue thousandTwentyFourBEnergyUsage; + private final ModConfigSpec.LongValue fourThousandNinetySixBEnergyUsage; + private final ModConfigSpec.LongValue creativeEnergyUsage; + + FluidStorageBlockEntryImpl() { + builder.translation(translationKey("fluidStorageBlock")).push("fluidStorageBlock"); + sixtyFourBEnergyUsage = builder + .translation(translationKey("fluidStorageBlock.sixtyFourBEnergyUsage")) + .defineInRange( + "64bEnergyUsage", + DefaultEnergyUsage.SIXTY_FOUR_B_FLUID_STORAGE_BLOCK, + 0, + Long.MAX_VALUE + ); + twoHundredFiftySixBEnergyUsage = builder + .translation(translationKey("fluidStorageBlock.twoHundredFiftySixBEnergyUsage")) + .defineInRange( + "256bEnergyUsage", + DefaultEnergyUsage.TWO_HUNDRED_FIFTY_SIX_B_FLUID_STORAGE_BLOCK, + 0, + Long.MAX_VALUE + ); + thousandTwentyFourBEnergyUsage = builder + .translation(translationKey("fluidStorageBlock.thousandTwentyFourBEnergyUsage")) + .defineInRange( + "1024bEnergyUsage", + DefaultEnergyUsage.THOUSAND_TWENTY_FOUR_B_FLUID_STORAGE_BLOCK, + 0, + Long.MAX_VALUE + ); + fourThousandNinetySixBEnergyUsage = builder + .translation(translationKey("fluidStorageBlock.fourThousandNinetySixBEnergyUsage")) + .defineInRange( + "4096bEnergyUsage", + DefaultEnergyUsage.FOUR_THOUSAND_NINETY_SIX_B_FLUID_STORAGE_BLOCK, + 0, + Long.MAX_VALUE + ); + creativeEnergyUsage = builder + .translation(translationKey("fluidStorageBlock.creativeEnergyUsage")) + .defineInRange( + "creativeEnergyUsage", + DefaultEnergyUsage.CREATIVE_FLUID_STORAGE_BLOCK, + 0, + Long.MAX_VALUE + ); + builder.pop(); + } + + @Override + public long get64bEnergyUsage() { + return sixtyFourBEnergyUsage.get(); + } + + @Override + public long get256bEnergyUsage() { + return twoHundredFiftySixBEnergyUsage.get(); + } + + @Override + public long get1024bEnergyUsage() { + return thousandTwentyFourBEnergyUsage.get(); + } + + @Override + public long get4096bEnergyUsage() { + return fourThousandNinetySixBEnergyUsage.get(); + } + + @Override + public long getCreativeEnergyUsage() { + return creativeEnergyUsage.get(); + } + } + + private class UpgradeEntryImpl implements UpgradeEntry { + private final ModConfigSpec.LongValue speedUpgradeEnergyUsage; + private final ModConfigSpec.LongValue stackUpgradeEnergyUsage; + private final ModConfigSpec.LongValue fortune1UpgradeEnergyUsage; + private final ModConfigSpec.LongValue fortune2UpgradeEnergyUsage; + private final ModConfigSpec.LongValue fortune3UpgradeEnergyUsage; + private final ModConfigSpec.LongValue silkTouchUpgradeEnergyUsage; + private final ModConfigSpec.LongValue regulatorUpgradeEnergyUsage; + private final ModConfigSpec.LongValue rangeUpgradeEnergyUsage; + private final ModConfigSpec.LongValue creativeRangeUpgradeEnergyUsage; + private final ModConfigSpec.IntValue rangeUpgradeRange; + + UpgradeEntryImpl() { + builder.translation(translationKey("upgrade")).push("upgrade"); + speedUpgradeEnergyUsage = builder + .translation(translationKey("upgrade.speedUpgradeEnergyUsage")) + .defineInRange("speedUpgradeEnergyUsage", DefaultEnergyUsage.SPEED_UPGRADE, 0, Long.MAX_VALUE); + stackUpgradeEnergyUsage = builder + .translation(translationKey("upgrade.stackUpgradeEnergyUsage")) + .defineInRange("stackUpgradeEnergyUsage", DefaultEnergyUsage.STACK_UPGRADE, 0, Long.MAX_VALUE); + fortune1UpgradeEnergyUsage = builder + .translation(translationKey("upgrade.fortune1UpgradeEnergyUsage")) + .defineInRange("fortune1UpgradeEnergyUsage", DefaultEnergyUsage.FORTUNE_1_UPGRADE, 0, Long.MAX_VALUE); + fortune2UpgradeEnergyUsage = builder + .translation(translationKey("upgrade.fortune2UpgradeEnergyUsage")) + .defineInRange("fortune2UpgradeEnergyUsage", DefaultEnergyUsage.FORTUNE_2_UPGRADE, 0, Long.MAX_VALUE); + fortune3UpgradeEnergyUsage = builder + .translation(translationKey("upgrade.fortune3UpgradeEnergyUsage")) + .defineInRange("fortune3UpgradeEnergyUsage", DefaultEnergyUsage.FORTUNE_3_UPGRADE, 0, Long.MAX_VALUE); + silkTouchUpgradeEnergyUsage = builder + .translation(translationKey("upgrade.silkTouchUpgradeEnergyUsage")) + .defineInRange("silkTouchUpgradeEnergyUsage", DefaultEnergyUsage.SILK_TOUCH_UPGRADE, 0, Long.MAX_VALUE); + regulatorUpgradeEnergyUsage = builder + .translation(translationKey("upgrade.regulatorUpgradeEnergyUsage")) + .defineInRange("regulatorUpgradeEnergyUsage", DefaultEnergyUsage.REGULATOR_UPGRADE, 0, Long.MAX_VALUE); + rangeUpgradeEnergyUsage = builder + .translation(translationKey("upgrade.rangeUpgradeEnergyUsage")) + .defineInRange("rangeUpgradeEnergyUsage", DefaultEnergyUsage.RANGE_UPGRADE, 0, Long.MAX_VALUE); + creativeRangeUpgradeEnergyUsage = builder + .translation(translationKey("upgrade.creativeRangeUpgradeEnergyUsage")) + .defineInRange( + "creativeRangeUpgradeEnergyUsage", + DefaultEnergyUsage.CREATIVE_RANGE_UPGRADE, + 0, + Long.MAX_VALUE + ); + rangeUpgradeRange = builder + .translation(translationKey("upgrade.rangeUpgradeRange")) + .defineInRange("rangeUpgradeRange", DefaultEnergyUsage.RANGE_UPGRADE_RANGE, 0, Integer.MAX_VALUE); + builder.pop(); + } + + @Override + public long getSpeedUpgradeEnergyUsage() { + return speedUpgradeEnergyUsage.get(); + } + + @Override + public long getStackUpgradeEnergyUsage() { + return stackUpgradeEnergyUsage.get(); + } + + @Override + public long getFortune1UpgradeEnergyUsage() { + return fortune1UpgradeEnergyUsage.get(); + } + + @Override + public long getFortune2UpgradeEnergyUsage() { + return fortune2UpgradeEnergyUsage.get(); + } + + @Override + public long getFortune3UpgradeEnergyUsage() { + return fortune3UpgradeEnergyUsage.get(); + } + + @Override + public long getSilkTouchUpgradeEnergyUsage() { + return silkTouchUpgradeEnergyUsage.get(); + } + + @Override + public long getRegulatorUpgradeEnergyUsage() { + return regulatorUpgradeEnergyUsage.get(); + } + + @Override + public long getRangeUpgradeEnergyUsage() { + return rangeUpgradeEnergyUsage.get(); + } + + @Override + public long getCreativeRangeUpgradeEnergyUsage() { + return creativeRangeUpgradeEnergyUsage.get(); + } + + @Override + public int getRangeUpgradeRange() { + return rangeUpgradeRange.get(); + } + } + + private class WirelessGridEntryImpl implements WirelessGridEntry { + private final ModConfigSpec.LongValue energyCapacity; + private final ModConfigSpec.LongValue openEnergyUsage; + private final ModConfigSpec.LongValue extractEnergyUsage; + private final ModConfigSpec.LongValue insertEnergyUsage; + + WirelessGridEntryImpl() { + builder.translation(translationKey("wirelessGrid")).push("wirelessGrid"); + energyCapacity = builder + .translation(translationKey("wirelessGrid." + ENERGY_CAPACITY)) + .defineInRange(ENERGY_CAPACITY, DefaultEnergyUsage.WIRELESS_GRID_CAPACITY, 0, Long.MAX_VALUE); + openEnergyUsage = builder + .translation(translationKey("wirelessGrid.openEnergyUsage")) + .defineInRange("openEnergyUsage", DefaultEnergyUsage.WIRELESS_GRID_OPEN, 0, Long.MAX_VALUE); + extractEnergyUsage = builder + .translation(translationKey("wirelessGrid.extractEnergyUsage")) + .defineInRange("extractEnergyUsage", DefaultEnergyUsage.WIRELESS_GRID_EXTRACT, 0, Long.MAX_VALUE); + insertEnergyUsage = builder + .translation(translationKey("wirelessGrid.insertEnergyUsage")) + .defineInRange("insertEnergyUsage", DefaultEnergyUsage.WIRELESS_GRID_INSERT, 0, Long.MAX_VALUE); + builder.pop(); + } + + public long getEnergyCapacity() { + return energyCapacity.get(); + } + + public long getOpenEnergyUsage() { + return openEnergyUsage.get(); + } + + public long getExtractEnergyUsage() { + return extractEnergyUsage.get(); + } + + public long getInsertEnergyUsage() { + return insertEnergyUsage.get(); + } + } + + private class WirelessTransmitterEntryImpl implements WirelessTransmitterEntry { + private final ModConfigSpec.LongValue energyUsage; + private final ModConfigSpec.IntValue baseRange; + + WirelessTransmitterEntryImpl() { + builder.translation(translationKey("wirelessTransmitter")).push("wirelessTransmitter"); + energyUsage = builder + .translation(translationKey("wirelessTransmitter." + ENERGY_USAGE)) + .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.WIRELESS_TRANSMITTER, 0, Long.MAX_VALUE); + baseRange = builder + .translation(translationKey("wirelessTransmitter.baseRange")) + .defineInRange("baseRange", DefaultEnergyUsage.WIRELESS_TRANSMITTER_BASE_RANGE, 0, Integer.MAX_VALUE); + builder.pop(); + } + + public long getEnergyUsage() { + return energyUsage.get(); + } + + public int getBaseRange() { + return baseRange.get(); + } + } + + private class PortableGridEntryImpl implements PortableGridEntry { + private final ModConfigSpec.LongValue energyCapacity; + private final ModConfigSpec.LongValue openEnergyUsage; + private final ModConfigSpec.LongValue extractEnergyUsage; + private final ModConfigSpec.LongValue insertEnergyUsage; + + PortableGridEntryImpl() { + builder.translation(translationKey("portableGrid")).push("portableGrid"); + energyCapacity = builder + .translation(translationKey("portableGrid." + ENERGY_CAPACITY)) + .defineInRange(ENERGY_CAPACITY, DefaultEnergyUsage.PORTABLE_GRID_CAPACITY, 0, Long.MAX_VALUE); + openEnergyUsage = builder + .translation(translationKey("portableGrid.openEnergyUsage")) + .defineInRange("openEnergyUsage", DefaultEnergyUsage.PORTABLE_GRID_OPEN, 0, Long.MAX_VALUE); + extractEnergyUsage = builder + .translation(translationKey("portableGrid.extractEnergyUsage")) + .defineInRange("extractEnergyUsage", DefaultEnergyUsage.PORTABLE_GRID_EXTRACT, 0, Long.MAX_VALUE); + insertEnergyUsage = builder + .translation(translationKey("portableGrid.insertEnergyUsage")) + .defineInRange("insertEnergyUsage", DefaultEnergyUsage.PORTABLE_GRID_INSERT, 0, Long.MAX_VALUE); + builder.pop(); + } + + public long getEnergyCapacity() { + return energyCapacity.get(); + } + + public long getOpenEnergyUsage() { + return openEnergyUsage.get(); + } + + public long getExtractEnergyUsage() { + return extractEnergyUsage.get(); + } + + public long getInsertEnergyUsage() { + return insertEnergyUsage.get(); + } + } + + private class RelayEntryImpl implements RelayEntry { + private final ModConfigSpec.LongValue inputNetworkEnergyUsage; + private final ModConfigSpec.LongValue outputNetworkEnergyUsage; + + RelayEntryImpl() { + builder.translation(translationKey("relay")).push("relay"); + inputNetworkEnergyUsage = builder + .translation(translationKey("relay.inputNetworkEnergyUsage")) + .defineInRange("inputNetworkEnergyUsage", DefaultEnergyUsage.RELAY_INPUT_NETWORK, 8, Long.MAX_VALUE); + outputNetworkEnergyUsage = builder + .translation(translationKey("relay.outputNetworkEnergyUsage")) + .defineInRange("outputNetworkEnergyUsage", DefaultEnergyUsage.RELAY_OUTPUT_NETWORK, 8, Long.MAX_VALUE); + builder.pop(); + } + + @Override + public long getInputNetworkEnergyUsage() { + return inputNetworkEnergyUsage.get(); + } + + @Override + public long getOutputNetworkEnergyUsage() { + return outputNetworkEnergyUsage.get(); + } + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ModInitializer.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ModInitializer.java new file mode 100644 index 000000000..a338ab84a --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ModInitializer.java @@ -0,0 +1,692 @@ +package com.refinedmods.refinedstorage.neoforge; + +import com.refinedmods.refinedstorage.common.AbstractModInitializer; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.PlatformProxy; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.support.network.AbstractNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.content.BlockEntities; +import com.refinedmods.refinedstorage.common.content.BlockEntityTypeFactory; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.ContentNames; +import com.refinedmods.refinedstorage.common.content.CreativeModeTabItems; +import com.refinedmods.refinedstorage.common.content.DirectRegistryCallback; +import com.refinedmods.refinedstorage.common.content.ExtendedMenuTypeFactory; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.content.MenuTypeFactory; +import com.refinedmods.refinedstorage.common.content.RegistryCallback; +import com.refinedmods.refinedstorage.common.grid.WirelessGridItem; +import com.refinedmods.refinedstorage.common.iface.InterfacePlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.common.security.FallbackSecurityCardItem; +import com.refinedmods.refinedstorage.common.security.SecurityCardItem; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockItem; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridType; +import com.refinedmods.refinedstorage.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage.common.support.packet.PacketHandler; +import com.refinedmods.refinedstorage.common.support.packet.c2s.CraftingGridClearPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.CraftingGridRecipeTransferPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.GridExtractPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.GridInsertPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.GridScrollPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.PropertyChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.ResourceFilterSlotChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.ResourceSlotAmountChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.ResourceSlotChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.SecurityCardBoundPlayerPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.SecurityCardPermissionPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.SecurityCardResetPermissionPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.SingleAmountChangePacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.StorageInfoRequestPacket; +import com.refinedmods.refinedstorage.common.support.packet.c2s.UseSlotReferencedItemPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.EnergyInfoPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.GridActivePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.GridClearPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.GridUpdatePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.NetworkTransmitterStatusPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.NoPermissionPacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.ResourceSlotUpdatePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.StorageInfoResponsePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.WirelessTransmitterRangePacket; +import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeItem; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; +import com.refinedmods.refinedstorage.common.util.ServerEventQueue; +import com.refinedmods.refinedstorage.neoforge.api.RefinedStorageNeoForgeApi; +import com.refinedmods.refinedstorage.neoforge.api.RefinedStorageNeoForgeApiProxy; +import com.refinedmods.refinedstorage.neoforge.exporter.FluidHandlerExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.neoforge.exporter.ItemHandlerExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.neoforge.grid.strategy.FluidGridExtractionStrategy; +import com.refinedmods.refinedstorage.neoforge.grid.strategy.FluidGridInsertionStrategy; +import com.refinedmods.refinedstorage.neoforge.grid.strategy.ItemGridExtractionStrategy; +import com.refinedmods.refinedstorage.neoforge.grid.strategy.ItemGridScrollingStrategy; +import com.refinedmods.refinedstorage.neoforge.importer.FluidHandlerImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.neoforge.importer.ItemHandlerImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.neoforge.storage.diskdrive.ForgeDiskDriveBlockEntity; +import com.refinedmods.refinedstorage.neoforge.storage.diskinterface.ForgeDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.neoforge.storage.externalstorage.FluidHandlerPlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.neoforge.storage.externalstorage.ItemHandlerPlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.neoforge.storage.portablegrid.ForgePortableGridBlockEntity; +import com.refinedmods.refinedstorage.neoforge.support.energy.EnergyStorageAdapter; +import com.refinedmods.refinedstorage.neoforge.support.inventory.InsertExtractItemHandler; +import com.refinedmods.refinedstorage.neoforge.support.resource.ResourceContainerFluidHandlerAdapter; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.function.Supplier; + +import net.minecraft.core.component.DataComponentType; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.flag.FeatureFlags; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; +import net.neoforged.neoforge.client.gui.ConfigurationScreen; +import net.neoforged.neoforge.client.gui.IConfigScreenFactory; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; +import net.neoforged.neoforge.event.level.BlockEvent; +import net.neoforged.neoforge.event.tick.ServerTickEvent; +import net.neoforged.neoforge.items.wrapper.InvWrapper; +import net.neoforged.neoforge.items.wrapper.RangedWrapper; +import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent; +import net.neoforged.neoforge.network.handling.IPayloadHandler; +import net.neoforged.neoforge.network.registration.PayloadRegistrar; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.RegisterEvent; + +import static com.refinedmods.refinedstorage.common.content.ContentIds.CREATIVE_PORTABLE_GRID; +import static com.refinedmods.refinedstorage.common.content.ContentIds.CREATIVE_WIRELESS_GRID; +import static com.refinedmods.refinedstorage.common.content.ContentIds.FALLBACK_SECURITY_CARD; +import static com.refinedmods.refinedstorage.common.content.ContentIds.PORTABLE_GRID; +import static com.refinedmods.refinedstorage.common.content.ContentIds.REGULATOR_UPGRADE; +import static com.refinedmods.refinedstorage.common.content.ContentIds.SECURITY_CARD; +import static com.refinedmods.refinedstorage.common.content.ContentIds.WIRELESS_GRID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.MOD_ID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +@Mod(IdentifierUtil.MOD_ID) +public class ModInitializer extends AbstractModInitializer { + private final DeferredRegister blockRegistry = + DeferredRegister.create(BuiltInRegistries.BLOCK, IdentifierUtil.MOD_ID); + private final DeferredRegister itemRegistry = + DeferredRegister.create(BuiltInRegistries.ITEM, IdentifierUtil.MOD_ID); + private final DeferredRegister> blockEntityTypeRegistry = + DeferredRegister.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, IdentifierUtil.MOD_ID); + private final DeferredRegister> menuTypeRegistry = + DeferredRegister.create(BuiltInRegistries.MENU, IdentifierUtil.MOD_ID); + private final DeferredRegister soundEventRegistry = + DeferredRegister.create(BuiltInRegistries.SOUND_EVENT, IdentifierUtil.MOD_ID); + private final DeferredRegister> recipeSerializerRegistry = + DeferredRegister.create(BuiltInRegistries.RECIPE_SERIALIZER, IdentifierUtil.MOD_ID); + private final DeferredRegister> dataComponentTypeRegistry = + DeferredRegister.create(BuiltInRegistries.DATA_COMPONENT_TYPE, IdentifierUtil.MOD_ID); + + public ModInitializer(final IEventBus eventBus, final ModContainer modContainer) { + PlatformProxy.loadPlatform(new PlatformImpl(modContainer)); + initializePlatformApi(); + ((RefinedStorageNeoForgeApiProxy) RefinedStorageNeoForgeApi.INSTANCE).setDelegate( + new RefinedStorageNeoForgeApiImpl() + ); + registerAdditionalGridInsertionStrategyFactories(); + registerGridExtractionStrategyFactories(); + registerGridScrollingStrategyFactories(); + registerImporterTransferStrategyFactories(); + registerExporterTransferStrategyFactories(); + registerExternalStorageProviderFactories(); + registerContent(eventBus); + registerSounds(eventBus); + registerRecipeSerializers(eventBus); + registerTickHandler(); + + if (FMLEnvironment.dist == Dist.CLIENT) { + eventBus.addListener(ClientModInitializer::onClientSetup); + eventBus.addListener(ClientModInitializer::onRegisterModelGeometry); + eventBus.addListener(ClientModInitializer::onRegisterMenuScreens); + eventBus.addListener(ClientModInitializer::onRegisterKeyMappings); + eventBus.addListener(ClientModInitializer::onRegisterTooltipFactories); + modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new); + } + + eventBus.addListener(this::onCommonSetup); + eventBus.addListener(this::onRegister); + eventBus.addListener(this::registerNetworkPackets); + eventBus.addListener(this::registerCapabilities); + + NeoForge.EVENT_BUS.addListener(this::registerWrenchingEvent); + NeoForge.EVENT_BUS.addListener(this::registerSecurityBlockBreakEvent); + } + + private void registerAdditionalGridInsertionStrategyFactories() { + RefinedStorageApi.INSTANCE.addGridInsertionStrategyFactory(FluidGridInsertionStrategy::new); + } + + private void registerGridExtractionStrategyFactories() { + RefinedStorageApi.INSTANCE.addGridExtractionStrategyFactory(ItemGridExtractionStrategy::new); + RefinedStorageApi.INSTANCE.addGridExtractionStrategyFactory(FluidGridExtractionStrategy::new); + } + + private void registerGridScrollingStrategyFactories() { + RefinedStorageApi.INSTANCE.addGridScrollingStrategyFactory(ItemGridScrollingStrategy::new); + } + + private void registerImporterTransferStrategyFactories() { + RefinedStorageApi.INSTANCE.getImporterTransferStrategyRegistry().register( + createIdentifier("item"), + new ItemHandlerImporterTransferStrategyFactory() + ); + RefinedStorageApi.INSTANCE.getImporterTransferStrategyRegistry().register( + createIdentifier("fluid"), + new FluidHandlerImporterTransferStrategyFactory() + ); + } + + private void registerExporterTransferStrategyFactories() { + RefinedStorageApi.INSTANCE.getExporterTransferStrategyRegistry().register( + createIdentifier("item"), + new ItemHandlerExporterTransferStrategyFactory() + ); + RefinedStorageApi.INSTANCE.getExporterTransferStrategyRegistry().register( + createIdentifier("fluid"), + new FluidHandlerExporterTransferStrategyFactory() + ); + } + + private void registerExternalStorageProviderFactories() { + RefinedStorageApi.INSTANCE.addExternalStorageProviderFactory( + new InterfacePlatformExternalStorageProviderFactory()); + RefinedStorageApi.INSTANCE.addExternalStorageProviderFactory( + new ItemHandlerPlatformExternalStorageProviderFactory()); + RefinedStorageApi.INSTANCE.addExternalStorageProviderFactory( + new FluidHandlerPlatformExternalStorageProviderFactory() + ); + } + + private void registerContent(final IEventBus eventBus) { + registerBlocks(eventBus); + registerItems(eventBus); + registerBlockEntities(eventBus); + registerMenus(eventBus); + registerDataComponents(eventBus); + } + + private void registerBlocks(final IEventBus eventBus) { + registerBlocks( + new ForgeRegistryCallback<>(blockRegistry), + ForgeDiskDriveBlockEntity::new, + (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.NORMAL, pos, state), + (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.CREATIVE, pos, state), + ForgeDiskInterfaceBlockEntity::new + ); + blockRegistry.register(eventBus); + } + + private void registerItems(final IEventBus eventBus) { + final RegistryCallback callback = new ForgeRegistryCallback<>(itemRegistry); + registerItems(callback); + registerCustomItems(callback); + itemRegistry.register(eventBus); + } + + private void registerCustomItems(final RegistryCallback callback) { + Items.INSTANCE.setRegulatorUpgrade(callback.register(REGULATOR_UPGRADE, () -> new RegulatorUpgradeItem( + RefinedStorageApi.INSTANCE.getUpgradeRegistry() + ) { + @Override + public boolean shouldCauseReequipAnimation(final ItemStack oldStack, + final ItemStack newStack, + final boolean slotChanged) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + })); + Items.INSTANCE.setWirelessGrid(callback.register(WIRELESS_GRID, () -> new WirelessGridItem() { + @Override + public boolean shouldCauseReequipAnimation(final ItemStack oldStack, + final ItemStack newStack, + final boolean slotChanged) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + })); + Items.INSTANCE.setCreativeWirelessGrid(callback.register( + CREATIVE_WIRELESS_GRID, + () -> new WirelessGridItem() { + @Override + public boolean shouldCauseReequipAnimation(final ItemStack oldStack, + final ItemStack newStack, + final boolean slotChanged) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + } + )); + Items.INSTANCE.setPortableGrid(callback.register(PORTABLE_GRID, () -> new PortableGridBlockItem( + Blocks.INSTANCE.getPortableGrid(), PortableGridType.NORMAL + ) { + @Override + public boolean shouldCauseReequipAnimation(final ItemStack oldStack, + final ItemStack newStack, + final boolean slotChanged) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + })); + Items.INSTANCE.setCreativePortableGrid(callback.register( + CREATIVE_PORTABLE_GRID, + () -> new PortableGridBlockItem(Blocks.INSTANCE.getCreativePortableGrid(), PortableGridType.CREATIVE) { + @Override + public boolean shouldCauseReequipAnimation(final ItemStack oldStack, + final ItemStack newStack, + final boolean slotChanged) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + } + )); + Items.INSTANCE.setSecurityCard(callback.register(SECURITY_CARD, () -> new SecurityCardItem() { + @Override + public boolean shouldCauseReequipAnimation(final ItemStack oldStack, + final ItemStack newStack, + final boolean slotChanged) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + })); + Items.INSTANCE.setFallbackSecurityCard(callback.register( + FALLBACK_SECURITY_CARD, + () -> new FallbackSecurityCardItem() { + @Override + public boolean shouldCauseReequipAnimation(final ItemStack oldStack, + final ItemStack newStack, + final boolean slotChanged) { + return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); + } + } + )); + } + + private void registerBlockEntities(final IEventBus eventBus) { + registerBlockEntities( + new ForgeRegistryCallback<>(blockEntityTypeRegistry), + new BlockEntityTypeFactory() { + @SuppressWarnings("DataFlowIssue") // data type can be null + @Override + public BlockEntityType create(final BlockEntitySupplier factory, + final Block... allowedBlocks) { + return new BlockEntityType<>(factory::create, new HashSet<>(Arrays.asList(allowedBlocks)), null); + } + }, + ForgeDiskDriveBlockEntity::new, + (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.NORMAL, pos, state), + (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.CREATIVE, pos, state), + ForgeDiskInterfaceBlockEntity::new + ); + blockEntityTypeRegistry.register(eventBus); + } + + private void registerMenus(final IEventBus eventBus) { + registerMenus(new ForgeRegistryCallback<>(menuTypeRegistry), new MenuTypeFactory() { + @Override + public MenuType create(final MenuSupplier supplier) { + return new MenuType<>(supplier::create, FeatureFlags.DEFAULT_FLAGS); + } + }, new ExtendedMenuTypeFactory() { + @Override + public MenuType create(final MenuSupplier supplier, + final StreamCodec + streamCodec) { + return IMenuTypeExtension.create((syncId, inventory, buf) -> { + final D data = streamCodec.decode(buf); + return supplier.create(syncId, inventory, data); + }); + } + }); + menuTypeRegistry.register(eventBus); + } + + private void registerDataComponents(final IEventBus eventBus) { + final RegistryCallback> callback = new ForgeRegistryCallback<>(dataComponentTypeRegistry); + registerDataComponents(callback); + dataComponentTypeRegistry.register(eventBus); + } + + private void registerCapabilities(final RegisterCapabilitiesEvent event) { + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getCable()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getConstructor()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getController()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getCraftingGrid()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getCreativeController()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getDestructor()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getDetector()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getDiskDrive()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getDiskInterface()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getExporter()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getExternalStorage()); + Arrays.stream(FluidStorageVariant.values()).forEach(type -> + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getFluidStorageBlock(type))); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getGrid()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getImporter()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getInterface()); + Arrays.stream(ItemStorageVariant.values()).forEach(type -> + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getItemStorageBlock(type))); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getNetworkReceiver()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getNetworkTransmitter()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getRelay()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getSecurityManager()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getStorageMonitor()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getWirelessTransmitter()); + event.registerBlockEntity( + Capabilities.ItemHandler.BLOCK, + BlockEntities.INSTANCE.getDiskDrive(), + (be, side) -> new InvWrapper(be.getDiskInventory()) + ); + event.registerBlockEntity( + Capabilities.ItemHandler.BLOCK, + BlockEntities.INSTANCE.getInterface(), + (be, side) -> new InvWrapper(be.getExportedResourcesAsContainer()) + ); + event.registerBlockEntity( + Capabilities.FluidHandler.BLOCK, + BlockEntities.INSTANCE.getInterface(), + (be, side) -> new ResourceContainerFluidHandlerAdapter(be.getExportedResources()) + ); + event.registerBlockEntity( + Capabilities.EnergyStorage.BLOCK, + BlockEntities.INSTANCE.getController(), + (be, side) -> new EnergyStorageAdapter(be.getEnergyStorage()) + ); + event.registerBlockEntity( + Capabilities.EnergyStorage.BLOCK, + BlockEntities.INSTANCE.getPortableGrid(), + (be, side) -> new EnergyStorageAdapter(be.getEnergyStorage()) + ); + event.registerItem( + Capabilities.EnergyStorage.ITEM, + (stack, ctx) -> new EnergyStorageAdapter(Items.INSTANCE.getWirelessGrid().createEnergyStorage(stack)), + Items.INSTANCE.getWirelessGrid() + ); + Items.INSTANCE.getControllers().forEach(controllerItem -> event.registerItem( + Capabilities.EnergyStorage.ITEM, + (stack, ctx) -> new EnergyStorageAdapter(controllerItem.get().createEnergyStorage(stack)), + controllerItem.get() + )); + event.registerItem( + Capabilities.EnergyStorage.ITEM, + (stack, ctx) -> new EnergyStorageAdapter(PortableGridBlockItem.createEnergyStorage(stack)), + Items.INSTANCE.getPortableGrid() + ); + event.registerBlockEntity( + Capabilities.ItemHandler.BLOCK, + BlockEntities.INSTANCE.getDiskInterface(), + (be, side) -> { + final InvWrapper wrapper = new InvWrapper(be.getDiskInventory()); + return new InsertExtractItemHandler( + new RangedWrapper( + wrapper, + 0, + AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS / 2 + ), + new RangedWrapper( + wrapper, + AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS / 2, + AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS + ) + ); + } + ); + } + + private void registerNetworkNodeContainerProvider( + final RegisterCapabilitiesEvent event, + final BlockEntityType> type + ) { + event.registerBlockEntity( + RefinedStorageNeoForgeApi.INSTANCE.getNetworkNodeContainerProviderCapability(), + type, + (be, side) -> be.getContainerProvider() + ); + } + + private void registerSounds(final IEventBus eventBus) { + registerSounds(new ForgeRegistryCallback<>(soundEventRegistry)); + soundEventRegistry.register(eventBus); + } + + private void registerRecipeSerializers(final IEventBus eventBus) { + registerRecipeSerializers(new ForgeRegistryCallback<>(recipeSerializerRegistry)); + recipeSerializerRegistry.register(eventBus); + } + + private void registerTickHandler() { + NeoForge.EVENT_BUS.addListener(this::onServerTick); + } + + @SubscribeEvent + public void onCommonSetup(final FMLCommonSetupEvent e) { + registerUpgradeMappings(); + } + + @SubscribeEvent + public void onRegister(final RegisterEvent e) { + e.register( + Registries.LOOT_FUNCTION_TYPE, + helper -> registerLootFunctions(new DirectRegistryCallback<>(BuiltInRegistries.LOOT_FUNCTION_TYPE)) + ); + e.register(Registries.CREATIVE_MODE_TAB, helper -> helper.register( + createIdentifier("general"), + CreativeModeTab.builder() + .title(ContentNames.MOD) + .icon(() -> new ItemStack(Blocks.INSTANCE.getCreativeController().getDefault())) + .displayItems((params, output) -> CreativeModeTabItems.append(output::accept)) + .build() + )); + } + + @SubscribeEvent + public void registerWrenchingEvent(final PlayerInteractEvent.RightClickBlock e) { + final Level level = e.getLevel(); + final BlockState state = level.getBlockState(e.getHitVec().getBlockPos()); + if (!(state.getBlock() instanceof AbstractBaseBlock block)) { + return; + } + block.tryUseWrench(state, level, e.getHitVec(), e.getEntity(), e.getHand()).or(() -> block.tryUpdateColor( + state, + level, + e.getHitVec().getBlockPos(), + e.getEntity(), + e.getHand() + )).ifPresent(result -> { + e.setCanceled(true); + e.setCancellationResult(result); + }); + } + + @SubscribeEvent + public void registerSecurityBlockBreakEvent(final BlockEvent.BreakEvent e) { + if (!(e.getLevel() instanceof Level level)) { + return; + } + final NetworkNodeContainerProvider provider = Platform.INSTANCE.getContainerProvider(level, e.getPos(), null); + final Player player = e.getPlayer(); + if (provider != null && player instanceof ServerPlayer serverPlayer && !provider.canBuild(serverPlayer)) { + RefinedStorageApi.INSTANCE.sendNoPermissionMessage( + serverPlayer, + createTranslation("misc", "no_permission.build.break", e.getState().getBlock().getName()) + ); + e.setCanceled(true); + } + } + + @SubscribeEvent + public void registerNetworkPackets(final RegisterPayloadHandlersEvent event) { + final PayloadRegistrar registrar = event.registrar(MOD_ID); + registerServerToClientPackets(registrar); + registerClientToServerPackets(registrar); + } + + private static void registerServerToClientPackets(final PayloadRegistrar registrar) { + registrar.playToClient( + EnergyInfoPacket.PACKET_TYPE, + EnergyInfoPacket.STREAM_CODEC, + wrapHandler(EnergyInfoPacket::handle) + ); + registrar.playToClient( + GridActivePacket.PACKET_TYPE, + GridActivePacket.STREAM_CODEC, + wrapHandler(GridActivePacket::handle) + ); + registrar.playToClient( + GridClearPacket.PACKET_TYPE, + GridClearPacket.STREAM_CODEC, + wrapHandler((packet, ctx) -> GridClearPacket.handle(ctx)) + ); + registrar.playToClient( + GridUpdatePacket.PACKET_TYPE, + GridUpdatePacket.STREAM_CODEC, + wrapHandler(GridUpdatePacket::handle) + ); + registrar.playToClient( + NetworkTransmitterStatusPacket.PACKET_TYPE, + NetworkTransmitterStatusPacket.STREAM_CODEC, + wrapHandler(NetworkTransmitterStatusPacket::handle) + ); + registrar.playToClient( + ResourceSlotUpdatePacket.PACKET_TYPE, + ResourceSlotUpdatePacket.STREAM_CODEC, + wrapHandler(ResourceSlotUpdatePacket::handle) + ); + registrar.playToClient( + StorageInfoResponsePacket.PACKET_TYPE, + StorageInfoResponsePacket.STREAM_CODEC, + wrapHandler((packet, ctx) -> StorageInfoResponsePacket.handle(packet)) + ); + registrar.playToClient( + WirelessTransmitterRangePacket.PACKET_TYPE, + WirelessTransmitterRangePacket.STREAM_CODEC, + wrapHandler(WirelessTransmitterRangePacket::handle) + ); + registrar.playToClient( + NoPermissionPacket.PACKET_TYPE, + NoPermissionPacket.STREAM_CODEC, + wrapHandler((packet, ctx) -> NoPermissionPacket.handle(packet)) + ); + } + + private static void registerClientToServerPackets(final PayloadRegistrar registrar) { + registrar.playToServer( + CraftingGridClearPacket.PACKET_TYPE, + CraftingGridClearPacket.STREAM_CODEC, + wrapHandler(CraftingGridClearPacket::handle) + ); + registrar.playToServer( + CraftingGridRecipeTransferPacket.PACKET_TYPE, + CraftingGridRecipeTransferPacket.STREAM_CODEC, + wrapHandler(CraftingGridRecipeTransferPacket::handle) + ); + registrar.playToServer( + GridExtractPacket.PACKET_TYPE, + GridExtractPacket.STREAM_CODEC, + wrapHandler(GridExtractPacket::handle) + ); + registrar.playToServer( + GridInsertPacket.PACKET_TYPE, + GridInsertPacket.STREAM_CODEC, + wrapHandler(GridInsertPacket::handle) + ); + registrar.playToServer( + GridScrollPacket.PACKET_TYPE, + GridScrollPacket.STREAM_CODEC, + wrapHandler(GridScrollPacket::handle) + ); + registrar.playToServer( + PropertyChangePacket.PACKET_TYPE, + PropertyChangePacket.STREAM_CODEC, + wrapHandler(PropertyChangePacket::handle) + ); + registrar.playToServer( + ResourceFilterSlotChangePacket.PACKET_TYPE, + ResourceFilterSlotChangePacket.STREAM_CODEC, + wrapHandler(ResourceFilterSlotChangePacket::handle) + ); + registrar.playToServer( + ResourceSlotAmountChangePacket.PACKET_TYPE, + ResourceSlotAmountChangePacket.STREAM_CODEC, + wrapHandler(ResourceSlotAmountChangePacket::handle) + ); + registrar.playToServer( + ResourceSlotChangePacket.PACKET_TYPE, + ResourceSlotChangePacket.STREAM_CODEC, + wrapHandler(ResourceSlotChangePacket::handle) + ); + registrar.playToServer( + SingleAmountChangePacket.PACKET_TYPE, + SingleAmountChangePacket.STREAM_CODEC, + wrapHandler(SingleAmountChangePacket::handle) + ); + registrar.playToServer( + StorageInfoRequestPacket.PACKET_TYPE, + StorageInfoRequestPacket.STREAM_CODEC, + wrapHandler(StorageInfoRequestPacket::handle) + ); + registrar.playToServer( + UseSlotReferencedItemPacket.PACKET_TYPE, + UseSlotReferencedItemPacket.STREAM_CODEC, + wrapHandler(UseSlotReferencedItemPacket::handle) + ); + registrar.playToServer( + SecurityCardPermissionPacket.PACKET_TYPE, + SecurityCardPermissionPacket.STREAM_CODEC, + wrapHandler(SecurityCardPermissionPacket::handle) + ); + registrar.playToServer( + SecurityCardResetPermissionPacket.PACKET_TYPE, + SecurityCardResetPermissionPacket.STREAM_CODEC, + wrapHandler(SecurityCardResetPermissionPacket::handle) + ); + registrar.playToServer( + SecurityCardBoundPlayerPacket.PACKET_TYPE, + SecurityCardBoundPlayerPacket.STREAM_CODEC, + wrapHandler(SecurityCardBoundPlayerPacket::handle) + ); + } + + private static IPayloadHandler wrapHandler(final PacketHandler handler) { + return (packet, ctx) -> handler.handle(packet, ctx::player); + } + + @SubscribeEvent + public void onServerTick(final ServerTickEvent.Pre e) { + ServerEventQueue.runQueuedActions(); + } + + private record ForgeRegistryCallback(DeferredRegister registry) implements RegistryCallback { + @Override + public Supplier register(final ResourceLocation id, final Supplier value) { + return registry.register(id.getPath(), value); + } + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/PlatformImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/PlatformImpl.java new file mode 100644 index 000000000..acf8618a4 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/PlatformImpl.java @@ -0,0 +1,401 @@ +package com.refinedmods.refinedstorage.neoforge; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.AbstractPlatform; +import com.refinedmods.refinedstorage.common.Config; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; +import com.refinedmods.refinedstorage.common.support.containermenu.TransferManager; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.util.CustomBlockPlaceContext; +import com.refinedmods.refinedstorage.neoforge.api.RefinedStorageNeoForgeApi; +import com.refinedmods.refinedstorage.neoforge.grid.strategy.ItemGridInsertionStrategy; +import com.refinedmods.refinedstorage.neoforge.grid.view.ForgeFluidGridResourceFactory; +import com.refinedmods.refinedstorage.neoforge.grid.view.ForgeItemGridResourceFactory; +import com.refinedmods.refinedstorage.neoforge.support.containermenu.ContainerTransferDestination; +import com.refinedmods.refinedstorage.neoforge.support.containermenu.MenuOpenerImpl; +import com.refinedmods.refinedstorage.neoforge.support.energy.EnergyStorageAdapter; +import com.refinedmods.refinedstorage.neoforge.support.render.FluidStackFluidRenderer; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.function.BiConsumer; +import javax.annotation.Nullable; + +import com.mojang.blaze3d.platform.InputConstants; +import net.minecraft.client.KeyMapping; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.components.EditBox; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.client.gui.screens.inventory.tooltip.DefaultTooltipPositioner; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.NonNullList; +import net.minecraft.network.chat.Component; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.Container; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.CraftingContainer; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.item.crafting.CraftingInput; +import net.minecraft.world.item.crafting.CraftingRecipe; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.LiquidBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.chunk.LevelChunk; +import net.minecraft.world.level.saveddata.SavedData; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.Vec3; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.config.ModConfig; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.client.ClientHooks; +import net.neoforged.neoforge.common.CommonHooks; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.common.util.FakePlayerFactory; +import net.neoforged.neoforge.event.EventHooks; +import net.neoforged.neoforge.event.level.BlockEvent; +import net.neoforged.neoforge.fluids.FluidActionResult; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.FluidUtil; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.templates.FluidTank; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.wrapper.InvWrapper; +import net.neoforged.neoforge.network.PacketDistributor; + +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.ofFluidStack; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidStack; + +public final class PlatformImpl extends AbstractPlatform { + private final ConfigImpl config = new ConfigImpl(); + + public PlatformImpl(final ModContainer modContainer) { + super(new MenuOpenerImpl(), new FluidStackFluidRenderer(), ItemGridInsertionStrategy::new); + modContainer.registerConfig(ModConfig.Type.COMMON, config.getSpec()); + } + + @Override + public long getBucketAmount() { + return FluidType.BUCKET_VOLUME; + } + + @Override + public Config getConfig() { + return config; + } + + @Override + public boolean canEditBoxLoseFocus(final EditBox editBox) { + return editBox.canLoseFocus; + } + + @Override + public boolean isKeyDown(final KeyMapping keyMapping) { + return !keyMapping.isUnbound() && InputConstants.isKeyDown( + Minecraft.getInstance().getWindow().getWindow(), + keyMapping.getKey().getValue() + ); + } + + @Override + public GridResourceFactory getItemGridResourceFactory() { + return new ForgeItemGridResourceFactory(); + } + + @Override + public GridResourceFactory getFluidGridResourceFactory() { + return new ForgeFluidGridResourceFactory(); + } + + @Override + public Optional drainContainer(final ItemStack container) { + final FluidTank tank = new FluidTank(Integer.MAX_VALUE); + final FluidActionResult result = FluidUtil.tryEmptyContainer( + container, + tank, + Integer.MAX_VALUE, + null, + true + ); + if (!result.isSuccess() || tank.isEmpty()) { + return Optional.empty(); + } + final FluidResource fluidResource = ofFluidStack(tank.getFluid()); + return Optional.of(new FluidOperationResult( + result.getResult(), + fluidResource, + tank.getFluidAmount() + )); + } + + @Override + public Optional fillContainer(final ItemStack container, + final ResourceAmount resourceAmount) { + if (!(resourceAmount.getResource() instanceof FluidResource fluidResource)) { + return Optional.empty(); + } + return FluidUtil.getFluidHandler(container).map(handler -> { + final FluidStack fluidStack = toFluidStack(fluidResource, resourceAmount.getAmount()); + final long filled = handler.fill(fluidStack, IFluidHandler.FluidAction.EXECUTE); + return new FluidOperationResult(handler.getContainer(), fluidResource, filled); + }); + } + + @Override + public Optional getFilledBucket(final FluidResource fluidResource) { + return Optional.ofNullable( + new ItemStack(Items.BUCKET).getCapability(Capabilities.FluidHandler.ITEM) + ).map(dest -> { + dest.fill( + toFluidStack(fluidResource, FluidType.BUCKET_VOLUME), + IFluidHandler.FluidAction.EXECUTE + ); + return dest.getContainer(); + }); + } + + @Override + public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) { + return new TransferManager(containerMenu, ContainerTransferDestination::new); + } + + @Override + public long insertIntoContainer(final Container container, + final ItemResource itemResource, + final long amount, + final Action action) { + final InvWrapper wrapper = new InvWrapper(container); + final ItemStack stack = itemResource.toItemStack(amount); + final ItemStack remainder = ItemHandlerHelper.insertItem(wrapper, stack, action == Action.SIMULATE); + return amount - remainder.getCount(); + } + + @Override + public ItemStack getCloneItemStack(final BlockState state, + final Level level, + final BlockHitResult hitResult, + final Player player) { + return state.getCloneItemStack(hitResult, level, hitResult.getBlockPos(), player); + } + + @Override + @SuppressWarnings("DataFlowIssue") // NeoForge allows null + public NonNullList getRemainingCraftingItems(final Player player, + final CraftingRecipe craftingRecipe, + final CraftingInput input) { + CommonHooks.setCraftingPlayer(player); + final NonNullList remainingItems = craftingRecipe.getRemainingItems(input); + CommonHooks.setCraftingPlayer(null); + return remainingItems; + } + + @Override + public void onItemCrafted(final Player player, final ItemStack craftedStack, final CraftingContainer container) { + EventHooks.firePlayerCraftingEvent(player, craftedStack, container); + } + + @Override + public Player getFakePlayer(final ServerLevel level, @Nullable final UUID playerId) { + return Optional.ofNullable(playerId) + .flatMap(id -> level.getServer().getProfileCache().get(id)) + .map(profile -> FakePlayerFactory.get(level, profile)) + .orElseGet(() -> FakePlayerFactory.getMinecraft(level)); + } + + @Override + public boolean canBreakBlock(final Level level, final BlockPos pos, final BlockState state, final Player player) { + final BlockEvent.BreakEvent e = new BlockEvent.BreakEvent(level, pos, state, player); + return !NeoForge.EVENT_BUS.post(e).isCanceled(); + } + + @Override + public boolean placeBlock( + final Level level, + final BlockPos pos, + final Direction direction, + final Player player, + final ItemStack stack + ) { + final BlockPlaceContext ctx = new CustomBlockPlaceContext( + level, + player, + InteractionHand.MAIN_HAND, + stack, + new BlockHitResult(Vec3.ZERO, direction, pos, false) + ); + final InteractionResult result = CommonHooks.onPlaceItemIntoWorld(ctx); + return result.consumesAction(); + } + + @Override + public boolean placeFluid( + final Level level, + final BlockPos pos, + final Direction direction, + final Player player, + final FluidResource fluidResource + ) { + if (level.getBlockState(pos).getFluidState().isSource()) { + return false; + } + final FluidStack stack = toFluidStack(fluidResource, FluidType.BUCKET_VOLUME); + final FluidTank tank = new FluidTank(FluidType.BUCKET_VOLUME); + tank.fill(stack, IFluidHandler.FluidAction.EXECUTE); + return FluidUtil.tryPlaceFluid( + player, + level, + InteractionHand.MAIN_HAND, + pos, + tank, + toFluidStack(fluidResource, FluidType.BUCKET_VOLUME) + ); + } + + @Override + public ItemStack getBlockAsItemStack(final Block block, + final BlockState state, + final Direction direction, + final LevelReader level, + final BlockPos position, + final Player player) { + return block.getCloneItemStack( + state, + new BlockHitResult(Vec3.ZERO, direction, position, false), + level, + position, + player + ); + } + + @Override + public Optional getBucketPickupSound(final LiquidBlock liquidBlock, final BlockState state) { + return liquidBlock.getPickupSound(state); + } + + @Override + public List processTooltipComponents( + final ItemStack stack, + final GuiGraphics graphics, + final int mouseX, + final Optional imageComponent, + final List components + ) { + return new ArrayList<>(ClientHooks.gatherTooltipComponents( + stack, + components, + imageComponent, + mouseX, + graphics.guiWidth(), + graphics.guiHeight(), + Minecraft.getInstance().font + )); // make modifiable + } + + @Override + public void renderTooltip(final GuiGraphics graphics, + final List components, + final int x, + final int y) { + graphics.renderTooltipInternal( + Minecraft.getInstance().font, + components, + x, + y, + DefaultTooltipPositioner.INSTANCE + ); + } + + @Override + public Optional getEnergyStorage(final ItemStack stack) { + return Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM)) + .filter(EnergyStorageAdapter.class::isInstance) + .map(EnergyStorageAdapter.class::cast) + .map(EnergyStorageAdapter::energyStorage); + } + + @Override + public void sendPacketToServer(final T packet) { + PacketDistributor.sendToServer(packet); + } + + @Override + public void sendPacketToClient(final ServerPlayer player, final T packet) { + PacketDistributor.sendToPlayer(player, packet); + } + + @Override + public void saveSavedData(final SavedData savedData, + final File file, + final HolderLookup.Provider provider, + final BiConsumer defaultSaveFunction) { + defaultSaveFunction.accept(file, provider); + } + + @Override + public NetworkNodeContainerProvider getContainerProvider(final Level level, + final BlockPos pos, + @Nullable final Direction direction) { + return level.getCapability( + RefinedStorageNeoForgeApi.INSTANCE.getNetworkNodeContainerProviderCapability(), + pos, + direction + ); + } + + @Nullable + @Override + public NetworkNodeContainerProvider getContainerProviderSafely(final Level level, + final BlockPos pos, + @Nullable final Direction direction) { + if (!level.isLoaded(pos)) { + return null; + } + // Avoid using EntityCreationType.IMMEDIATE. + // By default, the block is removed first and then the block entity (see BaseBlock#onRemove). + // But, when using mods like "Carrier", "Carpet" or "Carry On" that allow for moving block entities, + // they remove the block entity first and then the block. + // When removing a block with Carrier for example, + // this causes a problematic situation that the block entity IS gone, + // but that the #getBlockEntity() call here with type IMMEDIATE would recreate the block entity because + // the block is still there. + // If the block entity is returned here again even if it is removed, the preconditions in NetworkBuilder will + // fail as the "removed" block entity/connection would still be present. + final BlockEntity safeBlockEntity = level.getChunkAt(pos).getBlockEntity( + pos, + LevelChunk.EntityCreationType.CHECK + ); + if (safeBlockEntity == null) { + return null; + } + return level.getCapability( + RefinedStorageNeoForgeApi.INSTANCE.getNetworkNodeContainerProviderCapability(), + pos, + null, + safeBlockEntity, + direction + ); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/RefinedStorageNeoForgeApiImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/RefinedStorageNeoForgeApiImpl.java new file mode 100644 index 000000000..16e430b23 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/RefinedStorageNeoForgeApiImpl.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.neoforge; + +import com.refinedmods.refinedstorage.api.core.NullableType; +import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; +import com.refinedmods.refinedstorage.neoforge.api.RefinedStorageNeoForgeApi; + +import net.minecraft.core.Direction; +import net.neoforged.neoforge.capabilities.BlockCapability; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public class RefinedStorageNeoForgeApiImpl implements RefinedStorageNeoForgeApi { + private final BlockCapability + networkNodeContainerProviderCapability = BlockCapability.create( + createIdentifier("network_node_container_provider"), + NetworkNodeContainerProvider.class, + Direction.class + ); + + @Override + public BlockCapability getNetworkNodeContainerProviderCapability() { + return networkNodeContainerProviderCapability; + } +} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/BlockModelProviderImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockModelProviderImpl.java similarity index 97% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/BlockModelProviderImpl.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockModelProviderImpl.java index 6c76ba7b6..b605ffb32 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/BlockModelProviderImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockModelProviderImpl.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.neoforge.datagen; +package com.refinedmods.refinedstorage.neoforge.datagen; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.Blocks; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; @@ -9,8 +9,8 @@ import net.neoforged.neoforge.client.model.generators.CustomLoaderBuilder; import net.neoforged.neoforge.common.data.ExistingFileHelper; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.MOD_ID; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.MOD_ID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class BlockModelProviderImpl extends BlockModelProvider { private static final String PARTICLE_TEXTURE = "particle"; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/BlockStateProviderImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockStateProviderImpl.java similarity index 92% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/BlockStateProviderImpl.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockStateProviderImpl.java index 00fd6b027..43071d965 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/BlockStateProviderImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockStateProviderImpl.java @@ -1,19 +1,19 @@ -package com.refinedmods.refinedstorage.platform.neoforge.datagen; - -import com.refinedmods.refinedstorage.platform.common.constructordestructor.AbstractConstructorDestructorBlock; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.controller.AbstractControllerBlock; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerEnergyType; -import com.refinedmods.refinedstorage.platform.common.detector.DetectorBlock; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkReceiverBlock; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterBlock; -import com.refinedmods.refinedstorage.platform.common.support.AbstractActiveColoredDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.CableBlockSupport; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DefaultDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.HorizontalDirectionType; +package com.refinedmods.refinedstorage.neoforge.datagen; + +import com.refinedmods.refinedstorage.common.constructordestructor.AbstractConstructorDestructorBlock; +import com.refinedmods.refinedstorage.common.content.BlockColorMap; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.controller.AbstractControllerBlock; +import com.refinedmods.refinedstorage.common.controller.ControllerEnergyType; +import com.refinedmods.refinedstorage.common.detector.DetectorBlock; +import com.refinedmods.refinedstorage.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterBlock; +import com.refinedmods.refinedstorage.common.support.AbstractActiveColoredDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.CableBlockSupport; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.direction.BiDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.DefaultDirectionType; +import com.refinedmods.refinedstorage.common.support.direction.HorizontalDirectionType; import java.util.EnumMap; import java.util.Map; @@ -32,8 +32,8 @@ import net.neoforged.neoforge.client.model.generators.MultiPartBlockStateBuilder; import net.neoforged.neoforge.common.data.ExistingFileHelper; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.MOD_ID; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.MOD_ID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class BlockStateProviderImpl extends BlockStateProvider { private static final String BLOCK_PREFIX = "block"; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/DataGenerators.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/DataGenerators.java similarity index 87% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/DataGenerators.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/DataGenerators.java index cfdac8749..6d8a7990b 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/DataGenerators.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/DataGenerators.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.neoforge.datagen; +package com.refinedmods.refinedstorage.neoforge.datagen; -import com.refinedmods.refinedstorage.platform.neoforge.datagen.loot.LootTableProviderImpl; -import com.refinedmods.refinedstorage.platform.neoforge.datagen.recipe.RecoloringRecipeProvider; -import com.refinedmods.refinedstorage.platform.neoforge.datagen.tag.BlockTagsProvider; -import com.refinedmods.refinedstorage.platform.neoforge.datagen.tag.ItemTagsProviderImpl; +import com.refinedmods.refinedstorage.neoforge.datagen.loot.LootTableProviderImpl; +import com.refinedmods.refinedstorage.neoforge.datagen.recipe.RecoloringRecipeProvider; +import com.refinedmods.refinedstorage.neoforge.datagen.tag.BlockTagsProvider; +import com.refinedmods.refinedstorage.neoforge.datagen.tag.ItemTagsProviderImpl; import java.util.concurrent.CompletableFuture; @@ -15,7 +15,7 @@ import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.data.event.GatherDataEvent; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.MOD_ID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.MOD_ID; @EventBusSubscriber(modid = MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class DataGenerators { diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/ItemModelProviderImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java similarity index 87% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/ItemModelProviderImpl.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java index e38a0e068..19f52a8ad 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/ItemModelProviderImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage.platform.neoforge.datagen; - -import com.refinedmods.refinedstorage.platform.common.constructordestructor.ConstructorBlock; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.DestructorBlock; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.ColorMap; -import com.refinedmods.refinedstorage.platform.common.exporter.ExporterBlock; -import com.refinedmods.refinedstorage.platform.common.importer.ImporterBlock; -import com.refinedmods.refinedstorage.platform.common.networking.CableBlock; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkReceiverBlock; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterBlock; -import com.refinedmods.refinedstorage.platform.common.storage.externalstorage.ExternalStorageBlock; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.WirelessTransmitterBlock; +package com.refinedmods.refinedstorage.neoforge.datagen; + +import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorBlock; +import com.refinedmods.refinedstorage.common.constructordestructor.DestructorBlock; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.ColorMap; +import com.refinedmods.refinedstorage.common.exporter.ExporterBlock; +import com.refinedmods.refinedstorage.common.importer.ImporterBlock; +import com.refinedmods.refinedstorage.common.networking.CableBlock; +import com.refinedmods.refinedstorage.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterBlock; +import com.refinedmods.refinedstorage.common.storage.externalstorage.ExternalStorageBlock; +import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterBlock; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; @@ -20,8 +20,8 @@ import net.neoforged.neoforge.client.model.generators.ModelFile; import net.neoforged.neoforge.common.data.ExistingFileHelper; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.MOD_ID; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.MOD_ID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class ItemModelProviderImpl extends ItemModelProvider { private static final String CUTOUT_TEXTURE_KEY = "cutout"; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/loot/BlockDropProvider.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java similarity index 92% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/loot/BlockDropProvider.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java index 64ccb7fb2..0a547cf1a 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/loot/BlockDropProvider.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.neoforge.datagen.loot; +package com.refinedmods.refinedstorage.neoforge.datagen.loot; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyLootItemFunction; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.support.energy.EnergyLootItemFunction; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/loot/LootTableProviderImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/LootTableProviderImpl.java similarity index 90% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/loot/LootTableProviderImpl.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/LootTableProviderImpl.java index 11103a175..1e39eb705 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/loot/LootTableProviderImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/LootTableProviderImpl.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.datagen.loot; +package com.refinedmods.refinedstorage.neoforge.datagen.loot; import java.util.List; import java.util.Set; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/package-info.java new file mode 100644 index 000000000..4e5706c4c --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.datagen.loot; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/package-info.java new file mode 100644 index 000000000..24407b8a0 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.datagen; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/recipe/RecoloringRecipeProvider.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/RecoloringRecipeProvider.java similarity index 95% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/recipe/RecoloringRecipeProvider.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/RecoloringRecipeProvider.java index e3fbe8959..15672a360 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/recipe/RecoloringRecipeProvider.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/RecoloringRecipeProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.neoforge.datagen.recipe; +package com.refinedmods.refinedstorage.neoforge.datagen.recipe; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.Tags; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.Tags; import java.util.concurrent.CompletableFuture; @@ -16,7 +16,7 @@ import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.Item; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class RecoloringRecipeProvider extends RecipeProvider { public RecoloringRecipeProvider(final PackOutput output, diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/package-info.java new file mode 100644 index 000000000..2807e90d2 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.datagen.recipe; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/tag/BlockTagsProvider.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/tag/BlockTagsProvider.java similarity index 85% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/tag/BlockTagsProvider.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/tag/BlockTagsProvider.java index 8acdeb830..25fec3577 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/tag/BlockTagsProvider.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/tag/BlockTagsProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.datagen.tag; +package com.refinedmods.refinedstorage.neoforge.datagen.tag; import java.util.concurrent.CompletableFuture; import javax.annotation.Nullable; @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.data.ExistingFileHelper; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.MOD_ID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.MOD_ID; public class BlockTagsProvider extends TagsProvider { public BlockTagsProvider(final PackOutput packOutput, diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/tag/ItemTagsProviderImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/tag/ItemTagsProviderImpl.java new file mode 100644 index 000000000..d9e4687db --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/tag/ItemTagsProviderImpl.java @@ -0,0 +1,137 @@ +package com.refinedmods.refinedstorage.neoforge.datagen.tag; + +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.support.BaseBlockItem; + +import java.util.Arrays; +import java.util.Collection; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +import net.minecraft.core.HolderLookup; +import net.minecraft.data.PackOutput; +import net.minecraft.data.tags.ItemTagsProvider; +import net.minecraft.data.tags.TagsProvider; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import net.neoforged.neoforge.common.data.ExistingFileHelper; + +import static com.refinedmods.refinedstorage.common.content.Tags.CABLES; +import static com.refinedmods.refinedstorage.common.content.Tags.CONSTRUCTORS; +import static com.refinedmods.refinedstorage.common.content.Tags.CONTROLLERS; +import static com.refinedmods.refinedstorage.common.content.Tags.CRAFTING_GRIDS; +import static com.refinedmods.refinedstorage.common.content.Tags.CREATIVE_CONTROLLERS; +import static com.refinedmods.refinedstorage.common.content.Tags.DESTRUCTORS; +import static com.refinedmods.refinedstorage.common.content.Tags.DETECTORS; +import static com.refinedmods.refinedstorage.common.content.Tags.DISK_INTERFACES; +import static com.refinedmods.refinedstorage.common.content.Tags.EXPORTERS; +import static com.refinedmods.refinedstorage.common.content.Tags.EXTERNAL_STORAGES; +import static com.refinedmods.refinedstorage.common.content.Tags.FLUID_STORAGE_DISKS; +import static com.refinedmods.refinedstorage.common.content.Tags.GRIDS; +import static com.refinedmods.refinedstorage.common.content.Tags.IMPORTERS; +import static com.refinedmods.refinedstorage.common.content.Tags.NETWORK_RECEIVERS; +import static com.refinedmods.refinedstorage.common.content.Tags.NETWORK_TRANSMITTERS; +import static com.refinedmods.refinedstorage.common.content.Tags.RELAYS; +import static com.refinedmods.refinedstorage.common.content.Tags.SECURITY_MANAGERS; +import static com.refinedmods.refinedstorage.common.content.Tags.STORAGE_DISKS; +import static com.refinedmods.refinedstorage.common.content.Tags.WIRELESS_TRANSMITTERS; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.MOD_ID; + +public class ItemTagsProviderImpl extends ItemTagsProvider { + public ItemTagsProviderImpl(final PackOutput packOutput, + final CompletableFuture registries, + final TagsProvider blockTagsProvider, + final ExistingFileHelper existingFileHelper) { + super(packOutput, registries, blockTagsProvider.contentsGetter(), MOD_ID, existingFileHelper); + } + + @Override + protected void addTags(final HolderLookup.Provider provider) { + addAllToTag2(CABLES, Items.INSTANCE.getCables()); + addAllToTag(CONTROLLERS, Items.INSTANCE.getControllers()); + addAllToTag(CREATIVE_CONTROLLERS, Blocks.INSTANCE.getCreativeController().values().stream() + .map(Block::asItem) + .map(c -> (Supplier) () -> c) + .toList()); + addAllToTag(FLUID_STORAGE_DISKS, + Arrays.stream(FluidStorageVariant.values()) + .filter(variant -> variant != FluidStorageVariant.CREATIVE) + .map(Items.INSTANCE::getFluidStorageDisk) + .map(t -> (Supplier) () -> t) + .toList()); + addAllToTag(GRIDS, + Blocks.INSTANCE.getGrid().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(CRAFTING_GRIDS, + Blocks.INSTANCE.getCraftingGrid().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(STORAGE_DISKS, + Arrays.stream(ItemStorageVariant.values()) + .filter(variant -> variant != ItemStorageVariant.CREATIVE) + .map(Items.INSTANCE::getItemStorageDisk) + .map(t -> (Supplier) () -> t) + .toList()); + addAllToTag(IMPORTERS, + Blocks.INSTANCE.getImporter().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(EXPORTERS, + Blocks.INSTANCE.getExporter().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(EXTERNAL_STORAGES, + Blocks.INSTANCE.getExternalStorage().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(DETECTORS, + Blocks.INSTANCE.getDetector().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(CONSTRUCTORS, + Blocks.INSTANCE.getConstructor().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(DESTRUCTORS, + Blocks.INSTANCE.getDestructor().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(WIRELESS_TRANSMITTERS, + Blocks.INSTANCE.getWirelessTransmitter().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(NETWORK_RECEIVERS, + Blocks.INSTANCE.getNetworkReceiver().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(NETWORK_TRANSMITTERS, + Blocks.INSTANCE.getNetworkTransmitter().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(SECURITY_MANAGERS, + Blocks.INSTANCE.getSecurityManager().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(RELAYS, + Blocks.INSTANCE.getRelay().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(DISK_INTERFACES, + Blocks.INSTANCE.getDiskInterface().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + } + + private void addAllToTag(final TagKey t, final Collection> items) { + tag(t).add(items.stream().map(Supplier::get).toArray(Item[]::new)).replace(false); + } + + private void addAllToTag2(final TagKey t, final Collection> items) { + tag(t).add(items.stream().map(Supplier::get).toArray(Item[]::new)).replace(false); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/tag/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/tag/package-info.java new file mode 100644 index 000000000..9dff16331 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/tag/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.datagen.tag; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/exporter/FluidHandlerExporterTransferStrategyFactory.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/exporter/FluidHandlerExporterTransferStrategyFactory.java new file mode 100644 index 000000000..ad07f47fc --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/exporter/FluidHandlerExporterTransferStrategyFactory.java @@ -0,0 +1,39 @@ +package com.refinedmods.refinedstorage.neoforge.exporter; + +import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterTransferStrategyImpl; +import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.exporter.FuzzyExporterTransferStrategy; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCache; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCacheImpl; +import com.refinedmods.refinedstorage.neoforge.storage.FluidHandlerInsertableStorage; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; + +public class FluidHandlerExporterTransferStrategyFactory implements ExporterTransferStrategyFactory { + @Override + public ExporterTransferStrategy create(final ServerLevel level, + final BlockPos pos, + final Direction direction, + final UpgradeState upgradeState, + final AmountOverride amountOverride, + final boolean fuzzyMode) { + final CapabilityCache coordinates = new CapabilityCacheImpl(level, pos, direction); + final FluidHandlerInsertableStorage destination = new FluidHandlerInsertableStorage( + coordinates, + amountOverride + ); + final long transferQuota = (upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1) + * Platform.INSTANCE.getBucketAmount(); + if (fuzzyMode) { + return new FuzzyExporterTransferStrategy(destination, transferQuota); + } + return new ExporterTransferStrategyImpl(destination, transferQuota); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/exporter/ItemHandlerExporterTransferStrategyFactory.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/exporter/ItemHandlerExporterTransferStrategyFactory.java new file mode 100644 index 000000000..d9db82c0e --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/exporter/ItemHandlerExporterTransferStrategyFactory.java @@ -0,0 +1,33 @@ +package com.refinedmods.refinedstorage.neoforge.exporter; + +import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterTransferStrategyImpl; +import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy; +import com.refinedmods.refinedstorage.common.api.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.exporter.FuzzyExporterTransferStrategy; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCacheImpl; +import com.refinedmods.refinedstorage.neoforge.storage.ItemHandlerInsertableStorage; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; + +public class ItemHandlerExporterTransferStrategyFactory implements ExporterTransferStrategyFactory { + @Override + public ExporterTransferStrategy create(final ServerLevel level, + final BlockPos pos, + final Direction direction, + final UpgradeState upgradeState, + final AmountOverride amountOverride, + final boolean fuzzyMode) { + final CapabilityCacheImpl coordinates = new CapabilityCacheImpl(level, pos, direction); + final ItemHandlerInsertableStorage destination = new ItemHandlerInsertableStorage(coordinates, amountOverride); + final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; + if (fuzzyMode) { + return new FuzzyExporterTransferStrategy(destination, transferQuota); + } + return new ExporterTransferStrategyImpl(destination, transferQuota); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/exporter/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/exporter/package-info.java new file mode 100644 index 000000000..d4611951e --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/exporter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.exporter; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/CursorItemHandler.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/CursorItemHandler.java similarity index 97% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/CursorItemHandler.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/CursorItemHandler.java index 633ffda58..3a37a65ca 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/CursorItemHandler.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/CursorItemHandler.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.grid.strategy; +package com.refinedmods.refinedstorage.neoforge.grid.strategy; import javax.annotation.Nonnull; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridExtractionStrategy.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridExtractionStrategy.java new file mode 100644 index 000000000..f73c3eb51 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridExtractionStrategy.java @@ -0,0 +1,153 @@ +package com.refinedmods.refinedstorage.neoforge.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.EmptyActor; +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; + +import javax.annotation.Nullable; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; + +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidAction; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidStack; + +public class FluidGridExtractionStrategy implements GridExtractionStrategy { + private static final ItemResource BUCKET_ITEM_RESOURCE = new ItemResource(Items.BUCKET); + + private final AbstractContainerMenu menu; + private final GridOperations gridOperations; + private final PlayerMainInvWrapper playerInventoryStorage; + private final Storage itemStorage; + + public FluidGridExtractionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + this.menu = containerMenu; + this.gridOperations = grid.createOperations(ResourceTypes.FLUID, player); + this.playerInventoryStorage = new PlayerMainInvWrapper(player.getInventory()); + this.itemStorage = grid.getItemStorage(); + } + + @Override + public boolean onExtract(final PlatformResourceKey resource, + final GridExtractMode extractMode, + final boolean cursor) { + if (resource instanceof FluidResource fluidResource) { + final boolean bucketInInventory = hasBucketInInventory(); + final boolean bucketInStorage = hasBucketInStorage(); + if (bucketInInventory) { + extract(fluidResource, extractMode, cursor, true); + } else if (bucketInStorage) { + extract(fluidResource, extractMode, cursor, false); + } + return true; + } + return false; + } + + @Nullable + private IFluidHandlerItem getFluidStorage(final ItemStack stack) { + return stack.getCapability(Capabilities.FluidHandler.ITEM); + } + + private void extract(final FluidResource fluidResource, + final GridExtractMode mode, + final boolean cursor, + final boolean bucketFromInventory) { + final IFluidHandlerItem destination = getFluidStorage(BUCKET_ITEM_RESOURCE.toItemStack()); + if (destination == null) { + return; // shouldn't happen + } + gridOperations.extract(fluidResource, mode, (resource, amount, action, source) -> { + if (!(resource instanceof FluidResource fluidResource2)) { + return 0; + } + final int inserted = destination.fill(toFluidStack(fluidResource2, amount), toFluidAction(action)); + if (action == Action.EXECUTE) { + extractSourceBucket(bucketFromInventory, source); + if (!insertResultingBucket(cursor, destination)) { + insertSourceBucket(bucketFromInventory, source); + return 0; + } + } + return inserted; + }); + } + + private void extractSourceBucket(final boolean bucketFromInventory, final Actor actor) { + if (bucketFromInventory) { + extractBucket(playerInventoryStorage, Action.EXECUTE); + } else { + itemStorage.extract(BUCKET_ITEM_RESOURCE, 1, Action.EXECUTE, actor); + } + } + + private void insertSourceBucket(final boolean bucketFromInventory, final Actor actor) { + if (bucketFromInventory) { + insertBucket(playerInventoryStorage); + } else { + itemStorage.insert(BUCKET_ITEM_RESOURCE, 1, Action.EXECUTE, actor); + } + } + + private boolean insertResultingBucket(final boolean cursor, final IFluidHandlerItem destination) { + if (cursor) { + menu.setCarried(destination.getContainer()); + return true; + } else { + final ItemStack remainder = ItemHandlerHelper.insertItem( + playerInventoryStorage, + destination.getContainer(), + false + ); + return remainder.isEmpty(); + } + } + + private boolean hasBucketInStorage() { + return itemStorage.extract(BUCKET_ITEM_RESOURCE, 1, Action.SIMULATE, EmptyActor.INSTANCE) == 1; + } + + private boolean hasBucketInInventory() { + return extractBucket(playerInventoryStorage, Action.SIMULATE); + } + + private boolean extractBucket(final IItemHandler source, final Action action) { + final ItemStack toExtractStack = BUCKET_ITEM_RESOURCE.toItemStack(); + for (int slot = 0; slot < source.getSlots(); ++slot) { + final boolean relevant = isSame(source.getStackInSlot(slot), toExtractStack); + if (!relevant) { + continue; + } + if (source.extractItem(slot, 1, action == Action.SIMULATE).getCount() == 1) { + return true; + } + } + return false; + } + + private void insertBucket(final IItemHandler destination) { + ItemHandlerHelper.insertItem(destination, BUCKET_ITEM_RESOURCE.toItemStack(), false); + } + + private boolean isSame(final ItemStack a, final ItemStack b) { + return ItemStack.isSameItemSameComponents(a, b); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridInsertionStrategy.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridInsertionStrategy.java new file mode 100644 index 000000000..2c1dd26b1 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridInsertionStrategy.java @@ -0,0 +1,75 @@ +package com.refinedmods.refinedstorage.neoforge.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; + +import javax.annotation.Nullable; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; + +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.ofFluidStack; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidAction; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidStack; + +public class FluidGridInsertionStrategy implements GridInsertionStrategy { + private final AbstractContainerMenu menu; + private final GridOperations gridOperations; + + public FluidGridInsertionStrategy(final AbstractContainerMenu menu, final ServerPlayer player, final Grid grid) { + this.menu = menu; + this.gridOperations = grid.createOperations(ResourceTypes.FLUID, player); + } + + @Override + public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { + final IFluidHandlerItem cursorStorage = getFluidCursorStorage(); + if (cursorStorage == null) { + return false; + } + final FluidStack extractableResource = cursorStorage.getFluidInTank(0); + if (extractableResource.isEmpty()) { + return false; + } + final FluidResource fluidResource = ofFluidStack(extractableResource); + gridOperations.insert(fluidResource, insertMode, (resource, amount, action, source) -> { + if (!(resource instanceof FluidResource fluidResource2)) { + return 0; + } + final FluidStack toDrain = toFluidStack( + fluidResource2, + amount == Long.MAX_VALUE ? Integer.MAX_VALUE : amount + ); + final FluidStack drained = cursorStorage.drain(toDrain, toFluidAction(action)); + if (action == Action.EXECUTE) { + menu.setCarried(cursorStorage.getContainer()); + } + return drained.getAmount(); + }); + return true; + } + + @Nullable + private IFluidHandlerItem getFluidCursorStorage() { + return getFluidStorage(menu.getCarried()); + } + + @Nullable + private IFluidHandlerItem getFluidStorage(final ItemStack stack) { + return stack.getCapability(Capabilities.FluidHandler.ITEM); + } + + @Override + public boolean onTransfer(final int slotIndex) { + throw new UnsupportedOperationException(); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/ItemGridExtractionStrategy.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/ItemGridExtractionStrategy.java new file mode 100644 index 000000000..257bfe7db --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/ItemGridExtractionStrategy.java @@ -0,0 +1,47 @@ +package com.refinedmods.refinedstorage.neoforge.grid.strategy; + +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCache; +import com.refinedmods.refinedstorage.neoforge.storage.ItemHandlerInsertableStorage; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; + +public class ItemGridExtractionStrategy implements GridExtractionStrategy { + private final GridOperations gridOperations; + private final PlayerMainInvWrapper playerInventoryStorage; + private final CursorItemHandler playerCursorItemHandler; + + public ItemGridExtractionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); + this.playerInventoryStorage = new PlayerMainInvWrapper(player.getInventory()); + this.playerCursorItemHandler = new CursorItemHandler(containerMenu); + } + + @Override + public boolean onExtract(final PlatformResourceKey resource, + final GridExtractMode extractMode, + final boolean cursor) { + if (resource instanceof ItemResource itemResource) { + final IItemHandler handler = cursor ? playerCursorItemHandler : playerInventoryStorage; + gridOperations.extract( + itemResource, + extractMode, + new ItemHandlerInsertableStorage(CapabilityCache.ofItemHandler(handler), AmountOverride.NONE) + ); + return true; + } + return false; + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/ItemGridInsertionStrategy.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/ItemGridInsertionStrategy.java new file mode 100644 index 000000000..690cf8524 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/ItemGridInsertionStrategy.java @@ -0,0 +1,76 @@ +package com.refinedmods.refinedstorage.neoforge.grid.strategy; + +import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCache; +import com.refinedmods.refinedstorage.neoforge.storage.ItemHandlerExtractableStorage; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.Slot; +import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.items.wrapper.InvWrapper; +import net.neoforged.neoforge.items.wrapper.RangedWrapper; + +import static com.refinedmods.refinedstorage.common.support.resource.ItemResource.ofItemStack; + +public class ItemGridInsertionStrategy implements GridInsertionStrategy { + private final AbstractContainerMenu containerMenu; + private final GridOperations gridOperations; + private final CursorItemHandler playerCursorItemHandler; + + public ItemGridInsertionStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + this.containerMenu = containerMenu; + this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); + this.playerCursorItemHandler = new CursorItemHandler(containerMenu); + } + + @Override + public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { + final ItemStack carried = containerMenu.getCarried(); + if (carried.isEmpty()) { + return false; + } + final ItemResource itemResource = ItemResource.ofItemStack(carried); + gridOperations.insert( + itemResource, + insertMode, + new ItemHandlerExtractableStorage( + CapabilityCache.ofItemHandler(playerCursorItemHandler), + AmountOverride.NONE + ) + ); + return true; + } + + @Override + public boolean onTransfer(final int slotIndex) { + final Slot slot = containerMenu.getSlot(slotIndex); + final RangedWrapper storage = new RangedWrapper( + new InvWrapper(slot.container), + slot.getContainerSlot(), + slot.getContainerSlot() + 1 + ); + final ItemStack itemStackInSlot = storage.getStackInSlot(0); + if (itemStackInSlot.isEmpty()) { + return false; + } + final ItemResource itemResource = ofItemStack(itemStackInSlot); + gridOperations.insert( + itemResource, + GridInsertMode.ENTIRE_RESOURCE, + new ItemHandlerExtractableStorage( + CapabilityCache.ofItemHandler(storage), + AmountOverride.NONE + ) + ); + return true; + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/ItemGridScrollingStrategy.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/ItemGridScrollingStrategy.java new file mode 100644 index 000000000..690cb7f32 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/ItemGridScrollingStrategy.java @@ -0,0 +1,77 @@ +package com.refinedmods.refinedstorage.neoforge.grid.strategy; + +import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; +import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage.common.api.grid.Grid; +import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCache; +import com.refinedmods.refinedstorage.neoforge.storage.ItemHandlerExtractableStorage; +import com.refinedmods.refinedstorage.neoforge.storage.ItemHandlerInsertableStorage; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.wrapper.InvWrapper; +import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; +import net.neoforged.neoforge.items.wrapper.RangedWrapper; + +public class ItemGridScrollingStrategy implements GridScrollingStrategy { + private final GridOperations gridOperations; + private final Inventory playerInventory; + private final PlayerMainInvWrapper playerInventoryStorage; + private final CursorItemHandler playerCursorItemHandler; + + public ItemGridScrollingStrategy(final AbstractContainerMenu containerMenu, + final ServerPlayer player, + final Grid grid) { + this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); + this.playerInventory = player.getInventory(); + this.playerInventoryStorage = new PlayerMainInvWrapper(playerInventory); + this.playerCursorItemHandler = new CursorItemHandler(containerMenu); + } + + @Override + public boolean onScroll(final PlatformResourceKey resource, final GridScrollMode scrollMode, final int slotIndex) { + if (resource instanceof ItemResource itemResource) { + final IItemHandler playerStorage = slotIndex >= 0 + ? new RangedWrapper(new InvWrapper(playerInventory), slotIndex, slotIndex + 1) + : playerInventoryStorage; + switch (scrollMode) { + case GRID_TO_INVENTORY -> handleGridToInventoryScroll(itemResource, playerStorage); + case INVENTORY_TO_GRID -> handleInventoryToGridScroll(itemResource, playerStorage); + case GRID_TO_CURSOR -> handleGridToInventoryScroll(itemResource, playerCursorItemHandler); + } + return true; + } + return false; + } + + private void handleInventoryToGridScroll(final ItemResource itemResource, final IItemHandler sourceStorage) { + gridOperations.insert( + itemResource, + GridInsertMode.SINGLE_RESOURCE, + new ItemHandlerExtractableStorage( + CapabilityCache.ofItemHandler(sourceStorage), + AmountOverride.NONE + ) + ); + } + + private void handleGridToInventoryScroll(final ItemResource itemResource, final IItemHandler destinationStorage) { + gridOperations.extract( + itemResource, + GridExtractMode.SINGLE_RESOURCE, + new ItemHandlerInsertableStorage( + CapabilityCache.ofItemHandler(destinationStorage), + AmountOverride.NONE + ) + ); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/package-info.java new file mode 100644 index 000000000..10669fd6c --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.grid.strategy; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/view/ForgeFluidGridResourceFactory.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/view/ForgeFluidGridResourceFactory.java new file mode 100644 index 000000000..0461c6e8d --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/view/ForgeFluidGridResourceFactory.java @@ -0,0 +1,30 @@ +package com.refinedmods.refinedstorage.neoforge.grid.view; + +import com.refinedmods.refinedstorage.common.grid.view.AbstractFluidGridResourceFactory; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; + +import net.neoforged.fml.ModList; +import net.neoforged.neoforge.fluids.FluidType; + +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidStack; + +public class ForgeFluidGridResourceFactory extends AbstractFluidGridResourceFactory { + @Override + protected String getTooltip(final FluidResource resource) { + return getName(resource); + } + + @Override + protected String getModName(final String modId) { + return ModList + .get() + .getModContainerById(modId) + .map(container -> container.getModInfo().getDisplayName()) + .orElse(""); + } + + @Override + protected String getName(final FluidResource fluidResource) { + return toFluidStack(fluidResource, FluidType.BUCKET_VOLUME).getHoverName().getString(); + } +} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/view/ForgeItemGridResourceFactory.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/view/ForgeItemGridResourceFactory.java similarity index 78% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/view/ForgeItemGridResourceFactory.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/view/ForgeItemGridResourceFactory.java index 6cf5cf4e4..f4e6d7b12 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/view/ForgeItemGridResourceFactory.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/view/ForgeItemGridResourceFactory.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.neoforge.grid.view; +package com.refinedmods.refinedstorage.neoforge.grid.view; -import com.refinedmods.refinedstorage.platform.common.grid.view.AbstractItemGridResourceFactory; +import com.refinedmods.refinedstorage.common.grid.view.AbstractItemGridResourceFactory; import java.util.Objects; import java.util.Optional; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/view/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/view/package-info.java new file mode 100644 index 000000000..5152facdd --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/view/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.grid.view; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/FluidHandlerImporterSource.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/FluidHandlerImporterSource.java similarity index 79% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/FluidHandlerImporterSource.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/FluidHandlerImporterSource.java index 30e1fa319..3c181adfd 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/FluidHandlerImporterSource.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/FluidHandlerImporterSource.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.importer; +package com.refinedmods.refinedstorage.neoforge.importer; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterSource; @@ -6,10 +6,10 @@ import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCache; -import com.refinedmods.refinedstorage.platform.neoforge.storage.FluidHandlerExtractableStorage; -import com.refinedmods.refinedstorage.platform.neoforge.storage.FluidHandlerInsertableStorage; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCache; +import com.refinedmods.refinedstorage.neoforge.storage.FluidHandlerExtractableStorage; +import com.refinedmods.refinedstorage.neoforge.storage.FluidHandlerInsertableStorage; import java.util.Iterator; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/FluidHandlerImporterTransferStrategyFactory.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/FluidHandlerImporterTransferStrategyFactory.java new file mode 100644 index 000000000..3665e2cf7 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/FluidHandlerImporterTransferStrategyFactory.java @@ -0,0 +1,34 @@ +package com.refinedmods.refinedstorage.neoforge.importer; + +import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterSource; +import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterTransferStrategyImpl; +import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy; +import com.refinedmods.refinedstorage.common.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCacheImpl; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.neoforged.neoforge.fluids.FluidType; + +public class FluidHandlerImporterTransferStrategyFactory implements ImporterTransferStrategyFactory { + @Override + public ImporterTransferStrategy create(final ServerLevel level, + final BlockPos pos, + final Direction direction, + final UpgradeState upgradeState, + final AmountOverride amountOverride) { + final ImporterSource source = new FluidHandlerImporterSource(new CapabilityCacheImpl( + level, + pos, + direction + ), amountOverride); + final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) + ? FluidType.BUCKET_VOLUME * 64 + : FluidType.BUCKET_VOLUME; + return new ImporterTransferStrategyImpl(source, transferQuota); + } +} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/ItemHandlerImporterSource.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/ItemHandlerImporterSource.java similarity index 79% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/ItemHandlerImporterSource.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/ItemHandlerImporterSource.java index 71c45fe99..ea564b124 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/ItemHandlerImporterSource.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/ItemHandlerImporterSource.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.importer; +package com.refinedmods.refinedstorage.neoforge.importer; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterSource; @@ -6,10 +6,10 @@ import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCache; -import com.refinedmods.refinedstorage.platform.neoforge.storage.ItemHandlerExtractableStorage; -import com.refinedmods.refinedstorage.platform.neoforge.storage.ItemHandlerInsertableStorage; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCache; +import com.refinedmods.refinedstorage.neoforge.storage.ItemHandlerExtractableStorage; +import com.refinedmods.refinedstorage.neoforge.storage.ItemHandlerInsertableStorage; import java.util.Iterator; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/ItemHandlerImporterTransferStrategyFactory.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/ItemHandlerImporterTransferStrategyFactory.java new file mode 100644 index 000000000..981d3b9da --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/ItemHandlerImporterTransferStrategyFactory.java @@ -0,0 +1,31 @@ +package com.refinedmods.refinedstorage.neoforge.importer; + +import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterSource; +import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterTransferStrategyImpl; +import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy; +import com.refinedmods.refinedstorage.common.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCacheImpl; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; + +public class ItemHandlerImporterTransferStrategyFactory implements ImporterTransferStrategyFactory { + @Override + public ImporterTransferStrategy create(final ServerLevel level, + final BlockPos pos, + final Direction direction, + final UpgradeState upgradeState, + final AmountOverride amountOverride) { + final ImporterSource source = new ItemHandlerImporterSource(new CapabilityCacheImpl( + level, + pos, + direction + ), amountOverride); + final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; + return new ImporterTransferStrategyImpl(source, transferQuota); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/package-info.java new file mode 100644 index 000000000..62f6e210e --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/importer/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.importer; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/package-info.java new file mode 100644 index 000000000..2fd13d923 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/CapabilityCache.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/CapabilityCache.java similarity index 94% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/CapabilityCache.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/CapabilityCache.java index 30878750b..2c2cc43bb 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/CapabilityCache.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/CapabilityCache.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage; +package com.refinedmods.refinedstorage.neoforge.storage; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; @@ -14,8 +14,8 @@ import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.items.IItemHandler; -import static com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource.ofItemStack; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.ofFluidStack; +import static com.refinedmods.refinedstorage.common.support.resource.ItemResource.ofItemStack; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.ofFluidStack; public interface CapabilityCache { default Optional getItemHandler() { diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/CapabilityCacheImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/CapabilityCacheImpl.java similarity index 95% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/CapabilityCacheImpl.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/CapabilityCacheImpl.java index 6641e4789..9acb099a4 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/CapabilityCacheImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/CapabilityCacheImpl.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage; +package com.refinedmods.refinedstorage.neoforge.storage; import java.util.Optional; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/DiskContainerItemOverrides.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/DiskContainerItemOverrides.java similarity index 92% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/DiskContainerItemOverrides.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/DiskContainerItemOverrides.java index 27cf58b85..8b23ecfed 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/DiskContainerItemOverrides.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/DiskContainerItemOverrides.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage; +package com.refinedmods.refinedstorage.neoforge.storage; import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.common.storage.AbstractDiskContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.ItemBakedModel; +import com.refinedmods.refinedstorage.common.storage.AbstractDiskContainerBlockEntity; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.neoforge.support.render.ItemBakedModel; import java.util.List; import java.util.Map; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/FluidHandlerExtractableStorage.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/FluidHandlerExtractableStorage.java similarity index 77% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/FluidHandlerExtractableStorage.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/FluidHandlerExtractableStorage.java index a91c290d0..db326d49a 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/FluidHandlerExtractableStorage.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/FluidHandlerExtractableStorage.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage; +package com.refinedmods.refinedstorage.neoforge.storage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import net.neoforged.neoforge.fluids.FluidStack; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidAction; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidAction; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidStack; public class FluidHandlerExtractableStorage implements ExtractableStorage { private final CapabilityCache capabilityCache; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/FluidHandlerInsertableStorage.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/FluidHandlerInsertableStorage.java similarity index 80% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/FluidHandlerInsertableStorage.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/FluidHandlerInsertableStorage.java index b73b81973..b06bd9db4 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/FluidHandlerInsertableStorage.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/FluidHandlerInsertableStorage.java @@ -1,17 +1,17 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage; +package com.refinedmods.refinedstorage.neoforge.storage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.capability.IFluidHandler; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidAction; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidAction; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidStack; public class FluidHandlerInsertableStorage implements InsertableStorage { private final CapabilityCache capabilityCache; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/ForgeHandlerUtil.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/ForgeHandlerUtil.java similarity index 81% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/ForgeHandlerUtil.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/ForgeHandlerUtil.java index e76d0cdca..56f516035 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/ForgeHandlerUtil.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/ForgeHandlerUtil.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage; +package com.refinedmods.refinedstorage.neoforge.storage; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.items.IItemHandler; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.isSame; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.isSame; final class ForgeHandlerUtil { private ForgeHandlerUtil() { diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/ItemHandlerExtractableStorage.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/ItemHandlerExtractableStorage.java similarity index 91% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/ItemHandlerExtractableStorage.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/ItemHandlerExtractableStorage.java index 06a8d4521..0cb8a5298 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/ItemHandlerExtractableStorage.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/ItemHandlerExtractableStorage.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage; +package com.refinedmods.refinedstorage.neoforge.storage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.items.IItemHandler; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/ItemHandlerInsertableStorage.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/ItemHandlerInsertableStorage.java new file mode 100644 index 000000000..22c52d845 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/ItemHandlerInsertableStorage.java @@ -0,0 +1,54 @@ +package com.refinedmods.refinedstorage.neoforge.storage; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.InsertableStorage; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; + +public class ItemHandlerInsertableStorage implements InsertableStorage { + private final CapabilityCache capabilityCache; + private final AmountOverride amountOverride; + + public ItemHandlerInsertableStorage(final CapabilityCache capabilityCache, + final AmountOverride amountOverride) { + this.capabilityCache = capabilityCache; + this.amountOverride = amountOverride; + } + + @Override + public long insert(final ResourceKey resource, final long amount, final Action action, final Actor actor) { + if (!(resource instanceof ItemResource itemResource)) { + return 0L; + } + return capabilityCache.getItemHandler().map(itemHandler -> { + final long correctedAmount = amountOverride.overrideAmount( + resource, + amount, + () -> ForgeHandlerUtil.getCurrentAmount(itemHandler, itemResource.toItemStack()) + ); + if (correctedAmount == 0) { + return 0L; + } + return doInsert(itemResource, correctedAmount, action, itemHandler); + }).orElse(0L); + } + + private long doInsert(final ItemResource resource, + final long amount, + final Action action, + final IItemHandler itemHandler) { + final ItemStack stack = resource.toItemStack(amount); + final ItemStack remainder = ItemHandlerHelper.insertItem( + itemHandler, + stack, + action == Action.SIMULATE + ); + return amount - remainder.getCount(); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveBakedModel.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveBakedModel.java new file mode 100644 index 000000000..2a920a64c --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveBakedModel.java @@ -0,0 +1,162 @@ +package com.refinedmods.refinedstorage.neoforge.storage.diskdrive; + +import com.refinedmods.refinedstorage.api.storage.StorageState; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.diskdrive.DiskDriveBlock; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.neoforge.storage.DiskContainerItemOverrides; +import com.refinedmods.refinedstorage.neoforge.support.render.DiskModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.RotationTranslationModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.TransformationBuilder; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import javax.annotation.Nullable; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.mojang.math.Transformation; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.ItemOverrides; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.client.model.BakedModelWrapper; +import net.neoforged.neoforge.client.model.data.ModelData; +import org.joml.Vector3f; + +class DiskDriveBakedModel extends BakedModelWrapper { + private final LoadingCache> cache; + private final DiskContainerItemOverrides itemOverrides; + private final Vector3f[] diskTranslations = new Vector3f[8]; + + DiskDriveBakedModel(final BakedModel baseModel, + final RotationTranslationModelBaker baseModelBaker, + final DiskModelBaker diskModelBaker, + final RotationTranslationModelBaker ledInactiveModelBaker) { + super(baseModel); + int i = 0; + for (int y = 0; y < 4; ++y) { + for (int x = 0; x < 2; ++x) { + this.diskTranslations[i++] = getDiskTranslation(x, y); + } + } + this.cache = CacheBuilder.newBuilder().build(CacheLoader.from(cacheKey -> { + final Transformation rotation = TransformationBuilder.create().rotate(cacheKey.direction).build(); + final RandomSource rand = RandomSource.create(); + final List quads = baseModelBaker.bake(rotation, cacheKey.side, rand); + for (int j = 0; j < diskTranslations.length; ++j) { + final Disk disk = cacheKey.disks[j]; + quads.addAll(getDiskQuads(diskModelBaker, cacheKey, disk, j)); + if (cacheKey.withInactiveLed && disk.state() == StorageState.INACTIVE) { + final Transformation ledTransform = TransformationBuilder + .create() + .rotate(cacheKey.direction) + .translate(diskTranslations[j]) + .build(); + quads.addAll(ledInactiveModelBaker.bake(ledTransform, cacheKey.side, rand)); + } + } + return quads; + })); + this.itemOverrides = new DiskContainerItemOverrides<>( + cache, + baseModel, + diskTranslations, + disks -> new CacheKey(null, true, BiDirection.NORTH, disks), + CacheKey::withSide + ); + } + + @Override + public ItemOverrides getOverrides() { + return itemOverrides; + } + + @Override + public List getQuads(@Nullable final BlockState state, + @Nullable final Direction side, + final RandomSource rand, + final ModelData extraData, + @Nullable final RenderType renderType) { + if (state == null || !(state.getBlock() instanceof DiskDriveBlock diskDriveBlock)) { + return super.getQuads(state, side, rand); + } + final BiDirection direction = diskDriveBlock.getDirection(state); + if (direction == null) { + return super.getQuads(state, side, rand); + } + final Disk[] disks = extraData.get(ForgeDiskDriveBlockEntity.DISKS_PROPERTY); + if (disks == null) { + return super.getQuads(state, side, rand); + } + return cache.getUnchecked(new CacheKey(side, false, direction, disks)); + } + + private List getDiskQuads(final DiskModelBaker diskBakers, + final CacheKey cacheKey, + final Disk disk, + final int index) { + if (disk.state() == StorageState.NONE || disk.item() == null) { + return Collections.emptyList(); + } + final RotationTranslationModelBaker diskBaker = diskBakers.forDisk(disk.item()); + if (diskBaker == null) { + return Collections.emptyList(); + } + final Transformation diskTransform = TransformationBuilder.create() + .rotate(cacheKey.direction) + .translate(diskTranslations[index]) + .build(); + return diskBaker.bake(diskTransform, cacheKey.side, RandomSource.create()); + } + + private static Vector3f getDiskTranslation(final int x, final int y) { + return new Vector3f( + x == 0 ? -(2F / 16F) : -(9F / 16F), + -((y * 3F) / 16F) - (2F / 16F), + 0 + ); + } + + private record CacheKey(@Nullable Direction side, boolean withInactiveLed, BiDirection direction, Disk[] disks) { + CacheKey withSide(final Direction newSide) { + return new CacheKey(newSide, withInactiveLed, direction, disks); + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CacheKey cacheKey = (CacheKey) o; + return side == cacheKey.side && direction == cacheKey.direction && Arrays.equals(disks, cacheKey.disks) + && withInactiveLed == cacheKey.withInactiveLed; + } + + @Override + public int hashCode() { + int result = Objects.hash(side, direction, withInactiveLed); + result = 31 * result + Arrays.hashCode(disks); + return result; + } + + @Override + public String toString() { + return "CacheKey{" + + "side=" + side + + ", withInactiveLed=" + withInactiveLed + + ", direction=" + direction + + ", disks=" + Arrays.toString(disks) + + '}'; + } + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java new file mode 100644 index 000000000..4756650aa --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java @@ -0,0 +1,18 @@ +package com.refinedmods.refinedstorage.neoforge.storage.diskdrive; + +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntityRenderer; +import com.refinedmods.refinedstorage.neoforge.support.render.RenderTypes; + +public class DiskDriveBlockEntityRendererImpl + extends AbstractDiskDriveBlockEntityRenderer { + public DiskDriveBlockEntityRendererImpl() { + super(RenderTypes.DISK_LED); + } + + @Override + protected Disk[] getDisks(final AbstractDiskDriveBlockEntity blockEntity) { + return blockEntity.getModelData().get(ForgeDiskDriveBlockEntity.DISKS_PROPERTY); + } +} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveGeometryLoader.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveGeometryLoader.java similarity index 86% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveGeometryLoader.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveGeometryLoader.java index ba576706f..01f91ad61 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveGeometryLoader.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveGeometryLoader.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskdrive; +package com.refinedmods.refinedstorage.neoforge.storage.diskdrive; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveUnbakedGeometry.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveUnbakedGeometry.java similarity index 80% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveUnbakedGeometry.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveUnbakedGeometry.java index d07034568..f50a5a1fb 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveUnbakedGeometry.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/DiskDriveUnbakedGeometry.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskdrive; +package com.refinedmods.refinedstorage.neoforge.storage.diskdrive; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.DiskModelBaker; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RotationTranslationModelBaker; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.neoforge.support.render.DiskModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.RotationTranslationModelBaker; import java.util.function.Function; @@ -17,7 +17,7 @@ import net.neoforged.neoforge.client.model.geometry.IGeometryBakingContext; import net.neoforged.neoforge.client.model.geometry.IUnbakedGeometry; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static java.util.Objects.requireNonNull; public class DiskDriveUnbakedGeometry implements IUnbakedGeometry { @@ -31,7 +31,7 @@ public class DiskDriveUnbakedGeometry implements IUnbakedGeometry modelGetter, final IGeometryBakingContext context) { modelGetter.apply(BASE_MODEL).resolveParents(modelGetter); - PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( diskModel -> modelGetter.apply(diskModel).resolveParents(modelGetter) ); modelGetter.apply(LED_INACTIVE_MODEL).resolveParents(modelGetter); diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/ForgeDiskDriveBlockEntity.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/ForgeDiskDriveBlockEntity.java similarity index 77% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/ForgeDiskDriveBlockEntity.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/ForgeDiskDriveBlockEntity.java index 47801f7f3..8d0a14f00 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/ForgeDiskDriveBlockEntity.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/ForgeDiskDriveBlockEntity.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskdrive; +package com.refinedmods.refinedstorage.neoforge.storage.diskdrive; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntity; import javax.annotation.Nonnull; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/package-info.java new file mode 100644 index 000000000..d8371671d --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskdrive/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.storage.diskdrive; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceBakedModel.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceBakedModel.java new file mode 100644 index 000000000..cc2d75694 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceBakedModel.java @@ -0,0 +1,170 @@ +package com.refinedmods.refinedstorage.neoforge.storage.diskinterface; + +import com.refinedmods.refinedstorage.api.storage.StorageState; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.diskinterface.DiskInterfaceBlock; +import com.refinedmods.refinedstorage.common.support.AbstractActiveColoredDirectionalBlock; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.neoforge.storage.DiskContainerItemOverrides; +import com.refinedmods.refinedstorage.neoforge.support.render.DiskModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.RotationTranslationModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.TransformationBuilder; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import javax.annotation.Nullable; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.mojang.math.Transformation; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.ItemOverrides; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.client.model.BakedModelWrapper; +import net.neoforged.neoforge.client.model.data.ModelData; +import org.joml.Vector3f; + +public class DiskInterfaceBakedModel extends BakedModelWrapper { + private final LoadingCache> cache; + private final DiskContainerItemOverrides itemOverrides; + private final Vector3f[] diskTranslations = new Vector3f[6]; + + DiskInterfaceBakedModel(final BakedModel baseModel, + final RotationTranslationModelBaker inactiveBaseModelBaker, + final RotationTranslationModelBaker baseModelBaker, + final DiskModelBaker diskModelBaker, + final RotationTranslationModelBaker ledInactiveModelBaker) { + super(baseModel); + for (int i = 0; i < 6; ++i) { + this.diskTranslations[i] = getDiskTranslation(i); + } + this.cache = CacheBuilder.newBuilder().build(CacheLoader.from(cacheKey -> { + final Transformation rotation = TransformationBuilder.create().rotate(cacheKey.direction).build(); + final RandomSource rand = RandomSource.create(); + final List quads = (cacheKey.active ? baseModelBaker : inactiveBaseModelBaker) + .bake(rotation, cacheKey.side, rand); + for (int j = 0; j < diskTranslations.length; ++j) { + final Disk disk = cacheKey.disks[j]; + quads.addAll(getDiskQuads(diskModelBaker, cacheKey, disk, j)); + if (cacheKey.withInactiveLed && disk.state() == StorageState.INACTIVE) { + final Transformation ledTransform = TransformationBuilder + .create() + .rotate(cacheKey.direction) + .translate(diskTranslations[j]) + .build(); + quads.addAll(ledInactiveModelBaker.bake(ledTransform, cacheKey.side, rand)); + } + } + return quads; + })); + this.itemOverrides = new DiskContainerItemOverrides<>( + cache, + baseModel, + diskTranslations, + disks -> new CacheKey(null, true, true, BiDirection.NORTH, disks), + CacheKey::withSide + ); + } + + @Override + public ItemOverrides getOverrides() { + return itemOverrides; + } + + @Override + public List getQuads(@Nullable final BlockState state, + @Nullable final Direction side, + final RandomSource rand, + final ModelData extraData, + @Nullable final RenderType renderType) { + if (state == null || !(state.getBlock() instanceof DiskInterfaceBlock diskInterfaceBlock)) { + return super.getQuads(state, side, rand); + } + final BiDirection direction = diskInterfaceBlock.getDirection(state); + if (direction == null) { + return super.getQuads(state, side, rand); + } + final Disk[] disks = extraData.get(ForgeDiskInterfaceBlockEntity.DISKS_PROPERTY); + if (disks == null) { + return super.getQuads(state, side, rand); + } + final boolean active = state.getValue(AbstractActiveColoredDirectionalBlock.ACTIVE); + return cache.getUnchecked(new CacheKey(side, active, false, direction, disks)); + } + + private List getDiskQuads(final DiskModelBaker diskBakers, + final CacheKey cacheKey, + final Disk disk, + final int index) { + if (disk.state() == StorageState.NONE || disk.item() == null) { + return Collections.emptyList(); + } + final RotationTranslationModelBaker diskBaker = diskBakers.forDisk(disk.item()); + if (diskBaker == null) { + return Collections.emptyList(); + } + final Transformation diskTransform = TransformationBuilder.create() + .rotate(cacheKey.direction) + .translate(diskTranslations[index]) + .build(); + return diskBaker.bake(diskTransform, cacheKey.side, RandomSource.create()); + } + + private static Vector3f getDiskTranslation(final int i) { + final int x = i < 3 ? 0 : 1; + final int y = i % 3; + return new Vector3f( + x == 0 ? -(2F / 16F) : -(9F / 16F), + -((y * 3F) / 16F) - (6F / 16F), + 0 + ); + } + + private record CacheKey(@Nullable Direction side, + boolean active, + boolean withInactiveLed, + BiDirection direction, + Disk[] disks) { + CacheKey withSide(final Direction newSide) { + return new CacheKey(newSide, active, withInactiveLed, direction, disks); + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CacheKey cacheKey = (CacheKey) o; + return side == cacheKey.side && direction == cacheKey.direction && Arrays.equals(disks, cacheKey.disks) + && withInactiveLed == cacheKey.withInactiveLed && active == cacheKey.active; + } + + @Override + public int hashCode() { + int result = Objects.hash(side, active, direction, withInactiveLed); + result = 31 * result + Arrays.hashCode(disks); + return result; + } + + @Override + public String toString() { + return "CacheKey{" + + "side=" + side + + ", active=" + active + + ", withInactiveLed=" + withInactiveLed + + ", direction=" + direction + + ", disks=" + Arrays.toString(disks) + + '}'; + } + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java new file mode 100644 index 000000000..64faa7756 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java @@ -0,0 +1,18 @@ +package com.refinedmods.refinedstorage.neoforge.storage.diskinterface; + +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntityRenderer; +import com.refinedmods.refinedstorage.neoforge.support.render.RenderTypes; + +public class DiskInterfaceBlockEntityRendererImpl + extends AbstractDiskInterfaceBlockEntityRenderer { + public DiskInterfaceBlockEntityRendererImpl() { + super(RenderTypes.DISK_LED); + } + + @Override + protected Disk[] getDisks(final AbstractDiskInterfaceBlockEntity blockEntity) { + return blockEntity.getModelData().get(ForgeDiskInterfaceBlockEntity.DISKS_PROPERTY); + } +} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceGeometryLoader.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceGeometryLoader.java similarity index 89% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceGeometryLoader.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceGeometryLoader.java index 68166f5ea..ee3971486 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceGeometryLoader.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceGeometryLoader.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskinterface; +package com.refinedmods.refinedstorage.neoforge.storage.diskinterface; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceUnbakedGeometry.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceUnbakedGeometry.java similarity index 83% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceUnbakedGeometry.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceUnbakedGeometry.java index 4b06d115b..af3d01e45 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceUnbakedGeometry.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/DiskInterfaceUnbakedGeometry.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskinterface; +package com.refinedmods.refinedstorage.neoforge.storage.diskinterface; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.DiskModelBaker; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RotationTranslationModelBaker; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.neoforge.support.render.DiskModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.RotationTranslationModelBaker; import java.util.function.Function; @@ -18,7 +18,7 @@ import net.neoforged.neoforge.client.model.geometry.IGeometryBakingContext; import net.neoforged.neoforge.client.model.geometry.IUnbakedGeometry; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static java.util.Objects.requireNonNull; public class DiskInterfaceUnbakedGeometry implements IUnbakedGeometry { @@ -36,7 +36,7 @@ public void resolveParents(final Function modelG final IGeometryBakingContext context) { modelGetter.apply(baseModel).resolveParents(modelGetter); modelGetter.apply(INACTIVE_MODEL).resolveParents(modelGetter); - PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( diskModel -> modelGetter.apply(diskModel).resolveParents(modelGetter) ); modelGetter.apply(LED_INACTIVE_MODEL).resolveParents(modelGetter); diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/ForgeDiskInterfaceBlockEntity.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/ForgeDiskInterfaceBlockEntity.java similarity index 76% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/ForgeDiskInterfaceBlockEntity.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/ForgeDiskInterfaceBlockEntity.java index f5816313e..4a4a3d98d 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/ForgeDiskInterfaceBlockEntity.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/ForgeDiskInterfaceBlockEntity.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskinterface; +package com.refinedmods.refinedstorage.neoforge.storage.diskinterface; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; import javax.annotation.Nonnull; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/package-info.java new file mode 100644 index 000000000..4c1e08145 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/diskinterface/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.storage.diskinterface; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/FluidHandlerExternalStorageProvider.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/FluidHandlerExternalStorageProvider.java similarity index 78% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/FluidHandlerExternalStorageProvider.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/FluidHandlerExternalStorageProvider.java index c71d967bc..25ea802af 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/FluidHandlerExternalStorageProvider.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/FluidHandlerExternalStorageProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.externalstorage; +package com.refinedmods.refinedstorage.neoforge.storage.externalstorage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; @@ -7,10 +7,10 @@ import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCache; -import com.refinedmods.refinedstorage.platform.neoforge.storage.FluidHandlerExtractableStorage; -import com.refinedmods.refinedstorage.platform.neoforge.storage.FluidHandlerInsertableStorage; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCache; +import com.refinedmods.refinedstorage.neoforge.storage.FluidHandlerExtractableStorage; +import com.refinedmods.refinedstorage.neoforge.storage.FluidHandlerInsertableStorage; import java.util.Iterator; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java new file mode 100644 index 000000000..09fd6b077 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage.neoforge.storage.externalstorage; + +import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; +import com.refinedmods.refinedstorage.common.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCacheImpl; + +import java.util.Optional; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; + +public class FluidHandlerPlatformExternalStorageProviderFactory implements PlatformExternalStorageProviderFactory { + @Override + public Optional create(final ServerLevel level, + final BlockPos pos, + final Direction direction) { + return Optional.of(new FluidHandlerExternalStorageProvider(new CapabilityCacheImpl(level, pos, direction))); + } +} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/ItemHandlerExternalStorageProvider.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/ItemHandlerExternalStorageProvider.java similarity index 78% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/ItemHandlerExternalStorageProvider.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/ItemHandlerExternalStorageProvider.java index 8674dbbff..d02457605 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/ItemHandlerExternalStorageProvider.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/ItemHandlerExternalStorageProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.externalstorage; +package com.refinedmods.refinedstorage.neoforge.storage.externalstorage; import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; @@ -7,10 +7,10 @@ import com.refinedmods.refinedstorage.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCache; -import com.refinedmods.refinedstorage.platform.neoforge.storage.ItemHandlerExtractableStorage; -import com.refinedmods.refinedstorage.platform.neoforge.storage.ItemHandlerInsertableStorage; +import com.refinedmods.refinedstorage.common.api.support.network.AmountOverride; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCache; +import com.refinedmods.refinedstorage.neoforge.storage.ItemHandlerExtractableStorage; +import com.refinedmods.refinedstorage.neoforge.storage.ItemHandlerInsertableStorage; import java.util.Iterator; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java new file mode 100644 index 000000000..bd5ef8295 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage.neoforge.storage.externalstorage; + +import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; +import com.refinedmods.refinedstorage.common.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage.neoforge.storage.CapabilityCacheImpl; + +import java.util.Optional; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; + +public class ItemHandlerPlatformExternalStorageProviderFactory implements PlatformExternalStorageProviderFactory { + @Override + public Optional create(final ServerLevel level, + final BlockPos pos, + final Direction direction) { + return Optional.of(new ItemHandlerExternalStorageProvider(new CapabilityCacheImpl(level, pos, direction))); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/package-info.java new file mode 100644 index 000000000..7c166786e --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/externalstorage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.storage.externalstorage; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/package-info.java new file mode 100644 index 000000000..162536a13 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.storage; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/DiskLedBakers.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/DiskLedBakers.java similarity index 76% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/DiskLedBakers.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/DiskLedBakers.java index f81ce7e0d..47bfdb4c2 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/DiskLedBakers.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/DiskLedBakers.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid; +package com.refinedmods.refinedstorage.neoforge.storage.portablegrid; import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RotationTranslationModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.RotationTranslationModelBaker; record DiskLedBakers( RotationTranslationModelBaker inactiveBaker, diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/ForgePortableGridBlockEntity.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/ForgePortableGridBlockEntity.java new file mode 100644 index 000000000..2c197d74f --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/ForgePortableGridBlockEntity.java @@ -0,0 +1,32 @@ +package com.refinedmods.refinedstorage.neoforge.storage.portablegrid; + +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.portablegrid.AbstractPortableGridBlockEntity; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridType; + +import javax.annotation.Nonnull; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.client.model.data.ModelData; +import net.neoforged.neoforge.client.model.data.ModelProperty; + +public class ForgePortableGridBlockEntity extends AbstractPortableGridBlockEntity { + public static final ModelProperty DISK_PROPERTY = new ModelProperty<>(); + + public ForgePortableGridBlockEntity(final PortableGridType type, final BlockPos pos, final BlockState state) { + super(type, pos, state); + } + + @Override + protected void onClientDriveStateUpdated() { + requestModelDataUpdate(); + super.onClientDriveStateUpdated(); + } + + @Nonnull + @Override + public ModelData getModelData() { + return ModelData.builder().with(DISK_PROPERTY, disk).build(); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridBakedModel.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridBakedModel.java new file mode 100644 index 000000000..7c5f2dc58 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridBakedModel.java @@ -0,0 +1,140 @@ +package com.refinedmods.refinedstorage.neoforge.storage.portablegrid; + +import com.refinedmods.refinedstorage.api.storage.StorageState; +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlock; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockItem; +import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockItemRenderInfo; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.neoforge.support.render.DiskModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.ItemBakedModel; +import com.refinedmods.refinedstorage.neoforge.support.render.RotationTranslationModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.TransformationBuilder; + +import java.util.Collections; +import java.util.List; +import javax.annotation.Nullable; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.ItemOverrides; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.client.model.BakedModelWrapper; +import net.neoforged.neoforge.client.model.data.ModelData; +import org.joml.Vector3f; + +class PortableGridBakedModel extends BakedModelWrapper { + private static final Vector3f MOVE_TO_DISK_LOCATION = new Vector3f(0, -12 / 16F, 9 / 16F); + private static final Vector3f MOVE_TO_DISK_LED_LOCATION = new Vector3f(0, -12 / 16F, 9 / 16F); + + private final LoadingCache> cache; + private final PortableGridItemOverrides itemOverrides = new PortableGridItemOverrides(); + + PortableGridBakedModel(final BakedModel baseModel, + final RotationTranslationModelBaker activeModelBaker, + final RotationTranslationModelBaker inactiveModelBaker, + final DiskModelBaker diskModelBaker, + final DiskLedBakers diskLedBakers) { + super(baseModel); + this.cache = CacheBuilder.newBuilder().build(CacheLoader.from(cacheKey -> { + final RotationTranslationModelBaker baseModelBaker = cacheKey.active + ? activeModelBaker + : inactiveModelBaker; + final List quads = baseModelBaker.bake( + TransformationBuilder.create().rotate(cacheKey.direction).build(), + cacheKey.side(), + RandomSource.create() + ); + if (cacheKey.disk.item() == null) { + return quads; + } + final RotationTranslationModelBaker diskBaker = diskModelBaker.forDisk(cacheKey.disk.item()); + if (diskBaker != null) { + quads.addAll(diskBaker.bake(TransformationBuilder.create() + .rotate(cacheKey.direction) + .translate(MOVE_TO_DISK_LOCATION) + .rotate(BiDirection.WEST) + .build(), cacheKey.side(), RandomSource.create())); + } + if (cacheKey.includeLed && cacheKey.disk.state() != StorageState.NONE) { + quads.addAll(diskLedBakers.forState(cacheKey.disk.state()).bake(TransformationBuilder.create() + .translate(MOVE_TO_DISK_LED_LOCATION) + .rotate(BiDirection.WEST) + .build(), cacheKey.side(), RandomSource.create())); + } + return quads; + })); + } + + @Override + public List getQuads(@Nullable final BlockState state, + @Nullable final Direction side, + final RandomSource randomSource, + final ModelData extraData, + @Nullable final RenderType renderType) { + if (state == null || !(state.getBlock() instanceof PortableGridBlock portableGridBlock)) { + return super.getQuads(state, side, randomSource); + } + final BiDirection direction = portableGridBlock.getDirection(state); + if (direction == null) { + return super.getQuads(state, side, randomSource); + } + final Disk disk = extraData.get(ForgePortableGridBlockEntity.DISK_PROPERTY); + if (disk == null) { + return super.getQuads(state, side, randomSource); + } + final boolean active = state.getValue(PortableGridBlock.ACTIVE); + return cache.getUnchecked(new CacheKey(side, direction, active, disk, false)); + } + + @Override + public ItemOverrides getOverrides() { + return itemOverrides; + } + + private class PortableGridItemOverrides extends ItemOverrides { + private final LoadingCache itemCache = CacheBuilder.newBuilder().build( + CacheLoader.from(cacheKey -> new ItemBakedModel( + originalModel, + cache.getUnchecked(cacheKey), + Collections.emptyMap() + )) + ); + + @Override + @Nullable + public BakedModel resolve(final BakedModel bakedModel, + final ItemStack stack, + @Nullable final ClientLevel level, + @Nullable final LivingEntity entity, + final int seed) { + if (level == null) { + return null; + } + final PortableGridBlockItemRenderInfo renderInfo = PortableGridBlockItem.getRenderInfo(stack, level); + return itemCache.getUnchecked(new CacheKey( + null, + BiDirection.NORTH, + renderInfo.active(), + renderInfo.disk(), + true + )); + } + } + + private record CacheKey(@Nullable Direction side, + BiDirection direction, + boolean active, + Disk disk, + boolean includeLed) { + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridBlockEntityRendererImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridBlockEntityRendererImpl.java new file mode 100644 index 000000000..d14695eb1 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridBlockEntityRendererImpl.java @@ -0,0 +1,21 @@ +package com.refinedmods.refinedstorage.neoforge.storage.portablegrid; + +import com.refinedmods.refinedstorage.common.storage.Disk; +import com.refinedmods.refinedstorage.common.storage.portablegrid.AbstractPortableGridBlockEntity; +import com.refinedmods.refinedstorage.common.storage.portablegrid.AbstractPortableGridBlockEntityRenderer; +import com.refinedmods.refinedstorage.neoforge.support.render.RenderTypes; + +import javax.annotation.Nullable; + +public class PortableGridBlockEntityRendererImpl + extends AbstractPortableGridBlockEntityRenderer { + public PortableGridBlockEntityRendererImpl() { + super(RenderTypes.DISK_LED); + } + + @Override + @Nullable + protected Disk getDisk(final T blockEntity) { + return blockEntity.getModelData().get(ForgePortableGridBlockEntity.DISK_PROPERTY); + } +} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridGeometryLoader.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridGeometryLoader.java similarity index 86% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridGeometryLoader.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridGeometryLoader.java index 02ff78940..f49e6deb8 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridGeometryLoader.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridGeometryLoader.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid; +package com.refinedmods.refinedstorage.neoforge.storage.portablegrid; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridUnbakedGeometry.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridUnbakedGeometry.java similarity index 86% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridUnbakedGeometry.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridUnbakedGeometry.java index 06a7cf02e..38531d03e 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridUnbakedGeometry.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/PortableGridUnbakedGeometry.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid; +package com.refinedmods.refinedstorage.neoforge.storage.portablegrid; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.DiskModelBaker; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RotationTranslationModelBaker; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.neoforge.support.render.DiskModelBaker; +import com.refinedmods.refinedstorage.neoforge.support.render.RotationTranslationModelBaker; import java.util.function.Function; @@ -17,7 +17,7 @@ import net.neoforged.neoforge.client.model.geometry.IGeometryBakingContext; import net.neoforged.neoforge.client.model.geometry.IUnbakedGeometry; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static java.util.Objects.requireNonNull; public class PortableGridUnbakedGeometry implements IUnbakedGeometry { @@ -40,7 +40,7 @@ public void resolveParents(final Function modelG modelGetter.apply(NORMAL_LED_MODEL).resolveParents(modelGetter); modelGetter.apply(NEAR_CAPACITY_LED_MODEL).resolveParents(modelGetter); modelGetter.apply(FULL_LED_MODEL).resolveParents(modelGetter); - PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( + RefinedStorageApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach( diskModel -> modelGetter.apply(diskModel).resolveParents(modelGetter) ); } diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/package-info.java new file mode 100644 index 000000000..a938cd036 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/storage/portablegrid/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.storage.portablegrid; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/containermenu/ContainerTransferDestination.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/containermenu/ContainerTransferDestination.java new file mode 100644 index 000000000..59fbf97e1 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/containermenu/ContainerTransferDestination.java @@ -0,0 +1,16 @@ +package com.refinedmods.refinedstorage.neoforge.support.containermenu; + +import com.refinedmods.refinedstorage.common.support.containermenu.TransferDestination; + +import net.minecraft.world.Container; +import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.wrapper.InvWrapper; + +public record ContainerTransferDestination(Container destination) implements TransferDestination { + @Override + public ItemStack transfer(final ItemStack stack) { + final InvWrapper destinationInv = new InvWrapper(destination); + return ItemHandlerHelper.insertItem(destinationInv, stack, false); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/containermenu/MenuOpenerImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/containermenu/MenuOpenerImpl.java new file mode 100644 index 000000000..88ee111ad --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/containermenu/MenuOpenerImpl.java @@ -0,0 +1,26 @@ +package com.refinedmods.refinedstorage.neoforge.support.containermenu; + +import com.refinedmods.refinedstorage.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.containermenu.MenuOpener; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.MenuProvider; + +public class MenuOpenerImpl implements MenuOpener { + @Override + public void openMenu(final ServerPlayer player, final MenuProvider menuProvider) { + if (menuProvider instanceof ExtendedMenuProvider extendedMenuProvider) { + openExtendedMenu(player, extendedMenuProvider); + } else { + player.openMenu(menuProvider); + } + } + + private static void openExtendedMenu(final ServerPlayer player, + final ExtendedMenuProvider extendedMenuProvider) { + player.openMenu( + extendedMenuProvider, + buf -> extendedMenuProvider.getMenuCodec().encode(buf, extendedMenuProvider.getMenuData()) + ); + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/containermenu/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/containermenu/package-info.java new file mode 100644 index 000000000..7aa7c1786 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/containermenu/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.support.containermenu; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/energy/EnergyStorageAdapter.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/energy/EnergyStorageAdapter.java new file mode 100644 index 000000000..7674732c0 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/energy/EnergyStorageAdapter.java @@ -0,0 +1,38 @@ +package com.refinedmods.refinedstorage.neoforge.support.energy; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; + +import net.neoforged.neoforge.energy.IEnergyStorage; + +public record EnergyStorageAdapter(EnergyStorage energyStorage) implements IEnergyStorage { + @Override + public int receiveEnergy(final int maxReceive, final boolean simulate) { + return (int) energyStorage.receive(maxReceive, simulate ? Action.SIMULATE : Action.EXECUTE); + } + + @Override + public int extractEnergy(final int maxExtract, final boolean simulate) { + return (int) energyStorage.extract(maxExtract, simulate ? Action.SIMULATE : Action.EXECUTE); + } + + @Override + public int getEnergyStored() { + return (int) energyStorage.getStored(); + } + + @Override + public int getMaxEnergyStored() { + return (int) energyStorage.getCapacity(); + } + + @Override + public boolean canExtract() { + return false; + } + + @Override + public boolean canReceive() { + return true; + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/energy/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/energy/package-info.java new file mode 100644 index 000000000..8117d6938 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/energy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.support.energy; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/inventory/InsertExtractItemHandler.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/inventory/InsertExtractItemHandler.java similarity index 96% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/inventory/InsertExtractItemHandler.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/inventory/InsertExtractItemHandler.java index 01b87a8fe..f30569600 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/inventory/InsertExtractItemHandler.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/inventory/InsertExtractItemHandler.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.inventory; +package com.refinedmods.refinedstorage.neoforge.support.inventory; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.items.IItemHandler; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/inventory/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/inventory/package-info.java new file mode 100644 index 000000000..50726584c --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/inventory/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.support.inventory; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/DiskModelBaker.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/DiskModelBaker.java similarity index 83% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/DiskModelBaker.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/DiskModelBaker.java index a9c1031e4..6f7a5afad 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/DiskModelBaker.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/DiskModelBaker.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.render; +package com.refinedmods.refinedstorage.neoforge.support.render; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import java.util.Map; import java.util.function.Function; @@ -19,7 +19,7 @@ public class DiskModelBaker { public DiskModelBaker(final ModelState state, final ModelBaker baker, final Function spriteGetter) { - this.bakers = PlatformApi.INSTANCE.getStorageContainerItemHelper() + this.bakers = RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() .getDiskModelsByItem() .entrySet() .stream() diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/FluidStackFluidRenderer.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/FluidStackFluidRenderer.java similarity index 92% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/FluidStackFluidRenderer.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/FluidStackFluidRenderer.java index 13d440be1..b7e071ba9 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/FluidStackFluidRenderer.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/FluidStackFluidRenderer.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.render; +package com.refinedmods.refinedstorage.neoforge.support.render; -import com.refinedmods.refinedstorage.platform.common.support.render.AbstractFluidRenderer; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.render.AbstractFluidRenderer; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.Collections; import java.util.HashMap; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/ItemBakedModel.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/ItemBakedModel.java similarity index 96% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/ItemBakedModel.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/ItemBakedModel.java index cf0486995..2c573f918 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/ItemBakedModel.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/ItemBakedModel.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.render; +package com.refinedmods.refinedstorage.neoforge.support.render; import java.util.Collections; import java.util.List; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/RenderTypes.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/RenderTypes.java new file mode 100644 index 000000000..4b8694c6c --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/RenderTypes.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage.neoforge.support.render; + +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import com.mojang.blaze3d.vertex.VertexFormat; +import net.minecraft.client.renderer.GameRenderer; +import net.minecraft.client.renderer.RenderStateShard; +import net.minecraft.client.renderer.RenderType; + +public final class RenderTypes { + public static final RenderType DISK_LED = RenderType.create( + "disk_led", + DefaultVertexFormat.POSITION_COLOR, + VertexFormat.Mode.QUADS, + 32565, + false, + true, + RenderType.CompositeState.builder() + .setShaderState(new RenderStateShard.ShaderStateShard(GameRenderer::getPositionColorShader)) + .createCompositeState(false) + ); + + private RenderTypes() { + } +} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RotationTranslationModelBaker.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/RotationTranslationModelBaker.java similarity index 87% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RotationTranslationModelBaker.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/RotationTranslationModelBaker.java index ace1123b3..36ecb03e7 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RotationTranslationModelBaker.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/RotationTranslationModelBaker.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.render; +package com.refinedmods.refinedstorage.neoforge.support.render; import java.util.ArrayList; import java.util.List; @@ -20,16 +20,16 @@ public class RotationTranslationModelBaker { private final ModelState state; private final ModelBaker baker; - private final Function spriterGetter; + private final Function spriteGetter; private final ResourceLocation model; public RotationTranslationModelBaker(final ModelState state, final ModelBaker baker, - final Function spriterGetter, + final Function spriteGetter, final ResourceLocation model) { this.state = state; this.baker = baker; - this.spriterGetter = spriterGetter; + this.spriteGetter = spriteGetter; this.model = model; } @@ -38,7 +38,7 @@ public List bake(final Transformation transformation, @Nullable final Direction side, final RandomSource rand) { final ModelState wrappedState = new SimpleModelState(transformation, state.isUvLocked()); - final BakedModel bakedModel = baker.bake(model, wrappedState, spriterGetter); + final BakedModel bakedModel = baker.bake(model, wrappedState, spriteGetter); if (bakedModel == null) { return new ArrayList<>(); } diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/TransformationBuilder.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/TransformationBuilder.java similarity index 86% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/TransformationBuilder.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/TransformationBuilder.java index 9837ea16d..c2911785d 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/TransformationBuilder.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/TransformationBuilder.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.render; +package com.refinedmods.refinedstorage.neoforge.support.render; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage.common.support.direction.BiDirection; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/package-info.java new file mode 100644 index 000000000..b9967b2ce --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/render/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.support.render; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/resource/ResourceContainerFluidHandlerAdapter.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/resource/ResourceContainerFluidHandlerAdapter.java similarity index 81% rename from refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/resource/ResourceContainerFluidHandlerAdapter.java rename to refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/resource/ResourceContainerFluidHandlerAdapter.java index dd3e857b6..d14f2cbd7 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/resource/ResourceContainerFluidHandlerAdapter.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/resource/ResourceContainerFluidHandlerAdapter.java @@ -1,19 +1,19 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.resource; +package com.refinedmods.refinedstorage.neoforge.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; import javax.annotation.Nullable; import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.capability.IFluidHandler; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.ofFluidStack; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toAction; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.ofFluidStack; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toAction; +import static com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil.toFluidStack; public class ResourceContainerFluidHandlerAdapter implements IFluidHandler { private final ResourceContainer container; diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/resource/VariantUtil.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/resource/VariantUtil.java new file mode 100644 index 000000000..cc45eb941 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/resource/VariantUtil.java @@ -0,0 +1,49 @@ +package com.refinedmods.refinedstorage.neoforge.support.resource; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; + +import java.util.Objects; + +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public final class VariantUtil { + private static final Logger LOGGER = LoggerFactory.getLogger(VariantUtil.class); + + private VariantUtil() { + } + + public static boolean isSame(final FluidResource resource, final FluidStack stack) { + return resource.fluid() == stack.getFluid() && Objects.equals( + resource.components(), + stack.getComponents().asPatch() + ); + } + + public static FluidResource ofFluidStack(final FluidStack fluidStack) { + return new FluidResource(fluidStack.getFluid(), fluidStack.getComponents().asPatch()); + } + + @SuppressWarnings("deprecation") + public static FluidStack toFluidStack(final FluidResource fluidResource, final long amount) { + if (amount > Integer.MAX_VALUE) { + LOGGER.warn("Truncating too large amount for {} to fit into FluidStack {}", fluidResource, amount); + } + return new FluidStack( + fluidResource.fluid().builtInRegistryHolder(), + (int) amount, + fluidResource.components() + ); + } + + public static Action toAction(final IFluidHandler.FluidAction action) { + return action == IFluidHandler.FluidAction.SIMULATE ? Action.SIMULATE : Action.EXECUTE; + } + + public static IFluidHandler.FluidAction toFluidAction(final Action action) { + return action == Action.SIMULATE ? IFluidHandler.FluidAction.SIMULATE : IFluidHandler.FluidAction.EXECUTE; + } +} diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/resource/package-info.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/resource/package-info.java new file mode 100644 index 000000000..8dcdd6709 --- /dev/null +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/support/resource/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.neoforge.support.resource; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/resources/META-INF/accesstransformer.cfg b/refinedstorage-neoforge/src/main/resources/META-INF/accesstransformer.cfg similarity index 100% rename from refinedstorage-platform-neoforge/src/main/resources/META-INF/accesstransformer.cfg rename to refinedstorage-neoforge/src/main/resources/META-INF/accesstransformer.cfg diff --git a/refinedstorage-platform-neoforge/src/main/resources/META-INF/neoforge.mods.toml b/refinedstorage-neoforge/src/main/resources/META-INF/neoforge.mods.toml similarity index 79% rename from refinedstorage-platform-neoforge/src/main/resources/META-INF/neoforge.mods.toml rename to refinedstorage-neoforge/src/main/resources/META-INF/neoforge.mods.toml index 1148ab8a3..296fa69fb 100644 --- a/refinedstorage-platform-neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/refinedstorage-neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -12,3 +12,9 @@ authors = "Refined Mods" description = ''' Refined Storage is a mass storage mod for Minecraft that offers the player a network-based storage system, allowing them to store items and fluids on a massively expandable device network. ''' +[[dependencies.refinedstorage]] +modId = "neoforge" +type = "required" +versionRange = "[21.0.112-beta,)" +ordering = "NONE" +side = "BOTH" diff --git a/refinedstorage-platform-neoforge/src/main/resources/icon.png b/refinedstorage-neoforge/src/main/resources/icon.png similarity index 100% rename from refinedstorage-platform-neoforge/src/main/resources/icon.png rename to refinedstorage-neoforge/src/main/resources/icon.png diff --git a/refinedstorage-platform-neoforge/src/main/resources/pack.mcmeta b/refinedstorage-neoforge/src/main/resources/pack.mcmeta similarity index 100% rename from refinedstorage-platform-neoforge/src/main/resources/pack.mcmeta rename to refinedstorage-neoforge/src/main/resources/pack.mcmeta diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/GameTestUtil.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/GameTestUtil.java new file mode 100644 index 000000000..fee7f5328 --- /dev/null +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/GameTestUtil.java @@ -0,0 +1,261 @@ +package com.refinedmods.refinedstorage.common; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.node.NetworkNode; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.EmptyActor; +import com.refinedmods.refinedstorage.common.api.support.network.AbstractNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.common.content.Blocks; +import com.refinedmods.refinedstorage.common.content.Items; +import com.refinedmods.refinedstorage.common.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.function.Consumer; +import java.util.stream.IntStream; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.gametest.framework.GameTestAssertException; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.material.Fluid; +import net.minecraft.world.level.material.FluidState; +import net.minecraft.world.phys.AABB; + +public final class GameTestUtil { + public static final Blocks RSBLOCKS = Blocks.INSTANCE; + public static final Items RSITEMS = Items.INSTANCE; + + private GameTestUtil() { + } + + @Nullable + private static Network getNetwork(final GameTestHelper helper, final BlockPos pos) { + try { + final var be = requireBlockEntity(helper, pos, AbstractNetworkNodeContainerBlockEntity.class); + final var field = AbstractNetworkNodeContainerBlockEntity.class.getDeclaredField("mainNetworkNode"); + field.setAccessible(true); + final NetworkNode mainNode = (NetworkNode) field.get(be); + return mainNode.getNetwork(); + } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException e) { + throw new RuntimeException(e); + } + } + + public static Runnable networkIsAvailable(final GameTestHelper helper, + final BlockPos networkPos, + final Consumer networkConsumer) { + return () -> { + final Network network = getNetwork(helper, networkPos); + helper.assertTrue(network != null, "Network is not available"); + networkConsumer.accept(network); + }; + } + + public static void insert(final GameTestHelper helper, + final Network network, + final Item resource, + final long amount) { + insert(helper, network, new ItemResource(resource), amount); + } + + public static void insert(final GameTestHelper helper, + final Network network, + final Fluid resource, + final long amount) { + insert(helper, network, new FluidResource(resource), amount); + } + + public static void insert(final GameTestHelper helper, + final Network network, + final ResourceKey resource, + final long amount) { + final StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); + final long inserted = storage.insert(resource, amount, Action.EXECUTE, EmptyActor.INSTANCE); + helper.assertTrue(inserted == amount, "Resource couldn't be inserted"); + } + + @SuppressWarnings("unchecked") + public static T requireBlockEntity( + final GameTestHelper helper, + final BlockPos pos, + final Class clazz + ) { + final BlockEntity blockEntity = helper.getBlockEntity(pos); + if (!clazz.isInstance(blockEntity)) { + throw new GameTestAssertException( + "Expected block entity of type " + clazz + " but was " + blockEntity.getClass() + ); + } + return (T) blockEntity; + } + + public static void assertFluidPresent(final GameTestHelper helper, + final BlockPos pos, + final Fluid fluid, + final int level) { + final FluidState fluidState = helper.getLevel().getFluidState(helper.absolutePos(pos)); + helper.assertTrue( + fluidState.getType() == fluid && fluidState.getAmount() == level, + "Unexpected " + fluidState.getType() + ", " + fluidState.getAmount() + ); + } + + public static void assertItemEntityPresentExactly(final GameTestHelper helper, + final ItemStack itemStack, + final BlockPos pos, + final double expansionAmount) { + final BlockPos blockpos = helper.absolutePos(pos); + final Iterator entityIterator = helper.getLevel().getEntities(EntityType.ITEM, + (new AABB(blockpos)).inflate(expansionAmount), Entity::isAlive).iterator(); + + ItemEntity itemEntity; + do { + if (!entityIterator.hasNext()) { + throw new GameTestAssertException("Expected " + itemStack.getItem().getDescription().getString() + + " item at: " + blockpos + " with count: " + itemStack.getCount()); + } + + itemEntity = entityIterator.next(); + } while (!itemEntity.getItem().getItem().equals(itemStack.getItem()) + || itemEntity.getItem().getCount() != itemStack.getCount()); + } + + public static Runnable assertInterfaceEmpty(final GameTestHelper helper, + final BlockPos pos) { + final var interfaceBlockEntity = requireBlockEntity(helper, pos, InterfaceBlockEntity.class); + + return assertResourceContainerEmpty(interfaceBlockEntity.getDisplayName(), + interfaceBlockEntity.getExportedResources()); + } + + private static Runnable assertResourceContainerEmpty(final Component displayName, + final ResourceContainer container) { + return () -> { + for (int i = 0; i < container.size(); i++) { + if (!container.isEmpty(i)) { + throw new GameTestAssertException(displayName.getString() + " should be empty"); + } + } + }; + } + + public static Runnable interfaceContainsExactly(final GameTestHelper helper, + final BlockPos pos, + final ResourceAmount... expected) { + final var interfaceBlockEntity = requireBlockEntity(helper, pos, InterfaceBlockEntity.class); + + return resourceContainerContainsExactly(helper, interfaceBlockEntity.getDisplayName(), + interfaceBlockEntity.getExportedResources(), expected); + } + + private static Runnable resourceContainerContainsExactly(final GameTestHelper helper, + final Component displayName, + final ResourceContainer container, + final ResourceAmount... expected) { + return () -> { + // TODO: This does not take duplicate ResourceAmount into account + for (final ResourceAmount expectedStack : expected) { + final boolean contains = IntStream.range(0, container.size()) + .mapToObj(container::get) + .anyMatch(resource -> resource != null + && resource.getResource().equals(expectedStack.getResource()) + && resource.getAmount() == expectedStack.getAmount()); + + helper.assertTrue(contains, "Expected resource is missing from " + displayName.getString() + ": " + + expectedStack + " with count: " + expectedStack.getAmount()); + } + + for (int i = 0; i < container.size(); i++) { + final ResourceAmount resource = container.get(i); + if (resource != null) { + final boolean wasExpected = Arrays.stream(expected).anyMatch( + expectedResource -> expectedResource.getResource().equals(resource.getResource()) + && expectedResource.getAmount() == resource.getAmount() + ); + + helper.assertTrue(wasExpected, "Unexpected resource found in " + displayName.getString() + ": " + + resource.getResource() + " with count: " + resource.getAmount()); + } + } + }; + } + + public static Runnable containerContainsExactly(final GameTestHelper helper, + final BlockPos pos, + final ResourceAmount... expected) { + final var containerBlockEntity = requireBlockEntity(helper, pos, BaseContainerBlockEntity.class); + + return () -> { + // TODO: This does not take duplicate ResourceAmount into account + for (final ResourceAmount expectedStack : expected) { + final boolean contains = IntStream.range(0, containerBlockEntity.getContainerSize()) + .mapToObj(containerBlockEntity::getItem) + .anyMatch(inContainer -> asResource(inContainer).equals(expectedStack.getResource()) + && inContainer.getCount() == expectedStack.getAmount()); + helper.assertTrue(contains, "Expected resource is missing from container: " + + expectedStack + " with count: " + expectedStack.getAmount()); + } + for (int i = 0; i < containerBlockEntity.getContainerSize(); i++) { + final ItemStack inContainer = containerBlockEntity.getItem(i); + + if (!inContainer.isEmpty()) { + final boolean wasExpected = Arrays.stream(expected).anyMatch( + expectedStack -> expectedStack.getResource().equals(asResource(inContainer)) + && expectedStack.getAmount() == inContainer.getCount() + ); + helper.assertTrue(wasExpected, "Unexpected resource found in container: " + + inContainer.getDescriptionId() + " with count: " + inContainer.getCount()); + } + } + }; + } + + public static Runnable storageContainsExactly(final GameTestHelper helper, + final BlockPos networkPos, + final ResourceAmount... expected) { + return networkIsAvailable(helper, networkPos, network -> { + final StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); + for (final ResourceAmount expectedResource : expected) { + final boolean contains = storage.getAll() + .stream() + .anyMatch(inStorage -> inStorage.getResource().equals(expectedResource.getResource()) + && inStorage.getAmount() == expectedResource.getAmount()); + helper.assertTrue(contains, "Expected resource is missing from storage: " + expectedResource); + } + for (final ResourceAmount inStorage : storage.getAll()) { + final boolean wasExpected = Arrays.stream(expected).anyMatch( + expectedResource -> expectedResource.getResource().equals(inStorage.getResource()) + && expectedResource.getAmount() == inStorage.getAmount() + ); + helper.assertTrue(wasExpected, "Unexpected resource found in storage: " + inStorage); + } + }); + } + + public static ItemResource asResource(final Item item) { + return new ItemResource(item); + } + + public static ItemResource asResource(final ItemStack itemStack) { + return ItemResource.ofItemStack(itemStack); + } + + public static FluidResource asResource(final Fluid fluid) { + return new FluidResource(fluid); + } +} diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorTest.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorTest.java new file mode 100644 index 000000000..f726490b7 --- /dev/null +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorTest.java @@ -0,0 +1,185 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; + +import java.util.List; + +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTest; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.material.FluidState; +import net.neoforged.neoforge.gametest.GameTestHolder; +import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; + +import static com.refinedmods.refinedstorage.common.GameTestUtil.RSITEMS; +import static com.refinedmods.refinedstorage.common.GameTestUtil.asResource; +import static com.refinedmods.refinedstorage.common.GameTestUtil.assertFluidPresent; +import static com.refinedmods.refinedstorage.common.GameTestUtil.assertItemEntityPresentExactly; +import static com.refinedmods.refinedstorage.common.GameTestUtil.insert; +import static com.refinedmods.refinedstorage.common.GameTestUtil.networkIsAvailable; +import static com.refinedmods.refinedstorage.common.GameTestUtil.storageContainsExactly; +import static net.minecraft.world.item.Items.DIRT; +import static net.minecraft.world.item.Items.FIREWORK_ROCKET; +import static net.minecraft.world.item.Items.STONE; +import static net.minecraft.world.level.material.Fluids.WATER; + +@GameTestHolder(IdentifierUtil.MOD_ID) +@PrefixGameTestTemplate(false) +public final class ConstructorTest { + private ConstructorTest() { + } + + @GameTest(template = "empty_15x15") + public static void shouldPlaceBlock(final GameTestHelper helper) { + ConstructorTestPlots.preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + constructor.setFilters(List.of(asResource(DIRT))); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.DIRT, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 9), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldPlaceWater(final GameTestHelper helper) { + ConstructorTestPlots.preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + insert(helper, network, WATER, Platform.INSTANCE.getBucketAmount() * 2); + })); + + // Act + constructor.setFilters(List.of(asResource(WATER))); + + // Assert + sequence + .thenWaitUntil(() -> assertFluidPresent(helper, pos.east(), WATER, FluidState.AMOUNT_FULL)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldDropItem(final GameTestHelper helper) { + ConstructorTestPlots.preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + constructor.setDropItems(true); + constructor.setFilters(List.of(asResource(DIRT))); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) + .thenWaitUntil(() -> assertItemEntityPresentExactly( + helper, + DIRT.getDefaultInstance().copyWithCount(1), + pos.east(), + 1 + )) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 9), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldDropItemWithStackUpgrade(final GameTestHelper helper) { + ConstructorTestPlots.preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 65); + insert(helper, network, STONE, 15); + })); + + // Act + constructor.setDropItems(true); + constructor.setFilters(List.of(asResource(DIRT))); + constructor.addUpgradeItem(RSITEMS.getStackUpgrade()); + + // Assert + sequence + .thenIdle(9) + .thenExecute(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) + .thenExecute(() -> assertItemEntityPresentExactly( + helper, + DIRT.getDefaultInstance().copyWithCount(64), + pos.east(), + 1 + )) + .thenExecute(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 1), + new ResourceAmount(asResource(STONE), 15) + )) + .thenIdle(9) + .thenExecute(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldPlaceFireworks(final GameTestHelper helper) { + ConstructorTestPlots.preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, FIREWORK_ROCKET, 15); + })); + + // Act + constructor.setFilters(List.of(asResource(FIREWORK_ROCKET))); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.AIR, pos.east())) + .thenWaitUntil(() -> helper.assertEntityPresent(EntityType.FIREWORK_ROCKET, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(FIREWORK_ROCKET), 14) + )) + .thenSucceed(); + }); + } +} diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorTestPlots.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorTestPlots.java new file mode 100644 index 000000000..6dffb40cd --- /dev/null +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorTestPlots.java @@ -0,0 +1,37 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.gametest.framework.GameTestSequence; +import org.apache.commons.lang3.function.TriConsumer; + +import static com.refinedmods.refinedstorage.common.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage.common.GameTestUtil.requireBlockEntity; +import static net.minecraft.core.BlockPos.ZERO; + +final class ConstructorTestPlots { + private ConstructorTestPlots() { + } + + static void preparePlot(final GameTestHelper helper, + final Direction direction, + final TriConsumer consumer) { + helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); + helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageVariant.ONE_K)); + helper.setBlock( + ZERO.above().above().north(), + RSBLOCKS.getFluidStorageBlock(FluidStorageVariant.SIXTY_FOUR_B) + ); + final BlockPos constructorPos = ZERO.above().above().above(); + helper.setBlock(constructorPos, RSBLOCKS.getConstructor().getDefault().rotated(direction)); + consumer.accept( + requireBlockEntity(helper, constructorPos, ConstructorBlockEntity.class), + constructorPos, + helper.startSequence() + ); + } +} diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorTest.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorTest.java new file mode 100644 index 000000000..97420b47f --- /dev/null +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorTest.java @@ -0,0 +1,246 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; + +import java.util.Set; + +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTest; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.level.block.Blocks; +import net.neoforged.neoforge.gametest.GameTestHolder; +import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; + +import static com.refinedmods.refinedstorage.common.GameTestUtil.asResource; +import static com.refinedmods.refinedstorage.common.GameTestUtil.insert; +import static com.refinedmods.refinedstorage.common.GameTestUtil.networkIsAvailable; +import static com.refinedmods.refinedstorage.common.GameTestUtil.storageContainsExactly; +import static net.minecraft.world.item.Items.DIRT; +import static net.minecraft.world.item.Items.STONE; +import static net.minecraft.world.level.material.Fluids.LAVA; +import static net.minecraft.world.level.material.Fluids.WATER; + +@GameTestHolder(IdentifierUtil.MOD_ID) +@PrefixGameTestTemplate(false) +public final class DestructorTest { + private DestructorTest() { + } + + @GameTest(template = "empty_15x15") + public static void shouldBreakBlock(final GameTestHelper helper) { + DestructorTestPlots.preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + helper.setBlock(pos.east(), Blocks.DIRT); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldBreakBlockAllowlist(final GameTestHelper helper) { + DestructorTestPlots.preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.ALLOW); + destructor.setFilters(Set.of(asResource(DIRT))); + + helper.setBlock(pos.east(), Blocks.DIRT); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) + .thenExecute(() -> helper.setBlock(pos.east(), Blocks.STONE)) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.STONE, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldBreakBlockBlocklist(final GameTestHelper helper) { + DestructorTestPlots.preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.BLOCK); + destructor.setFilters(Set.of(asResource(STONE))); + + helper.setBlock(pos.east(), Blocks.DIRT); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) + .thenExecute(() -> helper.setBlock(pos.east(), Blocks.STONE)) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.STONE, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldPickupItemAllowlist(final GameTestHelper helper) { + DestructorTestPlots.preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.ALLOW); + destructor.setPickupItems(true); + destructor.setFilters(Set.of(asResource(DIRT))); + + helper.spawnItem(DIRT, pos.east()); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertItemEntityNotPresent(DIRT, pos.east(), 1)) + .thenExecute(() -> helper.spawnItem(STONE, pos.east())) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertItemEntityPresent(STONE, pos.east(), 1)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldPickupItemBlocklist(final GameTestHelper helper) { + DestructorTestPlots.preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.BLOCK); + destructor.setPickupItems(true); + destructor.setFilters(Set.of(asResource(STONE))); + + helper.spawnItem(DIRT, pos.east()); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertItemEntityNotPresent(DIRT, pos.east(), 1)) + .thenExecute(() -> helper.spawnItem(STONE, pos.east())) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertItemEntityPresent(STONE, pos.east(), 1)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldDrainFluidAllowlist(final GameTestHelper helper) { + DestructorTestPlots.preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.ALLOW); + destructor.setFilters(Set.of(asResource(WATER))); + + helper.setBlock(pos.east(), Blocks.WATER); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.WATER, pos.east())) + .thenExecute(() -> helper.setBlock(pos.east(), Blocks.DIRT)) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.DIRT, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldDrainFluidBlocklist(final GameTestHelper helper) { + DestructorTestPlots.preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.BLOCK); + destructor.setFilters(Set.of(asResource(LAVA))); + + helper.setBlock(pos.east(), Blocks.WATER); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.WATER, pos.east())) + .thenExecute(() -> helper.setBlock(pos.east(), Blocks.LAVA)) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.LAVA, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } +} diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorTestPlots.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorTestPlots.java new file mode 100644 index 000000000..0df2e00de --- /dev/null +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorTestPlots.java @@ -0,0 +1,37 @@ +package com.refinedmods.refinedstorage.common.constructordestructor; + +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.gametest.framework.GameTestSequence; +import org.apache.commons.lang3.function.TriConsumer; + +import static com.refinedmods.refinedstorage.common.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage.common.GameTestUtil.requireBlockEntity; +import static net.minecraft.core.BlockPos.ZERO; + +final class DestructorTestPlots { + private DestructorTestPlots() { + } + + static void preparePlot(final GameTestHelper helper, + final Direction direction, + final TriConsumer consumer) { + helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); + helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageVariant.ONE_K)); + helper.setBlock( + ZERO.above().above().north(), + RSBLOCKS.getFluidStorageBlock(FluidStorageVariant.SIXTY_FOUR_B) + ); + final BlockPos destructorPos = ZERO.above().above().above(); + helper.setBlock(destructorPos, RSBLOCKS.getDestructor().getDefault().rotated(direction)); + consumer.accept( + requireBlockEntity(helper, destructorPos, DestructorBlockEntity.class), + destructorPos, + helper.startSequence() + ); + } +} diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/exporter/ExporterTest.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/exporter/ExporterTest.java new file mode 100644 index 000000000..b8af35175 --- /dev/null +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/exporter/ExporterTest.java @@ -0,0 +1,214 @@ +package com.refinedmods.refinedstorage.common.exporter; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; + +import java.util.List; + +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTest; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.LayeredCauldronBlock; +import net.neoforged.neoforge.gametest.GameTestHolder; +import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; + +import static com.refinedmods.refinedstorage.common.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage.common.GameTestUtil.RSITEMS; +import static com.refinedmods.refinedstorage.common.GameTestUtil.asResource; +import static com.refinedmods.refinedstorage.common.GameTestUtil.containerContainsExactly; +import static com.refinedmods.refinedstorage.common.GameTestUtil.insert; +import static com.refinedmods.refinedstorage.common.GameTestUtil.interfaceContainsExactly; +import static com.refinedmods.refinedstorage.common.GameTestUtil.networkIsAvailable; +import static com.refinedmods.refinedstorage.common.GameTestUtil.storageContainsExactly; +import static net.minecraft.world.item.Items.DIAMOND_CHESTPLATE; +import static net.minecraft.world.item.Items.DIRT; +import static net.minecraft.world.item.Items.STONE; +import static net.minecraft.world.level.material.Fluids.WATER; + +@GameTestHolder(IdentifierUtil.MOD_ID) +@PrefixGameTestTemplate(false) +public final class ExporterTest { + private ExporterTest() { + } + + @GameTest(template = "empty_15x15") + public static void shouldExportItem(final GameTestHelper helper) { + ExporterTestPlots.preparePlot(helper, Blocks.CHEST, Direction.EAST, (exporter, pos, sequence) -> { + // Arrange + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + insert(helper, network, asResource(damagedDiamondChestplate), 1); + })); + + // Act + exporter.setFilters(List.of(asResource(DIRT), asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + + // Assert + sequence + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIRT), 1) + )) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 9), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(damagedDiamondChestplate), 1) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldExportItemWithStackUpgrade(final GameTestHelper helper) { + ExporterTestPlots.preparePlot(helper, Blocks.CHEST, Direction.EAST, (exporter, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 65); + insert(helper, network, STONE, 1); + })); + + // Act + exporter.setFilters(List.of(asResource(DIRT))); + exporter.addUpgradeItem(RSITEMS.getStackUpgrade()); + + // Assert + sequence + .thenIdle(9) + .thenExecute(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIRT), 64) + )) + .thenExecute(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 1), + new ResourceAmount(asResource(STONE), 1) + )) + .thenExecute(() -> exporter.setFilters(List.of(asResource(STONE)))) + .thenIdle(9) + .thenExecute(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIRT), 64), + new ResourceAmount(asResource(STONE), 1) + )) + .thenExecute(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 1) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldExportItemFuzzy(final GameTestHelper helper) { + ExporterTestPlots.preparePlot(helper, Blocks.CHEST, Direction.EAST, (exporter, pos, sequence) -> { + // Arrange + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + insert(helper, network, DIAMOND_CHESTPLATE, 1); + insert(helper, network, asResource(damagedDiamondChestplate), 1); + })); + + // Act + exporter.setFuzzyMode(true); + exporter.setFilters(List.of(asResource(DIAMOND_CHESTPLATE))); + + // Assert + sequence + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1), + new ResourceAmount(asResource(damagedDiamondChestplate), 1) + )) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldExportFluid(final GameTestHelper helper) { + ExporterTestPlots.preparePlot(helper, Blocks.CAULDRON, Direction.EAST, (exporter, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + insert(helper, network, WATER, Platform.INSTANCE.getBucketAmount() * 2); + })); + + // Act + exporter.setFilters(List.of(asResource(WATER))); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockProperty(pos.east(), LayeredCauldronBlock.LEVEL, + LayeredCauldronBlock.MAX_FILL_LEVEL)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldExportFluidWithStackUpgrade(final GameTestHelper helper) { + ExporterTestPlots.preparePlot(helper, RSBLOCKS.getInterface(), Direction.EAST, (exporter, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + insert(helper, network, WATER, Platform.INSTANCE.getBucketAmount() * 64); + })); + + // Act + exporter.addUpgradeItem(RSITEMS.getStackUpgrade()); + exporter.setFilters(List.of(asResource(WATER))); + + // Assert + sequence + .thenIdle(9) + .thenExecute(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15) + )) + .thenExecute(interfaceContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 16), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 16), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 16), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 16) + )) + + .thenSucceed(); + }); + } +} diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/exporter/ExporterTestPlots.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/exporter/ExporterTestPlots.java new file mode 100644 index 000000000..3ceb1ed51 --- /dev/null +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/exporter/ExporterTestPlots.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage.common.exporter; + +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.gametest.framework.GameTestSequence; +import net.minecraft.world.level.block.Block; +import org.apache.commons.lang3.function.TriConsumer; + +import static com.refinedmods.refinedstorage.common.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage.common.GameTestUtil.requireBlockEntity; +import static net.minecraft.core.BlockPos.ZERO; + +final class ExporterTestPlots { + private ExporterTestPlots() { + } + + static void preparePlot(final GameTestHelper helper, + final Block block, + final Direction direction, + final TriConsumer consumer) { + helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); + helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageVariant.ONE_K)); + helper.setBlock( + ZERO.above().above().north(), + RSBLOCKS.getFluidStorageBlock(FluidStorageVariant.SIXTY_FOUR_B) + ); + final BlockPos exporterPos = ZERO.above().above().above(); + helper.setBlock(exporterPos, RSBLOCKS.getExporter().getDefault().rotated(direction)); + helper.setBlock(exporterPos.east(), block); + consumer.accept( + requireBlockEntity(helper, exporterPos, ExporterBlockEntity.class), + exporterPos, + helper.startSequence() + ); + } +} diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/importer/ImporterTest.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/importer/ImporterTest.java new file mode 100644 index 000000000..409126da3 --- /dev/null +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/importer/ImporterTest.java @@ -0,0 +1,358 @@ +package com.refinedmods.refinedstorage.common.importer; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; + +import java.util.Set; + +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTest; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.LayeredCauldronBlock; +import net.neoforged.neoforge.gametest.GameTestHolder; +import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; + +import static com.refinedmods.refinedstorage.common.GameTestUtil.RSITEMS; +import static com.refinedmods.refinedstorage.common.GameTestUtil.asResource; +import static com.refinedmods.refinedstorage.common.GameTestUtil.assertInterfaceEmpty; +import static com.refinedmods.refinedstorage.common.GameTestUtil.containerContainsExactly; +import static com.refinedmods.refinedstorage.common.GameTestUtil.insert; +import static com.refinedmods.refinedstorage.common.GameTestUtil.interfaceContainsExactly; +import static com.refinedmods.refinedstorage.common.GameTestUtil.networkIsAvailable; +import static com.refinedmods.refinedstorage.common.GameTestUtil.storageContainsExactly; +import static com.refinedmods.refinedstorage.common.importer.ImporterTestPlots.prepareChest; +import static com.refinedmods.refinedstorage.common.importer.ImporterTestPlots.prepareInterface; +import static com.refinedmods.refinedstorage.common.importer.ImporterTestPlots.preparePlot; +import static net.minecraft.world.item.Items.COBBLESTONE; +import static net.minecraft.world.item.Items.DIAMOND_CHESTPLATE; +import static net.minecraft.world.item.Items.DIRT; +import static net.minecraft.world.item.Items.STONE; +import static net.minecraft.world.level.material.Fluids.LAVA; +import static net.minecraft.world.level.material.Fluids.WATER; + +@GameTestHolder(IdentifierUtil.MOD_ID) +@PrefixGameTestTemplate(false) +public final class ImporterTest { + private ImporterTest() { + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItem(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + prepareChest( + helper, + pos.east(), + DIRT.getDefaultInstance(), + COBBLESTONE.getDefaultInstance().copyWithCount(3) + ); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertContainerEmpty(pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(COBBLESTONE), 3) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItemWithStackUpgrade(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + prepareChest( + helper, + pos.east(), + COBBLESTONE.getDefaultInstance().copyWithCount(64), + DIRT.getDefaultInstance() + ); + importer.addUpgradeItem(RSITEMS.getStackUpgrade()); + + // Assert + sequence + .thenExecute(() -> containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIRT), 1) + )) + .thenExecute(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(COBBLESTONE), 64) + )) + .thenIdle(9) + .thenExecute(() -> helper.assertContainerEmpty(pos.east())) + .thenExecute(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(COBBLESTONE), 64) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItemBlocklist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + prepareChest( + helper, + pos.east(), + DIRT.getDefaultInstance(), + DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate + ); + + importer.setFuzzyMode(false); + importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + importer.setFilterMode(FilterMode.BLOCK); + + // Assert + sequence + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1) + )) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(damagedDiamondChestplate), 1) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItemFuzzyBlocklist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + prepareChest( + helper, + pos.east(), + DIRT.getDefaultInstance(), + DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate + ); + + importer.setFuzzyMode(true); + importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + importer.setFilterMode(FilterMode.BLOCK); + + // Assert + sequence + .thenIdle(9) + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1), + new ResourceAmount(asResource(damagedDiamondChestplate), 1) + )) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItemAllowlist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + prepareChest( + helper, + pos.east(), + DIRT.getDefaultInstance(), + DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate + ); + + importer.setFuzzyMode(false); + importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + importer.setFilterMode(FilterMode.ALLOW); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertContainerContains(pos.east(), DIRT)) + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIRT), 1), + new ResourceAmount(asResource(damagedDiamondChestplate), 1) + )) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItemFuzzyAllowlist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + prepareChest( + helper, + pos.east(), + DIRT.getDefaultInstance(), + DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate + ); + + importer.setFuzzyMode(true); + importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + importer.setFilterMode(FilterMode.ALLOW); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertContainerContains(pos.east(), DIRT)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1), + new ResourceAmount(asResource(damagedDiamondChestplate), 1) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportFluid(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + helper.setBlock(pos.east(), Blocks.WATER_CAULDRON.defaultBlockState() + .setValue(LayeredCauldronBlock.LEVEL, LayeredCauldronBlock.MAX_FILL_LEVEL)); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.CAULDRON, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportFluidWithStackUpgrade(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + prepareInterface( + helper, + pos.east(), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 16), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 16), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 16), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 15), + new ResourceAmount(asResource(LAVA), Platform.INSTANCE.getBucketAmount()) + ); + importer.addUpgradeItem(RSITEMS.getStackUpgrade()); + + // Assert + sequence + .thenExecute(interfaceContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(LAVA), Platform.INSTANCE.getBucketAmount()) + )) + .thenExecute(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 63) + )) + .thenIdle(9) + .thenExecute(assertInterfaceEmpty(helper, pos.east())) + .thenExecute(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount() * 63), + new ResourceAmount(asResource(LAVA), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } +} diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/importer/ImporterTestPlots.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/importer/ImporterTestPlots.java new file mode 100644 index 000000000..9c07f625c --- /dev/null +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/importer/ImporterTestPlots.java @@ -0,0 +1,65 @@ +package com.refinedmods.refinedstorage.common.importer; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.common.iface.ExportedResourcesContainer; +import com.refinedmods.refinedstorage.common.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.gametest.framework.GameTestSequence; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; +import org.apache.commons.lang3.function.TriConsumer; + +import static com.refinedmods.refinedstorage.common.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage.common.GameTestUtil.requireBlockEntity; +import static net.minecraft.core.BlockPos.ZERO; + +final class ImporterTestPlots { + private ImporterTestPlots() { + } + + static void preparePlot(final GameTestHelper helper, + final Direction direction, + final TriConsumer consumer) { + helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); + helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageVariant.ONE_K)); + helper.setBlock( + ZERO.above().above().north(), + RSBLOCKS.getFluidStorageBlock(FluidStorageVariant.SIXTY_FOUR_B) + ); + final BlockPos importerPos = ZERO.above().above().above(); + helper.setBlock(importerPos, RSBLOCKS.getImporter().getDefault().rotated(direction)); + consumer.accept( + requireBlockEntity(helper, importerPos, ImporterBlockEntity.class), + importerPos, + helper.startSequence() + ); + } + + static void prepareChest(final GameTestHelper helper, + final BlockPos pos, + final ItemStack... stacks) { + helper.setBlock(pos, Blocks.CHEST.defaultBlockState()); + final var chestBlockEntity = requireBlockEntity(helper, pos, BaseContainerBlockEntity.class); + for (int i = 0; i < stacks.length; i++) { + chestBlockEntity.setItem(i, stacks[i]); + } + } + + static void prepareInterface(final GameTestHelper helper, + final BlockPos pos, + final ResourceAmount... resource) { + helper.setBlock(pos, RSBLOCKS.getInterface()); + final var interfaceBlockEntity = requireBlockEntity(helper, pos, InterfaceBlockEntity.class); + final ExportedResourcesContainer exportedResources = interfaceBlockEntity.getExportedResources(); + + for (int i = 0; i < resource.length; i++) { + exportedResources.set(i, resource[i]); + } + } +} diff --git a/refinedstorage-platform-neoforge/src/test/resources/data/refinedstorage/structure/empty_15x15.nbt b/refinedstorage-neoforge/src/test/resources/data/refinedstorage/structure/empty_15x15.nbt similarity index 100% rename from refinedstorage-platform-neoforge/src/test/resources/data/refinedstorage/structure/empty_15x15.nbt rename to refinedstorage-neoforge/src/test/resources/data/refinedstorage/structure/empty_15x15.nbt diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java index 0f93e29c4..107dec96e 100644 --- a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java +++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java @@ -1,14 +1,11 @@ package com.refinedmods.refinedstorage.api.network.security; -import java.util.Collections; import java.util.Set; import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5") public record SecurityPolicy(Set allowedPermissions) { - public static final SecurityPolicy EMPTY = new SecurityPolicy(Collections.emptySet()); - public static SecurityPolicy of(final Permission... permissions) { return new SecurityPolicy(Set.of(permissions)); } diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageNetworkComponent.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageNetworkComponent.java index 7e46b6529..9c3608305 100644 --- a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageNetworkComponent.java +++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageNetworkComponent.java @@ -4,14 +4,14 @@ import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.Storage; import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import java.util.List; import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.1.1") -public interface StorageNetworkComponent extends NetworkComponent, StorageChannel { +public interface StorageNetworkComponent extends NetworkComponent, RootStorage { List getResources(Class actorType); boolean contains(Storage storage); diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageProvider.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageProvider.java index 17ac3a481..b1437aa19 100644 --- a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageProvider.java +++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageProvider.java @@ -1,13 +1,14 @@ package com.refinedmods.refinedstorage.api.network.storage; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import org.apiguardian.api.API; /** * Implement this on {@link com.refinedmods.refinedstorage.api.network.node.NetworkNode}s that can provide a storage * to the network. - * Never modify a {@link com.refinedmods.refinedstorage.api.storage.channel.StorageChannel} + * Never modify a {@link RootStorage} * from a {@link com.refinedmods.refinedstorage.api.network.node.NetworkNode} directly. * Use this interface to help you manage the lifecycle of your storage, to ensure that your storage is added or removed * in the right cases. diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java index 3e9a33b7a..4821e31db 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java @@ -150,7 +150,6 @@ private void addNetworkNode(final Object testInstance, final Field field) { final Class type = field.getType(); final Map properties = getProperties(annotation.properties()); final NetworkNode resolvedNode = networkNodeFactories.get(type).create( - annotation, properties ); final Network network = networkMap.get(annotation.networkId()); diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java index 3f39a02c6..a044859b5 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; @@ -11,8 +10,8 @@ public abstract class AbstractNetworkNodeFactory implements NetworkNodeFactory { public static final String PROPERTY_ENERGY_USAGE = "energy_usage"; @Override - public final NetworkNode create(final AddNetworkNode ctx, final Map properties) { - final AbstractNetworkNode value = innerCreate(ctx, properties); + public final NetworkNode create(final Map properties) { + final AbstractNetworkNode value = innerCreate(properties); final boolean active = (boolean) properties.getOrDefault(PROPERTY_ACTIVE, true); value.setActive(active); return value; @@ -22,5 +21,5 @@ protected final long getEnergyUsage(final Map properties) { return (long) properties.getOrDefault(PROPERTY_ENERGY_USAGE, 0L); } - protected abstract AbstractNetworkNode innerCreate(AddNetworkNode ctx, Map properties); + protected abstract AbstractNetworkNode innerCreate(Map properties); } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ControllerNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ControllerNetworkNodeFactory.java index cc1abcb17..ab829a9a3 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ControllerNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ControllerNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.controller.ControllerNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class ControllerNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new ControllerNetworkNode(); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/DetectorNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/DetectorNetworkNodeFactory.java index 3b6f64a86..088ef6d64 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/DetectorNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/DetectorNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class DetectorNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new DetectorNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExporterNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExporterNetworkNodeFactory.java index b20ec5adb..2e3cfe784 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExporterNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExporterNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class ExporterNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new ExporterNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExternalStorageNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExternalStorageNetworkNodeFactory.java index 711c734c9..97837394a 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExternalStorageNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExternalStorageNetworkNodeFactory.java @@ -3,13 +3,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageNetworkNode; import com.refinedmods.refinedstorage.api.storage.tracked.InMemoryTrackedStorageRepository; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class ExternalStorageNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { final ExternalStorageNetworkNode externalStorage = new ExternalStorageNetworkNode( getEnergyUsage(properties), () -> 0L diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/GridNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/GridNetworkNodeFactory.java index d883b3dc9..218bb94e1 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/GridNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/GridNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.grid.GridNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class GridNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new GridNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ImporterNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ImporterNetworkNodeFactory.java index 140166c81..2b2a3a056 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ImporterNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ImporterNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class ImporterNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new ImporterNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/InterfaceNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/InterfaceNetworkNodeFactory.java index df491a059..6f9217a2c 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/InterfaceNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/InterfaceNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class InterfaceNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new InterfaceNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/NetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/NetworkNodeFactory.java index aac0d307e..5606df0ab 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/NetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/NetworkNodeFactory.java @@ -1,11 +1,10 @@ package com.refinedmods.refinedstorage.network.test.nodefactory; import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; @FunctionalInterface public interface NetworkNodeFactory { - NetworkNode create(AddNetworkNode ctx, Map properties); + NetworkNode create(Map properties); } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayInputNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayInputNetworkNodeFactory.java index 704abcefa..f996b4f7b 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayInputNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayInputNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayInputNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class RelayInputNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new RelayInputNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayOutputNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayOutputNetworkNodeFactory.java index 60305e8f2..faf146960 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayOutputNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayOutputNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayOutputNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class RelayOutputNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new RelayOutputNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/SimpleNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/SimpleNetworkNodeFactory.java index cc59936b1..e8e6b5c3d 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/SimpleNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/SimpleNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class SimpleNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new SimpleNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageNetworkNodeFactory.java index e36cc4722..d817112ad 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageNetworkNodeFactory.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; @@ -11,7 +10,7 @@ public class StorageNetworkNodeFactory extends AbstractNetworkNodeFactory { public static final String PROPERTY_SIZE = "size"; @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { final long energyUsagePerStorage = (long) properties.getOrDefault(PROPERTY_ENERGY_USAGE_PER_STORAGE, 0L); final int size = (int) properties.getOrDefault(PROPERTY_SIZE, 9); return new StorageNetworkNode( diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageTransferNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageTransferNetworkNodeFactory.java index 31405d6c0..6539531a3 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageTransferNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageTransferNetworkNodeFactory.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; @@ -11,7 +10,7 @@ public class StorageTransferNetworkNodeFactory extends AbstractNetworkNodeFactor public static final String PROPERTY_SIZE = "size"; @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { final long energyUsagePerStorage = (long) properties.getOrDefault(PROPERTY_ENERGY_USAGE_PER_STORAGE, 0L); final int size = (int) properties.getOrDefault(PROPERTY_SIZE, 6); return new StorageTransferNetworkNode( diff --git a/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java index 32a428b98..e28daaa0e 100644 --- a/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java +++ b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java @@ -36,6 +36,7 @@ class NetworkTestExtensionTest { }) StorageNetworkNode storageInA; + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(networkId = "b", properties = { @AddNetworkNode.Property(key = AbstractNetworkNodeFactory.PROPERTY_ACTIVE, boolValue = false) }) diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java index 987e4d235..e31c5234f 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java @@ -3,8 +3,8 @@ public final class NetworkNodeContainerPriorities { /** * It is important that the grid has the highest priority when a network split or merge occurs. - * This priority will affect the grids that are part of the a) newly created network for a split and - * b) removed network in case of a merge. + * This priority will affect the grids that are part of the 1) newly created network for a split and + * 2) removed network in case of a merge. * For a network split, this will ensure that the grid will be able to invalidate all its watchers first and attach * to the newly created network. * After that, all the storages will be re-added into the newly created network. diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/AbstractDetectorAmountStrategy.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/AbstractDetectorAmountStrategy.java index b139f568d..7335a2b63 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/AbstractDetectorAmountStrategy.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/AbstractDetectorAmountStrategy.java @@ -2,10 +2,10 @@ import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; public abstract class AbstractDetectorAmountStrategy implements DetectorAmountStrategy { - protected StorageChannel getStorageChannel(final Network network) { + protected RootStorage getRootStorage(final Network network) { return network.getComponent(StorageNetworkComponent.class); } } diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategyImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategyImpl.java index 3b0ef8c65..d07e877fe 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategyImpl.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategyImpl.java @@ -7,7 +7,7 @@ public class DetectorAmountStrategyImpl extends AbstractDetectorAmountStrategy { @Override public long getAmount(final Network network, final ResourceKey configuredResource) { - return getStorageChannel(network) + return getRootStorage(network) .get(configuredResource) .map(ResourceAmount::getAmount) .orElse(0L); diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java index 0118f91b0..d948619a5 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java @@ -7,7 +7,7 @@ import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; import com.refinedmods.refinedstorage.api.storage.TransferHelper; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import java.util.Collection; import java.util.Collections; @@ -22,40 +22,40 @@ public ExporterTransferStrategyImpl(final InsertableStorage destination, final l } /** - * @param resource the resource to expand - * @param storageChannel the storage channel belonging to the resource + * @param resource the resource to expand + * @param rootStorage the storage belonging to the resource * @return the list of expanded resources, will be tried out in the order of the list. Can be empty. */ - protected Collection expand(final ResourceKey resource, final StorageChannel storageChannel) { + protected Collection expand(final ResourceKey resource, final RootStorage rootStorage) { return Collections.singletonList(resource); } @Override public boolean transfer(final ResourceKey resource, final Actor actor, final Network network) { - final StorageChannel storageChannel = network.getComponent(StorageNetworkComponent.class); - final Collection expanded = expand(resource, storageChannel); - return tryTransferExpanded(actor, storageChannel, expanded); + final RootStorage rootStorage = network.getComponent(StorageNetworkComponent.class); + final Collection expanded = expand(resource, rootStorage); + return tryTransferExpanded(actor, rootStorage, expanded); } private boolean tryTransferExpanded(final Actor actor, - final StorageChannel storageChannel, + final RootStorage rootStorage, final Collection expanded) { for (final ResourceKey resource : expanded) { - if (tryTransfer(actor, storageChannel, resource)) { + if (tryTransfer(actor, rootStorage, resource)) { return true; } } return false; } - private boolean tryTransfer(final Actor actor, final StorageChannel storageChannel, final ResourceKey resource) { + private boolean tryTransfer(final Actor actor, final RootStorage rootStorage, final ResourceKey resource) { final long transferred = TransferHelper.transfer( resource, transferQuota, actor, - storageChannel, + rootStorage, destination, - storageChannel + rootStorage ); return transferred > 0; } diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportState.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportState.java index 2c71fb43f..ed4ea494e 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportState.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportState.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import java.util.Collection; import javax.annotation.Nullable; @@ -10,7 +10,7 @@ public interface InterfaceExportState { int getSlots(); - Collection expandExportCandidates(StorageChannel storageChannel, ResourceKey resource); + Collection expandExportCandidates(RootStorage rootStorage, ResourceKey resource); boolean isExportedResourceValid(ResourceKey want, ResourceKey got); diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNode.java index 994f6ea7c..6b3cf3b47 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNode.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNode.java @@ -9,7 +9,7 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import java.util.Collection; import java.util.function.ToLongFunction; @@ -92,9 +92,9 @@ private void doExport(final InterfaceExportState state, private void clearExportedResource(final InterfaceExportState state, final int slot, final ResourceKey got, - final StorageChannel storageChannel) { + final RootStorage rootStorage) { final long currentAmount = state.getExportedAmount(slot); - final long inserted = storageChannel.insert( + final long inserted = rootStorage.insert( got, Math.min(currentAmount, transferQuotaProvider.applyAsLong(got)), Action.EXECUTE, @@ -109,11 +109,11 @@ private void clearExportedResource(final InterfaceExportState state, private void doInitialExport(final InterfaceExportState state, final int slot, final ResourceKey want, - final StorageChannel storageChannel) { + final RootStorage rootStorage) { final long wantedAmount = state.getRequestedAmount(slot); - final Collection candidates = state.expandExportCandidates(storageChannel, want); + final Collection candidates = state.expandExportCandidates(rootStorage, want); for (final ResourceKey candidate : candidates) { - final long extracted = storageChannel.extract( + final long extracted = rootStorage.extract( candidate, Math.min(transferQuotaProvider.applyAsLong(want), wantedAmount), Action.EXECUTE, @@ -144,9 +144,9 @@ private void exportAdditionalResources(final InterfaceExportState state, final int slot, final ResourceKey got, final long amount, - final StorageChannel storageChannel) { + final RootStorage rootStorage) { final long correctedAmount = Math.min(transferQuotaProvider.applyAsLong(got), amount); - final long extracted = storageChannel.extract(got, correctedAmount, Action.EXECUTE, actor); + final long extracted = rootStorage.extract(got, correctedAmount, Action.EXECUTE, actor); if (extracted == 0) { return; } @@ -157,9 +157,9 @@ private void returnExportedResource(final InterfaceExportState state, final int slot, final ResourceKey got, final long amount, - final StorageChannel storageChannel) { + final RootStorage rootStorage) { final long correctedAmount = Math.min(transferQuotaProvider.applyAsLong(got), Math.abs(amount)); - final long inserted = storageChannel.insert(got, correctedAmount, Action.EXECUTE, actor); + final long inserted = rootStorage.insert(got, correctedAmount, Action.EXECUTE, actor); if (inserted == 0) { return; } diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterTransferStrategyImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterTransferStrategyImpl.java index 5f09e2b49..aac77cfb4 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterTransferStrategyImpl.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterTransferStrategyImpl.java @@ -7,7 +7,7 @@ import com.refinedmods.refinedstorage.api.resource.filter.Filter; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.TransferHelper; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import java.util.Iterator; import java.util.Objects; @@ -26,20 +26,20 @@ public ImporterTransferStrategyImpl(final ImporterSource source, final long tran @Override public boolean transfer(final Filter filter, final Actor actor, final Network network) { - final StorageChannel storageChannel = network.getComponent(StorageNetworkComponent.class); - return transfer(filter, actor, storageChannel); + final RootStorage rootStorage = network.getComponent(StorageNetworkComponent.class); + return transfer(filter, actor, rootStorage); } - private boolean transfer(final Filter filter, final Actor actor, final StorageChannel storageChannel) { + private boolean transfer(final Filter filter, final Actor actor, final RootStorage rootStorage) { long totalTransferred = 0; ResourceKey workingResource = null; final Iterator iterator = source.getResources(); while (iterator.hasNext() && totalTransferred < transferQuota) { final ResourceKey resource = iterator.next(); if (workingResource != null) { - totalTransferred += performTransfer(storageChannel, actor, totalTransferred, workingResource, resource); + totalTransferred += performTransfer(rootStorage, actor, totalTransferred, workingResource, resource); } else if (filter.isAllowed(resource)) { - final long transferred = performTransfer(storageChannel, actor, totalTransferred, resource); + final long transferred = performTransfer(rootStorage, actor, totalTransferred, resource); if (transferred > 0) { workingResource = resource; } @@ -49,18 +49,18 @@ private boolean transfer(final Filter filter, final Actor actor, final StorageCh return totalTransferred > 0; } - private long performTransfer(final StorageChannel storageChannel, + private long performTransfer(final RootStorage rootStorage, final Actor actor, final long totalTransferred, final ResourceKey workingResource, final ResourceKey resource) { if (Objects.equals(workingResource, resource)) { - return performTransfer(storageChannel, actor, totalTransferred, resource); + return performTransfer(rootStorage, actor, totalTransferred, resource); } return 0L; } - private long performTransfer(final StorageChannel storageChannel, + private long performTransfer(final RootStorage rootStorage, final Actor actor, final long totalTransferred, final ResourceKey resource) { @@ -69,7 +69,7 @@ private long performTransfer(final StorageChannel storageChannel, transferQuota - totalTransferred, actor, source, - storageChannel, + rootStorage, source ); } diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImpl.java index 144a71d71..d0535d17c 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImpl.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImpl.java @@ -7,14 +7,14 @@ import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.Storage; import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannelImpl; +import com.refinedmods.refinedstorage.api.storage.root.RootStorageImpl; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class StorageNetworkComponentImpl extends StorageChannelImpl implements StorageNetworkComponent { +public class StorageNetworkComponentImpl extends RootStorageImpl implements StorageNetworkComponent { private static final Logger LOGGER = LoggerFactory.getLogger(StorageNetworkComponentImpl.class); public StorageNetworkComponentImpl(final ResourceList list) { diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java index 06c4656de..b1baf2c3f 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java @@ -4,6 +4,7 @@ import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.NetworkBuilder; import com.refinedmods.refinedstorage.api.network.NetworkComponent; +import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage.api.network.node.NetworkNode; import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer; import com.refinedmods.refinedstorage.network.test.NetworkTestFixtures; @@ -74,7 +75,7 @@ protected static NetworkNodeContainer createContainer() { } private static NetworkNode createNode() { - return new SpyingNetworkNode(0); + return new SimpleNetworkNode(0); } protected static List getAddedContainers(final Network network) { diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java index 0906e28a3..de75b6b9b 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java @@ -122,7 +122,7 @@ void shouldSplitNetworkInTwo() { final List> splits = getNetworkSplits(container4.getNode().getNetwork()); assertThat(splits).hasSize(1); - assertThat(splits.get(0)).containsExactlyInAnyOrder(container1.getNode().getNetwork()); + assertThat(splits.getFirst()).containsExactlyInAnyOrder(container1.getNode().getNetwork()); assertThat(getAddedContainers(container4.getNode().getNetwork())) .containsExactlyInAnyOrder(container1, container2, container3, container4, container5); @@ -197,7 +197,7 @@ void shouldSplitNetworkInThree() { final List> splits = getNetworkSplits(container4.getNode().getNetwork()); assertThat(splits).hasSize(1); - assertThat(splits.get(0)) + assertThat(splits.getFirst()) .containsExactlyInAnyOrder(container2.getNode().getNetwork(), container3.getNode().getNetwork()); assertThat(getAddedContainers(container4.getNode().getNetwork())) diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/SpyingNetworkNode.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/SpyingNetworkNode.java deleted file mode 100644 index 2293aebdc..000000000 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/SpyingNetworkNode.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.refinedmods.refinedstorage.api.network.impl; - -import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; - -public final class SpyingNetworkNode extends AbstractNetworkNode { - private final long energyUsage; - private int activenessChanges; - - public SpyingNetworkNode(final long energyUsage) { - this.energyUsage = energyUsage; - } - - @Override - protected void onActiveChanged(final boolean newActive) { - super.onActiveChanged(newActive); - activenessChanges++; - } - - public int getActivenessChanges() { - return activenessChanges; - } - - @Override - public long getEnergyUsage() { - return energyUsage; - } -} diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNodeTest.java index cdb7cd507..fa636efdf 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNodeTest.java @@ -16,6 +16,7 @@ @NetworkTest @SetupNetwork(energyStored = 10, energyCapacity = 100) class SimpleNetworkNodeTest { + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE, longValue = 10), @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java index 0c249d982..ea89e9214 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java @@ -31,6 +31,7 @@ protected TaskExecutor createTaskExecutor() { return new DefaultTaskExecutor<>(); } + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug @Test void shouldTransfer(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { // Arrange diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java index 0abc32032..a04702497 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java @@ -466,6 +466,7 @@ void shouldNoLongerShowOnNetworkWhenRemovedWithoutInitializedStorage( assertThat(networkStorage.getAll()).isEmpty(); } + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug @ParameterizedTest @EnumSource(Action.class) void shouldTrackChangesWhenExtracting( @@ -526,6 +527,7 @@ void shouldNotTrackChangesWhenExtractionFailed( assertThat(trackedResource).isEmpty(); } + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug @ParameterizedTest @EnumSource(Action.class) void shouldTrackChangesWhenInserting( diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportStateImpl.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportStateImpl.java index 25dab3158..3cdcf0350 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportStateImpl.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportStateImpl.java @@ -3,7 +3,7 @@ import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import java.util.ArrayList; import java.util.Collection; @@ -40,22 +40,22 @@ public int getSlots() { } @Override - public Collection expandExportCandidates(final StorageChannel storageChannel, + public Collection expandExportCandidates(final RootStorage rootStorage, final ResourceKey resource) { if (A.equals(resource)) { - return expandExportCandidates(storageChannel); + return expandExportCandidates(rootStorage); } return Collections.singletonList(resource); } - private Collection expandExportCandidates(final StorageChannel storageChannel) { + private Collection expandExportCandidates(final RootStorage rootStorage) { final List candidates = new ArrayList<>(); candidates.add(A); - // Simulate the behavior from FuzzyStorageChannel - if (storageChannel.get(A_ALTERNATIVE).isPresent()) { + // Simulate the behavior from FuzzyRootStorage + if (rootStorage.get(A_ALTERNATIVE).isPresent()) { candidates.add(A_ALTERNATIVE); } - if (storageChannel.get(A_ALTERNATIVE2).isPresent()) { + if (rootStorage.get(A_ALTERNATIVE2).isPresent()) { candidates.add(A_ALTERNATIVE2); } return candidates; diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayEnergyNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayEnergyNetworkNodeTest.java index 9ac83d57d..99c619d3e 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayEnergyNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayEnergyNetworkNodeTest.java @@ -30,6 +30,7 @@ @SetupNetwork(id = "input") @SetupNetwork(id = "output", setupEnergy = false) class RelayEnergyNetworkNodeTest { + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) }, networkId = "input") diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java index 0655d2a1a..3c766ecf3 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java @@ -42,6 +42,7 @@ class RelayNetworkNodeTest { private static final long INPUT_ENERGY_USAGE = 5; private static final long OUTPUT_ENERGY_USAGE = 5; + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE, longValue = INPUT_ENERGY_USAGE), @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java index 739b24d01..c07572fb3 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java @@ -32,6 +32,7 @@ @SetupNetwork(id = "input") @SetupNetwork(id = "output", setupEnergy = false) class RelaySecurityNetworkNodeTest { + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) }, networkId = "input") diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java index c1aaf57ec..12464d396 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java @@ -39,6 +39,7 @@ @SetupNetwork(id = "input") @SetupNetwork(id = "output", setupEnergy = false) class RelayStorageNetworkNodeTest { + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) }, networkId = "input") diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java index c27a7eac1..b7045a0e6 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java @@ -270,14 +270,14 @@ void shouldNotUpdateNetworkStorageWhenChangingStorageWhenInactive( initializeAndActivate(); // Act - final Collection preInactiveness = new HashSet<>(networkStorage.getAll()); + final Collection preInactive = new HashSet<>(networkStorage.getAll()); sut.setActive(false); sut.onStorageChanged(1); - final Collection postInactiveness = networkStorage.getAll(); + final Collection postInactive = networkStorage.getAll(); // Assert - assertThat(preInactiveness).isNotEmpty(); - assertThat(postInactiveness).isEmpty(); + assertThat(preInactive).isNotEmpty(); + assertThat(postInactive).isEmpty(); assertThat(networkStorage.getStored()).isZero(); } diff --git a/refinedstorage-platform-api/build.gradle.kts b/refinedstorage-platform-api/build.gradle.kts deleted file mode 100644 index 538c23597..000000000 --- a/refinedstorage-platform-api/build.gradle.kts +++ /dev/null @@ -1,30 +0,0 @@ -plugins { - id("refinedarchitect.common") -} - -refinedarchitect { - common() - testing() - javadoc() - publishing { - maven = true - } -} - -base { - archivesName.set("refinedstorage-platform-api") -} - -dependencies { - api(libs.apiguardian) - api(project(":refinedstorage-core-api")) - api(project(":refinedstorage-storage-api")) - api(project(":refinedstorage-resource-api")) - api(project(":refinedstorage-network-api")) - api(project(":refinedstorage-grid-api")) - testImplementation(libs.junit.api) - testImplementation(libs.junit.params) - testImplementation(libs.assertj) - testImplementation(libs.equalsverifier) - testRuntimeOnly(libs.junit.engine) -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java deleted file mode 100644 index 7a31b58f2..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api; - -import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.NetworkComponent; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHints; -import com.refinedmods.refinedstorage.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.security.BuiltinPermissions; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItemHelper; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.api.storage.StorageType; -import com.refinedmods.refinedstorage.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.energy.EnergyItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionLogic; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; -import com.refinedmods.refinedstorage.platform.api.support.resource.RecipeModIngredientConverter; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; -import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; -import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; - -import java.util.Collection; -import java.util.Optional; -import java.util.Set; -import java.util.function.Supplier; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") -public interface PlatformApi { - PlatformApi INSTANCE = new PlatformApiProxy(); - - PlatformRegistry getStorageTypeRegistry(); - - StorageRepository getClientStorageRepository(); - - StorageRepository getStorageRepository(Level level); - - StorageContainerItemHelper getStorageContainerItemHelper(); - - PlatformRegistry getResourceTypeRegistry(); - - PlatformRegistry getImporterTransferStrategyRegistry(); - - PlatformRegistry getExporterTransferStrategyRegistry(); - - void addExternalStorageProviderFactory(PlatformExternalStorageProviderFactory factory); - - Collection getExternalStorageProviderFactories(); - - Collection getDestructorStrategyFactories(); - - void addDestructorStrategyFactory(DestructorStrategyFactory factory); - - Collection getConstructorStrategyFactories(); - - void addConstructorStrategyFactory(ConstructorStrategyFactory factory); - - void addStorageMonitorExtractionStrategy(StorageMonitorExtractionStrategy strategy); - - StorageMonitorExtractionStrategy getStorageMonitorExtractionStrategy(); - - void addStorageMonitorInsertionStrategy(StorageMonitorInsertionStrategy strategy); - - StorageMonitorInsertionStrategy getStorageMonitorInsertionStrategy(); - - ComponentMapFactory getNetworkComponentMapFactory(); - - PlatformRegistry getGridSynchronizerRegistry(); - - UpgradeRegistry getUpgradeRegistry(); - - BuiltinUpgradeDestinations getBuiltinUpgradeDestinations(); - - InWorldNetworkNodeContainer createInWorldNetworkNodeContainer(BlockEntity blockEntity, - NetworkNode node, - String name, - int priority, - ConnectionLogic connectionLogic, - @Nullable Supplier keyProvider); - - void onNetworkNodeContainerInitialized(InWorldNetworkNodeContainer container, - @Nullable Level level, - @Nullable Runnable callback); - - void onNetworkNodeContainerRemoved(InWorldNetworkNodeContainer container, @Nullable Level level); - - void onNetworkNodeContainerUpdated(InWorldNetworkNodeContainer container, @Nullable Level level); - - GridInsertionStrategy createGridInsertionStrategy(AbstractContainerMenu containerMenu, - ServerPlayer player, - Grid grid); - - void addGridInsertionStrategyFactory(GridInsertionStrategyFactory insertionStrategyFactory); - - void addAlternativeGridInsertionHint(GridInsertionHint hint); - - GridInsertionHints getGridInsertionHints(); - - GridExtractionStrategy createGridExtractionStrategy(AbstractContainerMenu containerMenu, - ServerPlayer player, - Grid grid); - - void addGridExtractionStrategyFactory(GridExtractionStrategyFactory extractionStrategyFactory); - - GridScrollingStrategy createGridScrollingStrategy(AbstractContainerMenu containerMenu, - ServerPlayer player, - Grid grid); - - void addGridScrollingStrategyFactory(GridScrollingStrategyFactory scrollingStrategyFactory); - - void addResourceFactory(ResourceFactory factory); - - ResourceFactory getItemResourceFactory(); - - StorageType getItemStorageType(); - - ResourceFactory getFluidResourceFactory(); - - StorageType getFluidStorageType(); - - Set getAlternativeResourceFactories(); - - void registerResourceRendering(Class resourceClass, ResourceRendering rendering); - - ResourceRendering getResourceRendering(ResourceKey resource); - - void addIngredientConverter(RecipeModIngredientConverter converter); - - RecipeModIngredientConverter getIngredientConverter(); - - void addWirelessTransmitterRangeModifier(WirelessTransmitterRangeModifier rangeModifier); - - WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier(); - - Optional getEnergyStorage(ItemStack stack); - - EnergyItemHelper getEnergyItemHelper(); - - EnergyStorage asItemEnergyStorage(EnergyStorage energyStorage, ItemStack stack); - - EnergyStorage asBlockItemEnergyStorage( - EnergyStorage energyStorage, - ItemStack stack, - BlockEntityType blockEntityType - ); - - NetworkBoundItemHelper getNetworkBoundItemHelper(); - - PlatformRegistry getSlotReferenceFactoryRegistry(); - - void addSlotReferenceProvider(SlotReferenceProvider slotReferenceProvider); - - SlotReference createInventorySlotReference(Player player, InteractionHand hand); - - void useSlotReferencedItem(Player player, Item... items); - - BuiltinPermissions getBuiltinPermissions(); - - PlatformRegistry getPermissionRegistry(); - - SecurityPolicy createDefaultSecurityPolicy(); - - void sendNoPermissionToOpenMessage(ServerPlayer player, Component target); - - void sendNoPermissionMessage(ServerPlayer player, Component message); - - boolean canPlaceNetworkNode(ServerPlayer player, Level level, BlockPos pos, BlockState state); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java deleted file mode 100644 index 1d7b23193..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java +++ /dev/null @@ -1,414 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api; - -import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.NetworkComponent; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHints; -import com.refinedmods.refinedstorage.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.security.BuiltinPermissions; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItemHelper; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.api.storage.StorageType; -import com.refinedmods.refinedstorage.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.energy.EnergyItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionLogic; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; -import com.refinedmods.refinedstorage.platform.api.support.resource.RecipeModIngredientConverter; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; -import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; -import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; - -import java.util.Collection; -import java.util.Optional; -import java.util.Set; -import java.util.function.Supplier; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; - -public class PlatformApiProxy implements PlatformApi { - @Nullable - private PlatformApi delegate; - - public void setDelegate(final PlatformApi delegate) { - if (this.delegate != null) { - throw new IllegalStateException("Platform API already injected"); - } - this.delegate = delegate; - } - - @Override - public PlatformRegistry getStorageTypeRegistry() { - return ensureLoaded().getStorageTypeRegistry(); - } - - @Override - public StorageRepository getClientStorageRepository() { - return ensureLoaded().getClientStorageRepository(); - } - - @Override - public StorageRepository getStorageRepository(final Level level) { - return ensureLoaded().getStorageRepository(level); - } - - @Override - public StorageContainerItemHelper getStorageContainerItemHelper() { - return ensureLoaded().getStorageContainerItemHelper(); - } - - @Override - public PlatformRegistry getResourceTypeRegistry() { - return ensureLoaded().getResourceTypeRegistry(); - } - - @Override - public PlatformRegistry getImporterTransferStrategyRegistry() { - return ensureLoaded().getImporterTransferStrategyRegistry(); - } - - @Override - public PlatformRegistry getExporterTransferStrategyRegistry() { - return ensureLoaded().getExporterTransferStrategyRegistry(); - } - - @Override - public void addExternalStorageProviderFactory(final PlatformExternalStorageProviderFactory factory) { - ensureLoaded().addExternalStorageProviderFactory(factory); - } - - @Override - public Collection getExternalStorageProviderFactories() { - return ensureLoaded().getExternalStorageProviderFactories(); - } - - @Override - public Collection getDestructorStrategyFactories() { - return ensureLoaded().getDestructorStrategyFactories(); - } - - @Override - public void addDestructorStrategyFactory(final DestructorStrategyFactory factory) { - ensureLoaded().addDestructorStrategyFactory(factory); - } - - @Override - public Collection getConstructorStrategyFactories() { - return ensureLoaded().getConstructorStrategyFactories(); - } - - @Override - public void addConstructorStrategyFactory(final ConstructorStrategyFactory factory) { - ensureLoaded().addConstructorStrategyFactory(factory); - } - - @Override - public void addStorageMonitorExtractionStrategy(final StorageMonitorExtractionStrategy strategy) { - ensureLoaded().addStorageMonitorExtractionStrategy(strategy); - } - - @Override - public StorageMonitorExtractionStrategy getStorageMonitorExtractionStrategy() { - return ensureLoaded().getStorageMonitorExtractionStrategy(); - } - - @Override - public void addStorageMonitorInsertionStrategy(final StorageMonitorInsertionStrategy strategy) { - ensureLoaded().addStorageMonitorInsertionStrategy(strategy); - } - - @Override - public StorageMonitorInsertionStrategy getStorageMonitorInsertionStrategy() { - return ensureLoaded().getStorageMonitorInsertionStrategy(); - } - - @Override - public ComponentMapFactory getNetworkComponentMapFactory() { - return ensureLoaded().getNetworkComponentMapFactory(); - } - - @Override - public PlatformRegistry getGridSynchronizerRegistry() { - return ensureLoaded().getGridSynchronizerRegistry(); - } - - @Override - public UpgradeRegistry getUpgradeRegistry() { - return ensureLoaded().getUpgradeRegistry(); - } - - @Override - public BuiltinUpgradeDestinations getBuiltinUpgradeDestinations() { - return ensureLoaded().getBuiltinUpgradeDestinations(); - } - - @Override - public InWorldNetworkNodeContainer createInWorldNetworkNodeContainer( - final BlockEntity blockEntity, - final NetworkNode node, - final String name, - final int priority, - final ConnectionLogic connectionLogic, - @Nullable final Supplier keyProvider - ) { - return ensureLoaded().createInWorldNetworkNodeContainer( - blockEntity, - node, - name, - priority, - connectionLogic, - keyProvider - ); - } - - @Override - public void onNetworkNodeContainerInitialized(final InWorldNetworkNodeContainer container, - @Nullable final Level level, - @Nullable final Runnable callback) { - ensureLoaded().onNetworkNodeContainerInitialized(container, level, callback); - } - - @Override - public void onNetworkNodeContainerRemoved(final InWorldNetworkNodeContainer container, - @Nullable final Level level) { - ensureLoaded().onNetworkNodeContainerRemoved(container, level); - } - - @Override - public void onNetworkNodeContainerUpdated(final InWorldNetworkNodeContainer container, - @Nullable final Level level) { - ensureLoaded().onNetworkNodeContainerUpdated(container, level); - } - - @Override - public GridInsertionStrategy createGridInsertionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - return ensureLoaded().createGridInsertionStrategy(containerMenu, player, grid); - } - - @Override - public void addGridInsertionStrategyFactory(final GridInsertionStrategyFactory insertionStrategyFactory) { - ensureLoaded().addGridInsertionStrategyFactory(insertionStrategyFactory); - } - - @Override - public void addAlternativeGridInsertionHint(final GridInsertionHint hint) { - ensureLoaded().addAlternativeGridInsertionHint(hint); - } - - @Override - public GridInsertionHints getGridInsertionHints() { - return ensureLoaded().getGridInsertionHints(); - } - - @Override - public GridExtractionStrategy createGridExtractionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - return ensureLoaded().createGridExtractionStrategy(containerMenu, player, grid); - } - - @Override - public void addGridExtractionStrategyFactory(final GridExtractionStrategyFactory extractionStrategyFactory) { - ensureLoaded().addGridExtractionStrategyFactory(extractionStrategyFactory); - } - - @Override - public GridScrollingStrategy createGridScrollingStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - return ensureLoaded().createGridScrollingStrategy(containerMenu, player, grid); - } - - @Override - public void addGridScrollingStrategyFactory(final GridScrollingStrategyFactory scrollingStrategyFactory) { - ensureLoaded().addGridScrollingStrategyFactory(scrollingStrategyFactory); - } - - @Override - public void addResourceFactory(final ResourceFactory factory) { - ensureLoaded().addResourceFactory(factory); - } - - @Override - public ResourceFactory getItemResourceFactory() { - return ensureLoaded().getItemResourceFactory(); - } - - @Override - public StorageType getItemStorageType() { - return ensureLoaded().getItemStorageType(); - } - - @Override - public ResourceFactory getFluidResourceFactory() { - return ensureLoaded().getFluidResourceFactory(); - } - - @Override - public StorageType getFluidStorageType() { - return ensureLoaded().getFluidStorageType(); - } - - @Override - public Set getAlternativeResourceFactories() { - return ensureLoaded().getAlternativeResourceFactories(); - } - - @Override - public void registerResourceRendering(final Class resourceClass, - final ResourceRendering rendering) { - ensureLoaded().registerResourceRendering(resourceClass, rendering); - } - - @Override - public ResourceRendering getResourceRendering(final ResourceKey resource) { - return ensureLoaded().getResourceRendering(resource); - } - - @Override - public void addIngredientConverter(final RecipeModIngredientConverter converter) { - ensureLoaded().addIngredientConverter(converter); - } - - @Override - public RecipeModIngredientConverter getIngredientConverter() { - return ensureLoaded().getIngredientConverter(); - } - - @Override - public void addWirelessTransmitterRangeModifier(final WirelessTransmitterRangeModifier rangeModifier) { - ensureLoaded().addWirelessTransmitterRangeModifier(rangeModifier); - } - - @Override - public WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier() { - return ensureLoaded().getWirelessTransmitterRangeModifier(); - } - - @Override - public Optional getEnergyStorage(final ItemStack stack) { - return ensureLoaded().getEnergyStorage(stack); - } - - @Override - public EnergyItemHelper getEnergyItemHelper() { - return ensureLoaded().getEnergyItemHelper(); - } - - @Override - public EnergyStorage asItemEnergyStorage(final EnergyStorage energyStorage, final ItemStack stack) { - return ensureLoaded().asItemEnergyStorage(energyStorage, stack); - } - - @Override - public EnergyStorage asBlockItemEnergyStorage(final EnergyStorage energyStorage, - final ItemStack stack, - final BlockEntityType blockEntityType) { - return ensureLoaded().asBlockItemEnergyStorage(energyStorage, stack, blockEntityType); - } - - @Override - public NetworkBoundItemHelper getNetworkBoundItemHelper() { - return ensureLoaded().getNetworkBoundItemHelper(); - } - - @Override - public PlatformRegistry getSlotReferenceFactoryRegistry() { - return ensureLoaded().getSlotReferenceFactoryRegistry(); - } - - @Override - public void addSlotReferenceProvider(final SlotReferenceProvider slotReferenceProvider) { - ensureLoaded().addSlotReferenceProvider(slotReferenceProvider); - } - - @Override - public SlotReference createInventorySlotReference(final Player player, final InteractionHand hand) { - return ensureLoaded().createInventorySlotReference(player, hand); - } - - @Override - public void useSlotReferencedItem(final Player player, final Item... items) { - ensureLoaded().useSlotReferencedItem(player, items); - } - - @Override - public BuiltinPermissions getBuiltinPermissions() { - return ensureLoaded().getBuiltinPermissions(); - } - - @Override - public PlatformRegistry getPermissionRegistry() { - return ensureLoaded().getPermissionRegistry(); - } - - @Override - public SecurityPolicy createDefaultSecurityPolicy() { - return ensureLoaded().createDefaultSecurityPolicy(); - } - - @Override - public void sendNoPermissionToOpenMessage(final ServerPlayer player, final Component target) { - ensureLoaded().sendNoPermissionToOpenMessage(player, target); - } - - @Override - public void sendNoPermissionMessage(final ServerPlayer player, final Component message) { - ensureLoaded().sendNoPermissionMessage(player, message); - } - - @Override - public boolean canPlaceNetworkNode(final ServerPlayer player, - final Level level, - final BlockPos pos, - final BlockState state) { - return ensureLoaded().canPlaceNetworkNode(player, level, pos, state); - } - - private PlatformApi ensureLoaded() { - if (delegate == null) { - throw new IllegalStateException("Platform API not loaded yet"); - } - return delegate; - } -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/RefinedStoragePlugin.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/RefinedStoragePlugin.java deleted file mode 100644 index c92be54d5..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/RefinedStoragePlugin.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.13") -public interface RefinedStoragePlugin { - void onPlatformApiAvailable(PlatformApi platformApi); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/configurationcard/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/configurationcard/package-info.java deleted file mode 100644 index 2024bca10..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/configurationcard/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.configurationcard; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/ConstructorStrategy.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/ConstructorStrategy.java deleted file mode 100644 index e0b93a012..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/ConstructorStrategy.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.constructordestructor; - -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.Actor; - -import net.minecraft.world.entity.player.Player; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.11") -@FunctionalInterface -public interface ConstructorStrategy { - boolean apply(ResourceKey resource, Actor actor, Player actingPlayer, Network network); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/DestructorStrategy.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/DestructorStrategy.java deleted file mode 100644 index 833fc5f84..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/DestructorStrategy.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.constructordestructor; - -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.resource.filter.Filter; -import com.refinedmods.refinedstorage.api.storage.Actor; - -import java.util.function.Supplier; - -import net.minecraft.world.entity.player.Player; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.10") -@FunctionalInterface -public interface DestructorStrategy { - /** - * Tries to perform the destructor operation. - * - * @param filter the filter - * @param actor the actor - * @param networkSupplier the network, this network can change due to a destruction operation hence the supplier - * @param actingPlayer the fake player - * @return true if the operation was successful and lower prioritized strategies should be ignored, false otherwise - */ - boolean apply(Filter filter, Actor actor, Supplier networkSupplier, Player actingPlayer); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/package-info.java deleted file mode 100644 index d4ea50522..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/constructordestructor/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.constructordestructor; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/exporter/AmountOverride.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/exporter/AmountOverride.java deleted file mode 100644 index 0b058a671..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/exporter/AmountOverride.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.exporter; - -import com.refinedmods.refinedstorage.api.resource.ResourceKey; - -import java.util.function.LongSupplier; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.12") -@FunctionalInterface -public interface AmountOverride { - AmountOverride NONE = (resource, amount, currentAmount) -> amount; - - /** - * Modifies the requested amount to a new amount. - * - * @param resource the resource - * @param amount the original requested amount - * @param currentAmount the current amount present in the source - * @return the new requested amount, may be 0 - */ - long overrideAmount(ResourceKey resource, long amount, LongSupplier currentAmount); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/exporter/ExporterTransferStrategyFactory.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/exporter/ExporterTransferStrategyFactory.java deleted file mode 100644 index 31f92ddad..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/exporter/ExporterTransferStrategyFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.exporter; - -import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4") -@FunctionalInterface -public interface ExporterTransferStrategyFactory { - ExporterTransferStrategy create( - ServerLevel level, - BlockPos pos, - Direction direction, - UpgradeState upgradeState, - AmountOverride amountOverride, - boolean fuzzyMode - ); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/exporter/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/exporter/package-info.java deleted file mode 100644 index 8fccdbded..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/exporter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.exporter; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridScrollMode.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridScrollMode.java deleted file mode 100644 index 85c180b1b..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridScrollMode.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.grid; - -public enum GridScrollMode { - GRID_TO_INVENTORY, - INVENTORY_TO_GRID, - GRID_TO_CURSOR -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/package-info.java deleted file mode 100644 index 1ae578de9..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.grid; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridExtractionStrategy.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridExtractionStrategy.java deleted file mode 100644 index 832526986..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridExtractionStrategy.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.grid.strategy; - -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") -public interface GridExtractionStrategy { - boolean onExtract(PlatformResourceKey resource, GridExtractMode extractMode, boolean cursor); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridExtractionStrategyFactory.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridExtractionStrategyFactory.java deleted file mode 100644 index 76f27d674..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridExtractionStrategyFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.grid.strategy; - -import com.refinedmods.refinedstorage.platform.api.grid.Grid; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") -@FunctionalInterface -public interface GridExtractionStrategyFactory { - GridExtractionStrategy create(AbstractContainerMenu containerMenu, ServerPlayer player, Grid grid); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridInsertionStrategyFactory.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridInsertionStrategyFactory.java deleted file mode 100644 index 894cc86ba..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridInsertionStrategyFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.grid.strategy; - -import com.refinedmods.refinedstorage.platform.api.grid.Grid; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") -@FunctionalInterface -public interface GridInsertionStrategyFactory { - GridInsertionStrategy create(AbstractContainerMenu containerMenu, ServerPlayer player, Grid grid); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridScrollingStrategy.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridScrollingStrategy.java deleted file mode 100644 index 259b8c19b..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridScrollingStrategy.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.grid.strategy; - -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") -public interface GridScrollingStrategy { - boolean onScroll(PlatformResourceKey resource, GridScrollMode scrollMode, int slotIndex); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridScrollingStrategyFactory.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridScrollingStrategyFactory.java deleted file mode 100644 index 64a97283b..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/GridScrollingStrategyFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.grid.strategy; - -import com.refinedmods.refinedstorage.platform.api.grid.Grid; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") -@FunctionalInterface -public interface GridScrollingStrategyFactory { - GridScrollingStrategy create(AbstractContainerMenu containerMenu, ServerPlayer player, Grid grid); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/package-info.java deleted file mode 100644 index 082fc740f..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/strategy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/PlatformGridResource.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/PlatformGridResource.java deleted file mode 100644 index 5b61c320a..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/PlatformGridResource.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.grid.view; - -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.api.grid.view.GridResource; -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; - -import java.util.List; -import java.util.Optional; -import javax.annotation.Nullable; - -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.network.chat.Component; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") -public interface PlatformGridResource extends GridResource { - void onExtract(GridExtractMode extractMode, - boolean cursor, - GridExtractionStrategy extractionStrategy); - - void onScroll(GridScrollMode scrollMode, - GridScrollingStrategy scrollingStrategy); - - void render(GuiGraphics graphics, int x, int y); - - String getDisplayedAmount(); - - String getAmountInTooltip(); - - List getTooltip(); - - Optional getTooltipImage(); - - int getRegistryId(); - - List getExtractionHints(); - - @Nullable - PlatformResourceKey getUnderlyingResource(); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/package-info.java deleted file mode 100644 index eef99a6e0..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.grid.view; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/importer/ImporterTransferStrategyFactory.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/importer/ImporterTransferStrategyFactory.java deleted file mode 100644 index 1d6dc7c2f..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/importer/ImporterTransferStrategyFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.importer; - -import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.1") -@FunctionalInterface -public interface ImporterTransferStrategyFactory { - ImporterTransferStrategy create( - ServerLevel level, - BlockPos pos, - Direction direction, - UpgradeState upgradeState, - AmountOverride amountOverride - ); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/importer/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/importer/package-info.java deleted file mode 100644 index 3dac8fad9..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/importer/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.importer; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/package-info.java deleted file mode 100644 index 79c26c237..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/BuiltinPermissions.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/BuiltinPermissions.java deleted file mode 100644 index c1a9267b5..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/BuiltinPermissions.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.security; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5") -public record BuiltinPermissions( - PlatformPermission insert, - PlatformPermission extract, - PlatformPermission autocrafting, - PlatformPermission modify, - PlatformPermission build, - PlatformPermission security -) { -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/package-info.java deleted file mode 100644 index 6a27901c4..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/security/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.security; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/SerializableStorage.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/SerializableStorage.java deleted file mode 100644 index 77ae4446e..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/SerializableStorage.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.storage; - -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; - -import com.mojang.serialization.Codec; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.4") -public interface SerializableStorage extends Storage { - StorageType getType(); - - static Codec getCodec(final Runnable listener) { - return PlatformApi.INSTANCE.getStorageTypeRegistry() - .codec() - .dispatch(SerializableStorage::getType, storage -> storage.getMapCodec(listener)); - } -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/channel/FuzzyStorageChannel.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/channel/FuzzyStorageChannel.java deleted file mode 100644 index 2e765ec92..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/channel/FuzzyStorageChannel.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.storage.channel; - -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; - -import java.util.Collection; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4") -public interface FuzzyStorageChannel extends StorageChannel { - Collection getFuzzy(ResourceKey resource); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/channel/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/channel/package-info.java deleted file mode 100644 index f4fe1639f..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/channel/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.storage.channel; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/externalstorage/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/externalstorage/package-info.java deleted file mode 100644 index 9484f511b..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/externalstorage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.storage.externalstorage; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/package-info.java deleted file mode 100644 index 18db855f9..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.storage; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storagemonitor/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storagemonitor/package-info.java deleted file mode 100644 index 7f362e5db..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/storagemonitor/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.storagemonitor; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java deleted file mode 100644 index 94fe2078b..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.energy; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceHandlerItem; - -import java.util.List; -import java.util.Optional; - -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.InteractionResultHolder; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.item.context.UseOnContext; -import net.minecraft.world.level.Level; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") -public abstract class AbstractNetworkBoundEnergyItem extends AbstractEnergyItem implements SlotReferenceHandlerItem { - protected final NetworkBoundItemHelper networkBoundItemHelper; - - protected AbstractNetworkBoundEnergyItem(final Properties properties, - final EnergyItemHelper energyItemHelper, - final NetworkBoundItemHelper networkBoundItemHelper) { - super(properties, energyItemHelper); - this.networkBoundItemHelper = networkBoundItemHelper; - } - - @Override - public InteractionResult useOn(final UseOnContext ctx) { - return networkBoundItemHelper.bind(ctx); - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return networkBoundItemHelper.getTooltipImage(stack); - } - - @Override - public void appendHoverText(final ItemStack stack, - final TooltipContext context, - final List tooltip, - final TooltipFlag flag) { - super.appendHoverText(stack, context, tooltip, flag); - networkBoundItemHelper.addTooltip(stack, tooltip); - } - - @Override - public InteractionResultHolder use(final Level level, final Player player, final InteractionHand hand) { - final ItemStack stack = player.getItemInHand(hand); - if (player instanceof ServerPlayer serverPlayer && level.getServer() != null) { - final SlotReference slotReference = PlatformApi.INSTANCE.createInventorySlotReference(player, hand); - slotReference.resolve(player).ifPresent(s -> use(serverPlayer, s, slotReference)); - } - return InteractionResultHolder.consume(stack); - } - - @Override - public void use(final ServerPlayer player, final ItemStack stack, final SlotReference slotReference) { - final NetworkBoundItemSession session = PlatformApi.INSTANCE.getNetworkBoundItemHelper().openSession( - stack, - player, - slotReference - ); - use(player, slotReference, session); - } - - protected abstract void use(ServerPlayer player, SlotReference slotReference, NetworkBoundItemSession session); - - public boolean isBound(final ItemStack stack) { - return networkBoundItemHelper.isBound(stack); - } -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/TransferableBlockEntityEnergy.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/TransferableBlockEntityEnergy.java deleted file mode 100644 index 5fd19425c..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/TransferableBlockEntityEnergy.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.energy; - -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") -public interface TransferableBlockEntityEnergy { - EnergyStorage getEnergyStorage(); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/package-info.java deleted file mode 100644 index b08e1e454..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.support.energy; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/AbstractNetworkNodeContainerBlockEntity.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/AbstractNetworkNodeContainerBlockEntity.java deleted file mode 100644 index eee9544f5..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/AbstractNetworkNodeContainerBlockEntity.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.network; - -import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; - -import java.util.HashSet; -import java.util.Set; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.2") -public abstract class AbstractNetworkNodeContainerBlockEntity extends BlockEntity - implements NetworkNodeContainerBlockEntity, ConnectionLogic { - protected static final String MAIN_CONTAINER_NAME = "main"; - - protected final T mainNode; - protected final InWorldNetworkNodeContainer mainContainer; - - @Nullable - protected Runnable initializationCallback; - - private final Set containers = new HashSet<>(); - - protected AbstractNetworkNodeContainerBlockEntity(final BlockEntityType type, - final BlockPos pos, - final BlockState state, - final T mainNode) { - super(type, pos, state); - this.mainContainer = createMainContainer(mainNode); - addContainer(mainContainer); - this.mainNode = mainNode; - } - - protected InWorldNetworkNodeContainer createMainContainer(final T node) { - return PlatformApi.INSTANCE.createInWorldNetworkNodeContainer( - this, - node, - MAIN_CONTAINER_NAME, - 0, - this, - null - ); - } - - protected final void addContainer(final InWorldNetworkNodeContainer container) { - containers.add(container); - } - - protected final void updateContainers() { - containers.forEach(container -> PlatformApi.INSTANCE.onNetworkNodeContainerUpdated(container, level)); - } - - @Override - public void addOutgoingConnections(final ConnectionSink sink) { - for (final Direction direction : Direction.values()) { - sink.tryConnectInSameDimension(worldPosition.relative(direction), direction.getOpposite()); - } - } - - @Override - public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { - return true; - } - - @Override - public void clearRemoved() { - super.clearRemoved(); - containers.forEach(container -> PlatformApi.INSTANCE.onNetworkNodeContainerInitialized( - container, - level, - initializationCallback - )); - } - - @Override - public void setRemoved() { - super.setRemoved(); - containers.forEach(container -> PlatformApi.INSTANCE.onNetworkNodeContainerRemoved(container, level)); - } - - @Override - public Set getContainers() { - return containers; - } -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/ConnectionLogic.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/ConnectionLogic.java deleted file mode 100644 index 12f650612..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/ConnectionLogic.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.network; - -import net.minecraft.core.Direction; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.state.BlockState; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.6") -public interface ConnectionLogic { - /** - * Add outgoing connections here. - * Called when a node is about to be added into the network graph. - * If the outgoing connections ever change, call {@link - * com.refinedmods.refinedstorage.platform.api.PlatformApi#onNetworkNodeContainerUpdated( - *InWorldNetworkNodeContainer, Level)}. - * - * @param sink the sink that accepts outgoing connections - */ - void addOutgoingConnections(ConnectionSink sink); - - /** - * Returns whether the (not yet discovered) node can accept an incoming connection. - * Changes to this return value won't cause a rebuild of the network state. - * If the return value ever changes, call {@link - * com.refinedmods.refinedstorage.platform.api.PlatformApi#onNetworkNodeContainerUpdated( - *InWorldNetworkNodeContainer, Level)}. - * - * @param incomingDirection the incoming direction - * @param connectingState the state wanting to connect - * @return whether the node can accept an incoming connection - */ - boolean canAcceptIncomingConnection(Direction incomingDirection, BlockState connectingState); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/InWorldNetworkNodeContainer.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/InWorldNetworkNodeContainer.java deleted file mode 100644 index 218818e4b..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/InWorldNetworkNodeContainer.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.network; - -import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.GlobalPos; -import net.minecraft.world.level.block.state.BlockState; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.1") -public interface InWorldNetworkNodeContainer extends NetworkNodeContainer, ConnectionLogic { - BlockState getBlockState(); - - boolean isRemoved(); - - GlobalPos getPosition(); - - BlockPos getLocalPosition(); - - String getName(); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/NetworkNodeContainerBlockEntity.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/NetworkNodeContainerBlockEntity.java deleted file mode 100644 index a8342354c..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/NetworkNodeContainerBlockEntity.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.network; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.security.SecurityHelper; - -import java.util.Set; - -import net.minecraft.server.level.ServerPlayer; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.6") -@FunctionalInterface -public interface NetworkNodeContainerBlockEntity { - Set getContainers(); - - default boolean canBuild(final ServerPlayer player) { - return SecurityHelper.isAllowed(player, PlatformApi.INSTANCE.getBuiltinPermissions().build(), getContainers()); - } -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemHelper.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemHelper.java deleted file mode 100644 index a1082b94b..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemHelper.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.network.bounditem; - -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; - -import java.util.List; -import java.util.Optional; - -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.context.UseOnContext; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") -public interface NetworkBoundItemHelper { - void addTooltip(ItemStack stack, List lines); - - InteractionResult bind(UseOnContext ctx); - - Optional getTooltipImage(ItemStack stack); - - NetworkBoundItemSession openSession(ItemStack stack, ServerPlayer player, SlotReference slotReference); - - boolean isBound(ItemStack stack); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemSession.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemSession.java deleted file mode 100644 index bccff77aa..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemSession.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.network.bounditem; - -import com.refinedmods.refinedstorage.api.network.Network; - -import java.util.Optional; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") -public interface NetworkBoundItemSession { - Optional resolveNetwork(); - - boolean isActive(); - - void drainEnergy(long amount); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemTargetBlockEntity.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemTargetBlockEntity.java deleted file mode 100644 index 78b9ee5b0..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemTargetBlockEntity.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.network.bounditem; - -import com.refinedmods.refinedstorage.api.network.Network; - -import javax.annotation.Nullable; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.6") -public interface NetworkBoundItemTargetBlockEntity { - @Nullable - Network getNetworkForBoundItem(); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/package-info.java deleted file mode 100644 index 86700ed4f..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.support.network.bounditem; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/package-info.java deleted file mode 100644 index 7ae69f978..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.support.network; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/package-info.java deleted file mode 100644 index 12ffffcb9..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.support; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/registry/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/registry/package-info.java deleted file mode 100644 index eb299fc7e..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/registry/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.support.registry; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/list/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/list/package-info.java deleted file mode 100644 index 9e1d45101..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/list/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.support.resource.list; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/package-info.java deleted file mode 100644 index c8c9eb497..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.support.resource; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceFactory.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceFactory.java deleted file mode 100644 index aab1c8c84..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.support.slotreference; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.resources.ResourceLocation; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") -public interface SlotReferenceFactory { - StreamCodec STREAM_CODEC = StreamCodec.of( - (buf, slotReference) -> { - final ResourceLocation factoryId = PlatformApi.INSTANCE.getSlotReferenceFactoryRegistry() - .getId(slotReference.getFactory()) - .orElseThrow(); - buf.writeResourceLocation(factoryId); - slotReference.getFactory().getStreamCodec().encode(buf, slotReference); - }, - buf -> { - final ResourceLocation factoryId = buf.readResourceLocation(); - final SlotReferenceFactory factory = PlatformApi.INSTANCE.getSlotReferenceFactoryRegistry() - .get(factoryId) - .orElseThrow(); - return factory.getStreamCodec().decode(buf); - } - ); - - StreamCodec getStreamCodec(); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/package-info.java deleted file mode 100644 index 44928fbd8..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.support.slotreference; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/BuiltinUpgradeDestinations.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/BuiltinUpgradeDestinations.java deleted file mode 100644 index 0f824e073..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/BuiltinUpgradeDestinations.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.upgrade; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") -public interface BuiltinUpgradeDestinations { - UpgradeDestination getImporter(); - - UpgradeDestination getExporter(); - - UpgradeDestination getDestructor(); - - UpgradeDestination getConstructor(); - - UpgradeDestination getWirelessTransmitter(); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeItem.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeItem.java deleted file mode 100644 index 9af926696..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeItem.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.upgrade; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.10") -public interface UpgradeItem { - long getEnergyUsage(); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeState.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeState.java deleted file mode 100644 index c3a1c5dfe..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/UpgradeState.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.upgrade; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.10") -public interface UpgradeState { - boolean has(UpgradeItem upgradeItem); - - int getAmount(UpgradeItem upgradeItem); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/package-info.java deleted file mode 100644 index fb5602034..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.upgrade; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/wirelesstransmitter/WirelessTransmitter.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/wirelesstransmitter/WirelessTransmitter.java deleted file mode 100644 index 2ef7a63e5..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/wirelesstransmitter/WirelessTransmitter.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.wirelesstransmitter; - -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.level.Level; -import net.minecraft.world.phys.Vec3; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") -@FunctionalInterface -public interface WirelessTransmitter { - boolean isInRange(ResourceKey dimension, Vec3 position); -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/wirelesstransmitter/WirelessTransmitterRangeModifier.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/wirelesstransmitter/WirelessTransmitterRangeModifier.java deleted file mode 100644 index f90e85cb7..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/wirelesstransmitter/WirelessTransmitterRangeModifier.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.wirelesstransmitter; - -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") -@FunctionalInterface -public interface WirelessTransmitterRangeModifier { - int modifyRange(UpgradeState upgradeState, int range); - - default int getPriority() { - return 0; - } -} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/wirelesstransmitter/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/wirelesstransmitter/package-info.java deleted file mode 100644 index 3fdb688d4..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/wirelesstransmitter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.api.wirelesstransmitter; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/build.gradle.kts b/refinedstorage-platform-common/build.gradle.kts deleted file mode 100644 index 4d92d6eb1..000000000 --- a/refinedstorage-platform-common/build.gradle.kts +++ /dev/null @@ -1,32 +0,0 @@ -plugins { - id("refinedarchitect.common") -} - -refinedarchitect { - common() - testing() - javadoc() - publishing { - maven = true - } -} - -base { - archivesName.set("refinedstorage-platform-common") -} - -dependencies { - api(project(":refinedstorage-platform-api")) - api(project(":refinedstorage-core-api")) - api(project(":refinedstorage-resource-api")) - api(project(":refinedstorage-storage-api")) - api(project(":refinedstorage-network-api")) - api(project(":refinedstorage-network")) - api(project(":refinedstorage-query-parser")) - api(project(":refinedstorage-grid-api")) - testImplementation(libs.junit.api) - testImplementation(libs.junit.params) - testImplementation(libs.assertj) - testImplementation(libs.equalsverifier) - testRuntimeOnly(libs.junit.engine) -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractClientModInitializer.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractClientModInitializer.java deleted file mode 100644 index 4cebb7e41..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractClientModInitializer.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.ConstructorScreen; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.DestructorScreen; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.content.KeyMappings; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerScreen; -import com.refinedmods.refinedstorage.platform.common.detector.DetectorScreen; -import com.refinedmods.refinedstorage.platform.common.exporter.ExporterScreen; -import com.refinedmods.refinedstorage.platform.common.grid.GridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.WirelessGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.screen.CraftingGridScreen; -import com.refinedmods.refinedstorage.platform.common.grid.screen.GridScreen; -import com.refinedmods.refinedstorage.platform.common.grid.screen.hint.FluidGridInsertionHint; -import com.refinedmods.refinedstorage.platform.common.iface.InterfaceScreen; -import com.refinedmods.refinedstorage.platform.common.importer.ImporterScreen; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterScreen; -import com.refinedmods.refinedstorage.platform.common.networking.RelayScreen; -import com.refinedmods.refinedstorage.platform.common.security.FallbackSecurityCardScreen; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardScreen; -import com.refinedmods.refinedstorage.platform.common.security.SecurityManagerScreen; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.DiskDriveScreen; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.DiskInterfaceScreen; -import com.refinedmods.refinedstorage.platform.common.storage.externalstorage.ExternalStorageScreen; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridScreen; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.FluidStorageBlockScreen; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.ItemStorageBlockScreen; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.StorageMonitorScreen; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceRendering; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResourceRendering; -import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeScreen; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.WirelessTransmitterScreen; - -import net.minecraft.client.KeyMapping; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.screens.Screen; -import net.minecraft.client.gui.screens.inventory.MenuAccess; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.MenuType; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public abstract class AbstractClientModInitializer { - protected static void registerScreens(final ScreenRegistration registration) { - registration.register(Menus.INSTANCE.getDiskDrive(), DiskDriveScreen::new); - registration.register(Menus.INSTANCE.getGrid(), GridScreen::new); - registration.register(Menus.INSTANCE.getCraftingGrid(), CraftingGridScreen::new); - registration.register(Menus.INSTANCE.getWirelessGrid(), GridScreen::new); - registration.register(Menus.INSTANCE.getController(), ControllerScreen::new); - registration.register(Menus.INSTANCE.getItemStorage(), ItemStorageBlockScreen::new); - registration.register(Menus.INSTANCE.getFluidStorage(), FluidStorageBlockScreen::new); - registration.register(Menus.INSTANCE.getImporter(), ImporterScreen::new); - registration.register(Menus.INSTANCE.getExporter(), ExporterScreen::new); - registration.register(Menus.INSTANCE.getInterface(), InterfaceScreen::new); - registration.register(Menus.INSTANCE.getExternalStorage(), ExternalStorageScreen::new); - registration.register(Menus.INSTANCE.getDetector(), DetectorScreen::new); - registration.register(Menus.INSTANCE.getDestructor(), DestructorScreen::new); - registration.register(Menus.INSTANCE.getConstructor(), ConstructorScreen::new); - registration.register(Menus.INSTANCE.getRegulatorUpgrade(), RegulatorUpgradeScreen::new); - registration.register(Menus.INSTANCE.getWirelessTransmitter(), WirelessTransmitterScreen::new); - registration.register(Menus.INSTANCE.getStorageMonitor(), StorageMonitorScreen::new); - registration.register(Menus.INSTANCE.getNetworkTransmitter(), NetworkTransmitterScreen::new); - registration.register(Menus.INSTANCE.getPortableGridBlock(), PortableGridScreen::new); - registration.register(Menus.INSTANCE.getPortableGridItem(), PortableGridScreen::new); - registration.register(Menus.INSTANCE.getSecurityCard(), SecurityCardScreen::new); - registration.register(Menus.INSTANCE.getFallbackSecurityCard(), FallbackSecurityCardScreen::new); - registration.register(Menus.INSTANCE.getSecurityManager(), SecurityManagerScreen::new); - registration.register(Menus.INSTANCE.getRelay(), RelayScreen::new); - registration.register(Menus.INSTANCE.getDiskInterface(), DiskInterfaceScreen::new); - } - - protected static void registerAlternativeGridHints() { - PlatformApi.INSTANCE.addAlternativeGridInsertionHint(new FluidGridInsertionHint()); - } - - protected static void registerResourceRendering() { - PlatformApi.INSTANCE.registerResourceRendering(ItemResource.class, new ItemResourceRendering()); - PlatformApi.INSTANCE.registerResourceRendering(FluidResource.class, new FluidResourceRendering()); - } - - protected static void handleInputEvents() { - final Player player = Minecraft.getInstance().player; - if (player == null) { - return; - } - final KeyMapping openWirelessGrid = KeyMappings.INSTANCE.getOpenWirelessGrid(); - while (openWirelessGrid != null && openWirelessGrid.consumeClick()) { - PlatformApi.INSTANCE.useSlotReferencedItem( - player, - Items.INSTANCE.getWirelessGrid(), - Items.INSTANCE.getCreativeWirelessGrid() - ); - } - final KeyMapping openPortableGrid = KeyMappings.INSTANCE.getOpenPortableGrid(); - while (openPortableGrid != null && openPortableGrid.consumeClick()) { - PlatformApi.INSTANCE.useSlotReferencedItem( - player, - Items.INSTANCE.getPortableGrid(), - Items.INSTANCE.getCreativePortableGrid() - ); - } - } - - protected static void registerDiskModels() { - final ResourceLocation diskModel = createIdentifier("block/disk/disk"); - for (final ItemStorageType.Variant variant : ItemStorageType.Variant.values()) { - PlatformApi.INSTANCE.getStorageContainerItemHelper().registerDiskModel( - Items.INSTANCE.getItemStorageDisk(variant), - diskModel - ); - } - - final ResourceLocation fluidDiskModel = createIdentifier("block/disk/fluid_disk"); - for (final FluidStorageType.Variant variant : FluidStorageType.Variant.values()) { - PlatformApi.INSTANCE.getStorageContainerItemHelper().registerDiskModel( - Items.INSTANCE.getFluidStorageDisk(variant), - fluidDiskModel - ); - } - } - - @FunctionalInterface - public interface ScreenRegistration { - > void register(MenuType type, - ScreenConstructor - factory); - } - - @FunctionalInterface - public interface ScreenConstructor> { - U create(T menu, Inventory inventory, Component title); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractModInitializer.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractModInitializer.java deleted file mode 100644 index c16987a07..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractModInitializer.java +++ /dev/null @@ -1,886 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common; - -import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; -import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyNetworkComponentImpl; -import com.refinedmods.refinedstorage.api.network.impl.node.GraphNetworkComponentImpl; -import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage.api.network.impl.security.SecurityNetworkComponentImpl; -import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent; -import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.PlatformApiProxy; -import com.refinedmods.refinedstorage.platform.api.security.PlatformSecurityNetworkComponent; -import com.refinedmods.refinedstorage.platform.api.upgrade.AbstractUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.configurationcard.ConfigurationCardItem; -import com.refinedmods.refinedstorage.platform.common.configurationcard.ConfigurationCardState; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.BlockBreakDestructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.ConstructorBlockEntity; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.ConstructorContainerMenu; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.DestructorBlockEntity; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.DestructorContainerMenu; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.FluidBreakDestructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.ItemDropConstructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.ItemPickupDestructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.PlaceBlockConstructorStrategy; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.PlaceFireworksConstructorStrategy; -import com.refinedmods.refinedstorage.platform.common.constructordestructor.PlaceFluidConstructorStrategy; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntityTypeFactory; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.ContentIds; -import com.refinedmods.refinedstorage.platform.common.content.DataComponents; -import com.refinedmods.refinedstorage.platform.common.content.ExtendedMenuTypeFactory; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.content.LootFunctions; -import com.refinedmods.refinedstorage.platform.common.content.MenuTypeFactory; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.content.RegistryCallback; -import com.refinedmods.refinedstorage.platform.common.content.Sounds; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerContainerMenu; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerData; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerType; -import com.refinedmods.refinedstorage.platform.common.detector.DetectorBlockEntity; -import com.refinedmods.refinedstorage.platform.common.detector.DetectorContainerMenu; -import com.refinedmods.refinedstorage.platform.common.exporter.ExporterBlockEntity; -import com.refinedmods.refinedstorage.platform.common.exporter.ExporterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.GridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.grid.GridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.GridData; -import com.refinedmods.refinedstorage.platform.common.grid.PortableGridData; -import com.refinedmods.refinedstorage.platform.common.grid.WirelessGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.WirelessGridData; -import com.refinedmods.refinedstorage.platform.common.iface.InterfaceBlock; -import com.refinedmods.refinedstorage.platform.common.iface.InterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.iface.InterfaceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.iface.InterfaceData; -import com.refinedmods.refinedstorage.platform.common.importer.ImporterBlockEntity; -import com.refinedmods.refinedstorage.platform.common.importer.ImporterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.misc.ProcessorItem; -import com.refinedmods.refinedstorage.platform.common.misc.WrenchItem; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkCardItem; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkReceiverBlockEntity; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterBlockEntity; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkTransmitterData; -import com.refinedmods.refinedstorage.platform.common.networking.RelayBlockEntity; -import com.refinedmods.refinedstorage.platform.common.networking.RelayContainerMenu; -import com.refinedmods.refinedstorage.platform.common.security.BuiltinPermission; -import com.refinedmods.refinedstorage.platform.common.security.FallbackSecurityCardContainerMenu; -import com.refinedmods.refinedstorage.platform.common.security.PlatformSecurityNetworkComponentImpl; -import com.refinedmods.refinedstorage.platform.common.security.PlayerBoundSecurityCardData; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardBoundPlayer; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardContainerMenu; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardData; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardPermissions; -import com.refinedmods.refinedstorage.platform.common.security.SecurityManagerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.security.SecurityManagerContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.StorageTypes; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.DiskDriveBlock; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.DiskDriveContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.DiskInterfaceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.externalstorage.ExternalStorageBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.externalstorage.ExternalStorageContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.AbstractPortableGridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlock; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlockContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridItemContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridLootItemFunction; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridType; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.FluidStorageBlock; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.FluidStorageBlockBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.FluidStorageBlockBlockItem; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.FluidStorageBlockContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.ItemStorageBlock; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.ItemStorageBlockBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.ItemStorageBlockBlockItem; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.ItemStorageBlockContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.StorageBlockData; -import com.refinedmods.refinedstorage.platform.common.storage.storageblock.StorageBlockLootItemFunction; -import com.refinedmods.refinedstorage.platform.common.storage.storagedisk.FluidStorageDiskItem; -import com.refinedmods.refinedstorage.platform.common.storage.storagedisk.ItemStorageDiskItem; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.FluidStorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.FluidStorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.ItemStorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.ItemStorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.StorageMonitorBlock; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.StorageMonitorBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.StorageMonitorContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.SimpleBlock; -import com.refinedmods.refinedstorage.platform.common.support.SimpleItem; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.SingleAmountData; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyLootItemFunction; -import com.refinedmods.refinedstorage.platform.common.support.network.BaseNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.network.component.PlatformStorageNetworkComponent; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceFactory; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; -import com.refinedmods.refinedstorage.platform.common.support.slotreference.InventorySlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.common.upgrade.FortuneUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.upgrade.RangeUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeContainerMenu; -import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeState; -import com.refinedmods.refinedstorage.platform.common.upgrade.SimpleUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeWithEnchantedBookRecipeSerializer; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.BaseWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.CreativeRangeUpgradeWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.RangeUpgradeWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.WirelessTransmitterBlockEntity; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.WirelessTransmitterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.WirelessTransmitterData; - -import java.util.Optional; -import java.util.UUID; -import java.util.function.BiFunction; -import java.util.function.Supplier; - -import com.mojang.serialization.Codec; -import com.mojang.serialization.MapCodec; -import net.minecraft.core.BlockPos; -import net.minecraft.core.GlobalPos; -import net.minecraft.core.UUIDUtil; -import net.minecraft.core.component.DataComponentType; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.sounds.SoundEvent; -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.RecipeSerializer; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.functions.LootItemFunctionType; - -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CABLE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CONSTRUCTION_CORE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CONSTRUCTOR; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CONTROLLER; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CRAFTING_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CREATIVE_CONTROLLER; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CREATIVE_PORTABLE_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.DESTRUCTION_CORE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.DESTRUCTOR; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.DETECTOR; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.DISK_DRIVE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.DISK_INTERFACE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.EXPORTER; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.EXTERNAL_STORAGE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.FALLBACK_SECURITY_CARD; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.FLUID_STORAGE_BLOCK; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.IMPORTER; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.INTERFACE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.ITEM_STORAGE_BLOCK; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.MACHINE_CASING; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.NETWORK_RECEIVER; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.NETWORK_TRANSMITTER; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.PORTABLE_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.PROCESSOR_BINDING; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.QUARTZ_ENRICHED_COPPER; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.QUARTZ_ENRICHED_COPPER_BLOCK; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON_BLOCK; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.REGULATOR_UPGRADE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.RELAY; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.SECURITY_CARD; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.SECURITY_MANAGER; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.SILICON; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.STORAGE_BLOCK; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.STORAGE_HOUSING; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.STORAGE_MONITOR; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.WIRELESS_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.WIRELESS_TRANSMITTER; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.WRENCH; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.forFluidStorageBlock; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.forFluidStorageDisk; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.forFluidStoragePart; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.forItemStorageBlock; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.forItemStoragePart; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.forProcessor; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.forStorageDisk; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public abstract class AbstractModInitializer { - private static final String ITEM_REGISTRY_KEY = "item"; - private static final String FLUID_REGISTRY_KEY = "fluid"; - - protected final void initializePlatformApi() { - ((PlatformApiProxy) PlatformApi.INSTANCE).setDelegate(new PlatformApiImpl()); - registerStorageTypes(); - registerResourceTypes(); - registerAdditionalResourceFactories(); - registerDestructorStrategyFactories(); - registerConstructorStrategyFactories(); - registerStorageMonitorInsertionStrategies(); - registerStorageMonitorExtractionStrategies(); - registerNetworkComponents(); - registerWirelessTransmitterRangeModifiers(); - registerPermissions(); - registerInventorySlotReference(); - } - - private void registerStorageTypes() { - PlatformApi.INSTANCE.getStorageTypeRegistry().register( - createIdentifier(ITEM_REGISTRY_KEY), - StorageTypes.ITEM - ); - PlatformApi.INSTANCE.getStorageTypeRegistry().register( - createIdentifier(FLUID_REGISTRY_KEY), - StorageTypes.FLUID - ); - } - - private void registerResourceTypes() { - PlatformApi.INSTANCE.getResourceTypeRegistry().register( - createIdentifier(ITEM_REGISTRY_KEY), - ResourceTypes.ITEM - ); - PlatformApi.INSTANCE.getResourceTypeRegistry().register( - createIdentifier(FLUID_REGISTRY_KEY), - ResourceTypes.FLUID - ); - } - - private void registerAdditionalResourceFactories() { - PlatformApi.INSTANCE.addResourceFactory(new FluidResourceFactory()); - } - - private void registerDestructorStrategyFactories() { - PlatformApi.INSTANCE.addDestructorStrategyFactory(new BlockBreakDestructorStrategyFactory()); - PlatformApi.INSTANCE.addDestructorStrategyFactory(new FluidBreakDestructorStrategyFactory()); - PlatformApi.INSTANCE.addDestructorStrategyFactory(new ItemPickupDestructorStrategyFactory()); - } - - private void registerConstructorStrategyFactories() { - PlatformApi.INSTANCE.addConstructorStrategyFactory((level, pos, direction, upgradeState, dropItems) -> - Optional.of(new PlaceBlockConstructorStrategy(level, pos, direction))); - PlatformApi.INSTANCE.addConstructorStrategyFactory((level, pos, direction, upgradeState, dropItems) -> - Optional.of(new PlaceFireworksConstructorStrategy(level, pos, direction))); - PlatformApi.INSTANCE.addConstructorStrategyFactory((level, pos, direction, upgradeState, dropItems) -> - Optional.of(new PlaceFluidConstructorStrategy(level, pos, direction))); - PlatformApi.INSTANCE.addConstructorStrategyFactory(new ItemDropConstructorStrategyFactory()); - } - - private void registerStorageMonitorInsertionStrategies() { - PlatformApi.INSTANCE.addStorageMonitorInsertionStrategy(new ItemStorageMonitorInsertionStrategy()); - PlatformApi.INSTANCE.addStorageMonitorInsertionStrategy(new FluidStorageMonitorInsertionStrategy()); - } - - private void registerStorageMonitorExtractionStrategies() { - PlatformApi.INSTANCE.addStorageMonitorExtractionStrategy(new ItemStorageMonitorExtractionStrategy()); - PlatformApi.INSTANCE.addStorageMonitorExtractionStrategy(new FluidStorageMonitorExtractionStrategy()); - } - - private void registerNetworkComponents() { - PlatformApi.INSTANCE.getNetworkComponentMapFactory().addFactory( - EnergyNetworkComponent.class, - network -> new EnergyNetworkComponentImpl() - ); - PlatformApi.INSTANCE.getNetworkComponentMapFactory().addFactory( - GraphNetworkComponent.class, - GraphNetworkComponentImpl::new - ); - PlatformApi.INSTANCE.getNetworkComponentMapFactory().addFactory( - StorageNetworkComponent.class, - network -> new PlatformStorageNetworkComponent() - ); - PlatformApi.INSTANCE.getNetworkComponentMapFactory().addFactory( - PlatformSecurityNetworkComponent.class, - network -> new PlatformSecurityNetworkComponentImpl(PlatformApi.INSTANCE.createDefaultSecurityPolicy()) - ); - PlatformApi.INSTANCE.getNetworkComponentMapFactory().addFactory( - SecurityNetworkComponent.class, - network -> new SecurityNetworkComponentImpl(PlatformApi.INSTANCE.createDefaultSecurityPolicy()) - ); - } - - private void registerWirelessTransmitterRangeModifiers() { - PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier(new BaseWirelessTransmitterRangeModifier()); - PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier(new RangeUpgradeWirelessTransmitterRangeModifier()); - PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier( - new CreativeRangeUpgradeWirelessTransmitterRangeModifier() - ); - } - - private void registerPermissions() { - for (final BuiltinPermission permission : BuiltinPermission.values()) { - PlatformApi.INSTANCE.getPermissionRegistry().register(permission.getId(), permission); - } - } - - protected final void registerBlocks( - final RegistryCallback callback, - final BiFunction diskDriveBlockEntityFactory, - final BiFunction portableGridBlockEntityFactory, - final BiFunction creativePortableGridBlockEntityFactory, - final BiFunction diskInterfaceBlockEntityFactory - ) { - Blocks.INSTANCE.setQuartzEnrichedIronBlock(callback.register(QUARTZ_ENRICHED_IRON_BLOCK, SimpleBlock::new)); - Blocks.INSTANCE.setQuartzEnrichedCopperBlock(callback.register(QUARTZ_ENRICHED_COPPER_BLOCK, SimpleBlock::new)); - Blocks.INSTANCE.setDiskDrive( - callback.register(DISK_DRIVE, () -> new DiskDriveBlock(diskDriveBlockEntityFactory)) - ); - Blocks.INSTANCE.setMachineCasing(callback.register(MACHINE_CASING, SimpleBlock::new)); - for (final ItemStorageType.Variant variant : ItemStorageType.Variant.values()) { - Blocks.INSTANCE.setItemStorageBlock(variant, callback.register( - forItemStorageBlock(variant), - () -> new ItemStorageBlock(variant) - )); - } - for (final FluidStorageType.Variant variant : FluidStorageType.Variant.values()) { - Blocks.INSTANCE.setFluidStorageBlock(variant, callback.register( - forFluidStorageBlock(variant), - () -> new FluidStorageBlock(variant) - )); - } - Blocks.INSTANCE.getController().registerBlocks(callback); - Blocks.INSTANCE.getCreativeController().registerBlocks(callback); - Blocks.INSTANCE.getCable().registerBlocks(callback); - Blocks.INSTANCE.getGrid().registerBlocks(callback); - Blocks.INSTANCE.getCraftingGrid().registerBlocks(callback); - Blocks.INSTANCE.getDetector().registerBlocks(callback); - Blocks.INSTANCE.getImporter().registerBlocks(callback); - Blocks.INSTANCE.getExporter().registerBlocks(callback); - Blocks.INSTANCE.getExternalStorage().registerBlocks(callback); - Blocks.INSTANCE.getConstructor().registerBlocks(callback); - Blocks.INSTANCE.getDestructor().registerBlocks(callback); - Blocks.INSTANCE.setInterface(callback.register(INTERFACE, InterfaceBlock::new)); - Blocks.INSTANCE.getWirelessTransmitter().registerBlocks(callback); - Blocks.INSTANCE.setStorageMonitor(callback.register(STORAGE_MONITOR, StorageMonitorBlock::new)); - Blocks.INSTANCE.getNetworkReceiver().registerBlocks(callback); - Blocks.INSTANCE.getNetworkTransmitter().registerBlocks(callback); - Blocks.INSTANCE.setPortableGrid(callback.register(PORTABLE_GRID, () -> new PortableGridBlock( - PortableGridType.NORMAL, - portableGridBlockEntityFactory - ))); - Blocks.INSTANCE.setCreativePortableGrid(callback.register(CREATIVE_PORTABLE_GRID, () -> new PortableGridBlock( - PortableGridType.CREATIVE, - creativePortableGridBlockEntityFactory - ))); - Blocks.INSTANCE.getSecurityManager().registerBlocks(callback); - Blocks.INSTANCE.getRelay().registerBlocks(callback); - Blocks.INSTANCE.setDiskInterface(diskInterfaceBlockEntityFactory).registerBlocks(callback); - } - - protected final void registerItems(final RegistryCallback callback) { - registerSimpleItems(callback); - Blocks.INSTANCE.getGrid().registerItems(callback); - Blocks.INSTANCE.getCraftingGrid().registerItems(callback); - Blocks.INSTANCE.getCable().registerItems(callback, Items.INSTANCE::addCable); - Blocks.INSTANCE.getController().registerItems(callback, Items.INSTANCE::addController); - Blocks.INSTANCE.getCreativeController().registerItems(callback, Items.INSTANCE::addCreativeController); - Blocks.INSTANCE.getDetector().registerItems(callback, Items.INSTANCE::addDetector); - Blocks.INSTANCE.getImporter().registerItems(callback, Items.INSTANCE::addImporter); - Blocks.INSTANCE.getExporter().registerItems(callback, Items.INSTANCE::addExporter); - Blocks.INSTANCE.getExternalStorage().registerItems(callback, Items.INSTANCE::addExternalStorage); - Blocks.INSTANCE.getConstructor().registerItems(callback, Items.INSTANCE::addConstructor); - Blocks.INSTANCE.getDestructor().registerItems(callback, Items.INSTANCE::addDestructor); - Blocks.INSTANCE.getWirelessTransmitter().registerItems(callback, Items.INSTANCE::addWirelessTransmitter); - Blocks.INSTANCE.getNetworkReceiver().registerItems(callback, Items.INSTANCE::addNetworkReceiver); - Blocks.INSTANCE.getNetworkTransmitter().registerItems(callback, Items.INSTANCE::addNetworkTransmitter); - Blocks.INSTANCE.getSecurityManager().registerItems(callback, Items.INSTANCE::addSecurityManager); - Blocks.INSTANCE.getRelay().registerItems(callback, Items.INSTANCE::addRelay); - Blocks.INSTANCE.getDiskInterface().registerItems(callback, Items.INSTANCE::addDiskInterface); - registerStorageItems(callback); - registerUpgrades(callback); - } - - private void registerSimpleItems(final RegistryCallback callback) { - Items.INSTANCE.setQuartzEnrichedIron(callback.register(QUARTZ_ENRICHED_IRON, SimpleItem::new)); - Items.INSTANCE.setQuartzEnrichedCopper(callback.register(QUARTZ_ENRICHED_COPPER, SimpleItem::new)); - callback.register( - QUARTZ_ENRICHED_IRON_BLOCK, - () -> new BaseBlockItem(Blocks.INSTANCE.getQuartzEnrichedIronBlock()) - ); - callback.register( - QUARTZ_ENRICHED_COPPER_BLOCK, - () -> new BaseBlockItem(Blocks.INSTANCE.getQuartzEnrichedCopperBlock()) - ); - Items.INSTANCE.setSilicon(callback.register(SILICON, SimpleItem::new)); - Items.INSTANCE.setProcessorBinding(callback.register(PROCESSOR_BINDING, SimpleItem::new)); - callback.register(DISK_DRIVE, () -> Blocks.INSTANCE.getDiskDrive().createBlockItem()); - Items.INSTANCE.setWrench(callback.register(WRENCH, WrenchItem::new)); - Items.INSTANCE.setStorageHousing(callback.register(STORAGE_HOUSING, SimpleItem::new)); - callback.register(MACHINE_CASING, () -> new BaseBlockItem(Blocks.INSTANCE.getMachineCasing())); - callback.register(STORAGE_MONITOR, () -> Blocks.INSTANCE.getStorageMonitor().createBlockItem()); - callback.register(INTERFACE, () -> Blocks.INSTANCE.getInterface().createBlockItem()); - Items.INSTANCE.setConstructionCore(callback.register(CONSTRUCTION_CORE, SimpleItem::new)); - Items.INSTANCE.setDestructionCore(callback.register(DESTRUCTION_CORE, SimpleItem::new)); - for (final ProcessorItem.Type type : ProcessorItem.Type.values()) { - registerProcessor(callback, type); - } - Items.INSTANCE.setConfigurationCard(callback.register( - ContentIds.CONFIGURATION_CARD, - ConfigurationCardItem::new - )); - Items.INSTANCE.setNetworkCard(callback.register(ContentIds.NETWORK_CARD, NetworkCardItem::new)); - } - - private void registerProcessor(final RegistryCallback callback, final ProcessorItem.Type type) { - Items.INSTANCE.setProcessor(type, callback.register(forProcessor(type), ProcessorItem::new)); - } - - private void registerStorageItems(final RegistryCallback callback) { - for (final ItemStorageType.Variant variant : ItemStorageType.Variant.values()) { - registerItemStorageItems(callback, variant); - } - for (final FluidStorageType.Variant variant : FluidStorageType.Variant.values()) { - registerFluidStorageItems(callback, variant); - } - } - - private void registerItemStorageItems(final RegistryCallback callback, - final ItemStorageType.Variant variant) { - if (variant != ItemStorageType.Variant.CREATIVE) { - Items.INSTANCE.setItemStoragePart(variant, callback.register( - forItemStoragePart(variant), - SimpleItem::new) - ); - } - Items.INSTANCE.setItemStorageDisk(variant, callback.register( - forStorageDisk(variant), - () -> new ItemStorageDiskItem(variant) - )); - callback.register( - forItemStorageBlock(variant), - () -> new ItemStorageBlockBlockItem(Blocks.INSTANCE.getItemStorageBlock(variant), variant) - ); - } - - private void registerFluidStorageItems(final RegistryCallback callback, - final FluidStorageType.Variant variant) { - if (variant != FluidStorageType.Variant.CREATIVE) { - Items.INSTANCE.setFluidStoragePart(variant, callback.register( - forFluidStoragePart(variant), - SimpleItem::new) - ); - } - Items.INSTANCE.setFluidStorageDisk(variant, callback.register( - forFluidStorageDisk(variant), - () -> new FluidStorageDiskItem(variant) - )); - callback.register( - forFluidStorageBlock(variant), - () -> new FluidStorageBlockBlockItem(Blocks.INSTANCE.getFluidStorageBlock(variant), variant) - ); - } - - private void registerUpgrades(final RegistryCallback callback) { - Items.INSTANCE.setUpgrade(callback.register( - ContentIds.UPGRADE, - SimpleItem::new - )); - final Supplier speedUpgrade = callback.register( - ContentIds.SPEED_UPGRADE, - SimpleUpgradeItem::speedUpgrade - ); - Items.INSTANCE.setSpeedUpgrade(speedUpgrade); - final Supplier stackUpgrade = callback.register( - ContentIds.STACK_UPGRADE, - SimpleUpgradeItem::stackUpgrade - ); - Items.INSTANCE.setStackUpgrade(stackUpgrade); - final Supplier fortune1Upgrade = callback.register( - ContentIds.FORTUNE_1_UPGRADE, - () -> new FortuneUpgradeItem(PlatformApi.INSTANCE.getUpgradeRegistry(), 1) - ); - Items.INSTANCE.setFortune1Upgrade(fortune1Upgrade); - final Supplier fortune2Upgrade = callback.register( - ContentIds.FORTUNE_2_UPGRADE, - () -> new FortuneUpgradeItem(PlatformApi.INSTANCE.getUpgradeRegistry(), 2) - ); - Items.INSTANCE.setFortune2Upgrade(fortune2Upgrade); - final Supplier fortune3Upgrade = callback.register( - ContentIds.FORTUNE_3_UPGRADE, - () -> new FortuneUpgradeItem(PlatformApi.INSTANCE.getUpgradeRegistry(), 3) - ); - Items.INSTANCE.setFortune3Upgrade(fortune3Upgrade); - final Supplier silkTouchUpgrade = callback.register( - ContentIds.SILK_TOUCH_UPGRADE, - SimpleUpgradeItem::silkTouchUpgrade - ); - Items.INSTANCE.setSilkTouchUpgrade(silkTouchUpgrade); - Items.INSTANCE.setRangeUpgrade(callback.register( - ContentIds.RANGE_UPGRADE, - () -> new RangeUpgradeItem(PlatformApi.INSTANCE.getUpgradeRegistry(), false) - )); - Items.INSTANCE.setCreativeRangeUpgrade(callback.register( - ContentIds.CREATIVE_RANGE_UPGRADE, - () -> new RangeUpgradeItem(PlatformApi.INSTANCE.getUpgradeRegistry(), true) - )); - } - - protected final void registerUpgradeMappings() { - PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.IMPORTER) - .add(Items.INSTANCE.getSpeedUpgrade(), 4) - .add(Items.INSTANCE.getStackUpgrade()) - .add(Items.INSTANCE.getRegulatorUpgrade()); - - PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.EXPORTER) - .add(Items.INSTANCE.getSpeedUpgrade(), 4) - .add(Items.INSTANCE.getStackUpgrade()) - .add(Items.INSTANCE.getRegulatorUpgrade()); - - PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.DESTRUCTOR) - .add(Items.INSTANCE.getSpeedUpgrade(), 4) - .add(Items.INSTANCE.getFortune1Upgrade()) - .add(Items.INSTANCE.getFortune2Upgrade()) - .add(Items.INSTANCE.getFortune3Upgrade()) - .add(Items.INSTANCE.getSilkTouchUpgrade()); - - PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.CONSTRUCTOR) - .add(Items.INSTANCE.getSpeedUpgrade(), 4) - .add(Items.INSTANCE.getStackUpgrade()); - - PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.WIRELESS_TRANSMITTER) - .add(Items.INSTANCE.getRangeUpgrade(), 4) - .add(Items.INSTANCE.getCreativeRangeUpgrade()); - - PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.DISK_INTERFACE) - .add(Items.INSTANCE.getSpeedUpgrade(), 4) - .add(Items.INSTANCE.getStackUpgrade()); - } - - protected final void registerBlockEntities( - final RegistryCallback> callback, - final BlockEntityTypeFactory typeFactory, - final BlockEntityTypeFactory.BlockEntitySupplier diskDriveBlockEntitySupplier, - final BlockEntityTypeFactory.BlockEntitySupplier - portableGridBlockEntitySupplier, - final BlockEntityTypeFactory.BlockEntitySupplier - creativePortableGridBlockEntitySupplier, - final BlockEntityTypeFactory.BlockEntitySupplier - diskInterfaceBlockEntitySupplier - ) { - BlockEntities.INSTANCE.setCable(callback.register( - CABLE, - () -> typeFactory.create((pos, state) -> new BaseNetworkNodeContainerBlockEntity<>( - BlockEntities.INSTANCE.getCable(), - pos, - state, - new SimpleNetworkNode(Platform.INSTANCE.getConfig().getCable().getEnergyUsage()) - ), Blocks.INSTANCE.getCable().toArray()) - )); - BlockEntities.INSTANCE.setController(callback.register( - CONTROLLER, - () -> typeFactory.create( - (pos, state) -> new ControllerBlockEntity(ControllerType.NORMAL, pos, state), - Blocks.INSTANCE.getController().toArray() - ) - )); - BlockEntities.INSTANCE.setCreativeController(callback.register( - CREATIVE_CONTROLLER, - () -> typeFactory.create( - (pos, state) -> new ControllerBlockEntity(ControllerType.CREATIVE, pos, state), - Blocks.INSTANCE.getCreativeController().toArray() - ) - )); - BlockEntities.INSTANCE.setDiskDrive(callback.register( - DISK_DRIVE, - () -> typeFactory.create(diskDriveBlockEntitySupplier, Blocks.INSTANCE.getDiskDrive()) - )); - BlockEntities.INSTANCE.setGrid(callback.register( - GRID, - () -> typeFactory.create(GridBlockEntity::new, Blocks.INSTANCE.getGrid().toArray()) - )); - BlockEntities.INSTANCE.setCraftingGrid(callback.register( - CRAFTING_GRID, - () -> typeFactory.create(CraftingGridBlockEntity::new, Blocks.INSTANCE.getCraftingGrid().toArray()) - )); - for (final ItemStorageType.Variant variant : ItemStorageType.Variant.values()) { - BlockEntities.INSTANCE.setItemStorageBlock(variant, callback.register( - forItemStorageBlock(variant), - () -> typeFactory.create( - (pos, state) -> new ItemStorageBlockBlockEntity(pos, state, variant), - Blocks.INSTANCE.getItemStorageBlock(variant) - ) - )); - } - for (final FluidStorageType.Variant variant : FluidStorageType.Variant.values()) { - BlockEntities.INSTANCE.setFluidStorageBlock(variant, callback.register( - forFluidStorageBlock(variant), - () -> typeFactory.create( - (pos, state) -> new FluidStorageBlockBlockEntity(pos, state, variant), - Blocks.INSTANCE.getFluidStorageBlock(variant) - ) - )); - } - BlockEntities.INSTANCE.setImporter(callback.register( - IMPORTER, - () -> typeFactory.create(ImporterBlockEntity::new, Blocks.INSTANCE.getImporter().toArray()) - - )); - BlockEntities.INSTANCE.setExporter(callback.register( - EXPORTER, - () -> typeFactory.create(ExporterBlockEntity::new, Blocks.INSTANCE.getExporter().toArray()) - - )); - BlockEntities.INSTANCE.setInterface(callback.register( - INTERFACE, - () -> typeFactory.create(InterfaceBlockEntity::new, Blocks.INSTANCE.getInterface()) - )); - BlockEntities.INSTANCE.setExternalStorage(callback.register( - EXTERNAL_STORAGE, - () -> typeFactory.create(ExternalStorageBlockEntity::new, Blocks.INSTANCE.getExternalStorage().toArray()) - )); - BlockEntities.INSTANCE.setDetector(callback.register( - DETECTOR, - () -> typeFactory.create(DetectorBlockEntity::new, Blocks.INSTANCE.getDetector().toArray()) - )); - BlockEntities.INSTANCE.setConstructor(callback.register( - CONSTRUCTOR, - () -> typeFactory.create(ConstructorBlockEntity::new, Blocks.INSTANCE.getConstructor().toArray()) - )); - BlockEntities.INSTANCE.setDestructor(callback.register( - DESTRUCTOR, - () -> typeFactory.create(DestructorBlockEntity::new, Blocks.INSTANCE.getDestructor().toArray()) - )); - BlockEntities.INSTANCE.setWirelessTransmitter(callback.register( - WIRELESS_TRANSMITTER, - () -> typeFactory.create( - WirelessTransmitterBlockEntity::new, - Blocks.INSTANCE.getWirelessTransmitter().toArray() - ) - )); - BlockEntities.INSTANCE.setStorageMonitor(callback.register( - STORAGE_MONITOR, - () -> typeFactory.create(StorageMonitorBlockEntity::new, Blocks.INSTANCE.getStorageMonitor()) - )); - BlockEntities.INSTANCE.setNetworkReceiver(callback.register( - NETWORK_RECEIVER, - () -> typeFactory.create(NetworkReceiverBlockEntity::new, Blocks.INSTANCE.getNetworkReceiver().toArray()) - )); - BlockEntities.INSTANCE.setNetworkTransmitter(callback.register( - NETWORK_TRANSMITTER, - () -> typeFactory.create( - NetworkTransmitterBlockEntity::new, - Blocks.INSTANCE.getNetworkTransmitter().toArray() - ) - )); - BlockEntities.INSTANCE.setPortableGrid(callback.register( - PORTABLE_GRID, - () -> typeFactory.create(portableGridBlockEntitySupplier::create, Blocks.INSTANCE.getPortableGrid()) - )); - BlockEntities.INSTANCE.setCreativePortableGrid(callback.register( - CREATIVE_PORTABLE_GRID, - () -> typeFactory.create( - creativePortableGridBlockEntitySupplier::create, - Blocks.INSTANCE.getCreativePortableGrid() - ) - )); - BlockEntities.INSTANCE.setSecurityManager(callback.register( - SECURITY_MANAGER, - () -> typeFactory.create( - SecurityManagerBlockEntity::new, - Blocks.INSTANCE.getSecurityManager().toArray() - ) - )); - BlockEntities.INSTANCE.setRelay(callback.register( - RELAY, - () -> typeFactory.create(RelayBlockEntity::new, Blocks.INSTANCE.getRelay().toArray()) - )); - BlockEntities.INSTANCE.setDiskInterface(callback.register( - DISK_INTERFACE, - () -> typeFactory.create(diskInterfaceBlockEntitySupplier, Blocks.INSTANCE.getDiskInterface().toArray()) - )); - } - - protected final void registerMenus(final RegistryCallback> callback, - final MenuTypeFactory menuTypeFactory, - final ExtendedMenuTypeFactory extendedMenuTypeFactory) { - Menus.INSTANCE.setController(callback.register( - CONTROLLER, - () -> extendedMenuTypeFactory.create(ControllerContainerMenu::new, ControllerData.STREAM_CODEC) - )); - Menus.INSTANCE.setDiskDrive(callback.register( - DISK_DRIVE, - () -> extendedMenuTypeFactory.create(DiskDriveContainerMenu::new, ResourceContainerData.STREAM_CODEC) - )); - Menus.INSTANCE.setGrid(callback.register( - GRID, - () -> extendedMenuTypeFactory.create(GridContainerMenu::new, GridData.STREAM_CODEC) - )); - Menus.INSTANCE.setCraftingGrid(callback.register( - CRAFTING_GRID, - () -> extendedMenuTypeFactory.create(CraftingGridContainerMenu::new, GridData.STREAM_CODEC) - )); - Menus.INSTANCE.setWirelessGrid(callback.register( - WIRELESS_GRID, - () -> extendedMenuTypeFactory.create(WirelessGridContainerMenu::new, WirelessGridData.STREAM_CODEC) - )); - Menus.INSTANCE.setItemStorage(callback.register( - ITEM_STORAGE_BLOCK, - () -> extendedMenuTypeFactory.create(ItemStorageBlockContainerMenu::new, StorageBlockData.STREAM_CODEC) - )); - Menus.INSTANCE.setFluidStorage(callback.register( - FLUID_STORAGE_BLOCK, - () -> extendedMenuTypeFactory.create(FluidStorageBlockContainerMenu::new, StorageBlockData.STREAM_CODEC) - )); - Menus.INSTANCE.setImporter(callback.register( - IMPORTER, - () -> extendedMenuTypeFactory.create(ImporterContainerMenu::new, ResourceContainerData.STREAM_CODEC) - )); - Menus.INSTANCE.setExporter(callback.register( - EXPORTER, - () -> extendedMenuTypeFactory.create(ExporterContainerMenu::new, ResourceContainerData.STREAM_CODEC) - )); - Menus.INSTANCE.setInterface(callback.register( - INTERFACE, - () -> extendedMenuTypeFactory.create(InterfaceContainerMenu::new, InterfaceData.STREAM_CODEC) - )); - Menus.INSTANCE.setExternalStorage(callback.register( - EXTERNAL_STORAGE, - () -> extendedMenuTypeFactory.create(ExternalStorageContainerMenu::new, ResourceContainerData.STREAM_CODEC) - )); - Menus.INSTANCE.setDetector(callback.register( - DETECTOR, - () -> extendedMenuTypeFactory.create(DetectorContainerMenu::new, SingleAmountData.STREAM_CODEC) - )); - Menus.INSTANCE.setDestructor(callback.register( - DESTRUCTOR, - () -> extendedMenuTypeFactory.create(DestructorContainerMenu::new, ResourceContainerData.STREAM_CODEC) - )); - Menus.INSTANCE.setConstructor(callback.register( - CONSTRUCTOR, - () -> extendedMenuTypeFactory.create(ConstructorContainerMenu::new, ResourceContainerData.STREAM_CODEC) - )); - Menus.INSTANCE.setRegulatorUpgrade(callback.register( - REGULATOR_UPGRADE, - () -> extendedMenuTypeFactory.create(RegulatorUpgradeContainerMenu::new, SingleAmountData.STREAM_CODEC) - )); - Menus.INSTANCE.setWirelessTransmitter(callback.register( - WIRELESS_TRANSMITTER, - () -> extendedMenuTypeFactory.create(WirelessTransmitterContainerMenu::new, - WirelessTransmitterData.STREAM_CODEC) - )); - Menus.INSTANCE.setStorageMonitor(callback.register( - STORAGE_MONITOR, - () -> extendedMenuTypeFactory.create(StorageMonitorContainerMenu::new, ResourceContainerData.STREAM_CODEC) - )); - Menus.INSTANCE.setNetworkTransmitter(callback.register( - NETWORK_TRANSMITTER, - () -> extendedMenuTypeFactory.create(NetworkTransmitterContainerMenu::new, - NetworkTransmitterData.STREAM_CODEC) - )); - Menus.INSTANCE.setPortableGridBlock(callback.register( - createIdentifier("portable_grid_block"), - () -> extendedMenuTypeFactory.create(PortableGridBlockContainerMenu::new, PortableGridData.STREAM_CODEC) - )); - Menus.INSTANCE.setPortableGridItem(callback.register( - createIdentifier("portable_grid_item"), - () -> extendedMenuTypeFactory.create(PortableGridItemContainerMenu::new, PortableGridData.STREAM_CODEC) - )); - Menus.INSTANCE.setSecurityCard(callback.register( - SECURITY_CARD, - () -> extendedMenuTypeFactory.create(SecurityCardContainerMenu::new, - PlayerBoundSecurityCardData.STREAM_CODEC) - )); - Menus.INSTANCE.setFallbackSecurityCard(callback.register( - FALLBACK_SECURITY_CARD, - () -> extendedMenuTypeFactory.create(FallbackSecurityCardContainerMenu::new, SecurityCardData.STREAM_CODEC) - )); - Menus.INSTANCE.setSecurityManager(callback.register( - SECURITY_MANAGER, - () -> menuTypeFactory.create(SecurityManagerContainerMenu::new) - )); - Menus.INSTANCE.setRelay(callback.register( - RELAY, - () -> extendedMenuTypeFactory.create(RelayContainerMenu::new, ResourceContainerData.STREAM_CODEC) - )); - Menus.INSTANCE.setDiskInterface(callback.register( - DISK_INTERFACE, - () -> extendedMenuTypeFactory.create(DiskInterfaceContainerMenu::new, ResourceContainerData.STREAM_CODEC) - )); - } - - protected final void registerLootFunctions(final RegistryCallback> callback) { - LootFunctions.INSTANCE.setStorageBlock(callback.register( - STORAGE_BLOCK, - () -> new LootItemFunctionType<>(MapCodec.unit(new StorageBlockLootItemFunction())) - )); - LootFunctions.INSTANCE.setPortableGrid(callback.register( - PORTABLE_GRID, - () -> new LootItemFunctionType<>(MapCodec.unit(new PortableGridLootItemFunction())) - )); - LootFunctions.INSTANCE.setEnergy(callback.register( - createIdentifier("energy"), - () -> new LootItemFunctionType<>(MapCodec.unit(new EnergyLootItemFunction())) - )); - } - - protected final void registerSounds(final RegistryCallback callback) { - Sounds.INSTANCE.setWrench(callback.register( - WRENCH, - () -> SoundEvent.createVariableRangeEvent(WRENCH) - )); - } - - protected final void registerRecipeSerializers(final RegistryCallback> callback) { - callback.register( - createIdentifier("upgrade_with_enchanted_book"), - UpgradeWithEnchantedBookRecipeSerializer::new - ); - } - - protected final void registerDataComponents(final RegistryCallback> callback) { - DataComponents.INSTANCE.setEnergy( - callback.register(createIdentifier("energy"), () -> DataComponentType.builder() - .persistent(Codec.LONG) - .networkSynchronized(ByteBufCodecs.VAR_LONG) - .build())); - DataComponents.INSTANCE.setNetworkLocation( - callback.register(createIdentifier("network_location"), () -> DataComponentType.builder() - .persistent(GlobalPos.CODEC) - .networkSynchronized(GlobalPos.STREAM_CODEC) - .build())); - DataComponents.INSTANCE.setStorageReference( - callback.register(createIdentifier("storage_reference"), () -> DataComponentType.builder() - .persistent(UUIDUtil.CODEC) - .networkSynchronized(UUIDUtil.STREAM_CODEC) - .build())); - DataComponents.INSTANCE.setRegulatorUpgradeState( - callback.register(createIdentifier("regulator_upgrade_state"), - () -> DataComponentType.builder() - .persistent(RegulatorUpgradeState.CODEC) - .networkSynchronized(RegulatorUpgradeState.STREAM_CODEC) - .build())); - DataComponents.INSTANCE.setSecurityCardBoundPlayer( - callback.register(createIdentifier("security_card_bound_player"), - () -> DataComponentType.builder() - .persistent(SecurityCardBoundPlayer.CODEC) - .networkSynchronized(SecurityCardBoundPlayer.STREAM_CODEC) - .build())); - DataComponents.INSTANCE.setSecurityCardPermissions( - callback.register(createIdentifier("security_card_permissions"), - () -> DataComponentType.builder() - .persistent(SecurityCardPermissions.CODEC) - .networkSynchronized(SecurityCardPermissions.STREAM_CODEC) - .build())); - DataComponents.INSTANCE.setConfigurationCardState( - callback.register(createIdentifier("configuration_card_state"), - () -> DataComponentType.builder() - .persistent(ConfigurationCardState.CODEC) - .networkSynchronized(ConfigurationCardState.STREAM_CODEC) - .build())); - } - - protected final void registerInventorySlotReference() { - PlatformApi.INSTANCE.getSlotReferenceFactoryRegistry().register( - createIdentifier("inventory"), - InventorySlotReferenceFactory.INSTANCE - ); - } - - protected static boolean allowComponentsUpdateAnimation(final ItemStack oldStack, final ItemStack newStack) { - return oldStack.getItem() != newStack.getItem(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Platform.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Platform.java deleted file mode 100644 index 86186925d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Platform.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.MenuOpener; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.TransferManager; -import com.refinedmods.refinedstorage.platform.common.support.render.FluidRenderer; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import java.util.List; -import java.util.Optional; -import java.util.UUID; -import javax.annotation.Nullable; - -import net.minecraft.client.KeyMapping; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.components.EditBox; -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.NonNullList; -import net.minecraft.network.chat.Component; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.sounds.SoundEvent; -import net.minecraft.world.Container; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.CraftingContainer; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.CraftingInput; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.LevelReader; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.LiquidBlock; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.BlockHitResult; - -public interface Platform { - Platform INSTANCE = new PlatformProxy(); - - MenuOpener getMenuOpener(); - - long getBucketAmount(); - - Config getConfig(); - - boolean canEditBoxLoseFocus(EditBox editBox); - - boolean isKeyDown(KeyMapping keyMapping); - - GridResourceFactory getItemGridResourceFactory(); - - GridResourceFactory getFluidGridResourceFactory(); - - GridInsertionStrategyFactory getDefaultGridInsertionStrategyFactory(); - - FluidRenderer getFluidRenderer(); - - Optional getContainedFluid(ItemStack stack); - - Optional convertToBucket(FluidResource fluidResource); - - TransferManager createTransferManager(AbstractContainerMenu containerMenu); - - long insertIntoContainer(Container container, ItemResource itemResource, long amount, Action action); - - ItemStack getCloneItemStack(BlockState state, Level level, BlockHitResult hitResult, Player player); - - NonNullList getRemainingCraftingItems(Player player, - CraftingRecipe craftingRecipe, - CraftingInput input); - - void onItemCrafted(Player player, ItemStack craftedStack, CraftingContainer container); - - Player getFakePlayer(ServerLevel level, @Nullable UUID playerId); - - boolean canBreakBlock(Level level, BlockPos pos, BlockState state, Player player); - - boolean placeBlock(Level level, BlockPos pos, Direction direction, Player player, ItemStack stack); - - boolean placeFluid(Level level, BlockPos pos, Direction direction, Player player, FluidResource fluidResource); - - ItemStack getBlockAsItemStack(Block block, - BlockState state, - Direction direction, - LevelReader level, - BlockPos pos, - Player player); - - Optional getBucketPickupSound(LiquidBlock liquidBlock, BlockState state); - - List processTooltipComponents( - ItemStack stack, - GuiGraphics graphics, - int mouseX, - Optional imageComponent, - List components - ); - - void renderTooltip(GuiGraphics graphics, List components, int x, int y); - - Optional getEnergyStorage(ItemStack stack); - - void sendPacketToServer(T packet); - - void sendPacketToClient(ServerPlayer player, T packet); - - record ContainedFluid(ItemStack remainderContainer, FluidResource fluid, long amount) { - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java deleted file mode 100644 index 8cf2c9d94..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java +++ /dev/null @@ -1,576 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common; - -import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.NetworkBuilder; -import com.refinedmods.refinedstorage.api.network.NetworkComponent; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.api.network.impl.NetworkBuilderImpl; -import com.refinedmods.refinedstorage.api.network.impl.NetworkFactory; -import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHints; -import com.refinedmods.refinedstorage.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.security.BuiltinPermissions; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItemHelper; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.api.storage.StorageType; -import com.refinedmods.refinedstorage.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.energy.EnergyItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionLogic; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.api.support.network.NetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; -import com.refinedmods.refinedstorage.platform.api.support.resource.RecipeModIngredientConverter; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; -import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; -import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.platform.common.grid.NoopGridSynchronizer; -import com.refinedmods.refinedstorage.platform.common.grid.screen.hint.GridInsertionHintsImpl; -import com.refinedmods.refinedstorage.platform.common.grid.screen.hint.ItemGridInsertionHint; -import com.refinedmods.refinedstorage.platform.common.grid.screen.hint.SingleItemGridInsertionHint; -import com.refinedmods.refinedstorage.platform.common.grid.strategy.CompositeGridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.common.grid.strategy.CompositeGridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.grid.strategy.CompositeGridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.common.security.BuiltinPermission; -import com.refinedmods.refinedstorage.platform.common.storage.ClientStorageRepository; -import com.refinedmods.refinedstorage.platform.common.storage.StorageContainerItemHelperImpl; -import com.refinedmods.refinedstorage.platform.common.storage.StorageRepositoryImpl; -import com.refinedmods.refinedstorage.platform.common.storage.StorageTypes; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.CompositeStorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.CompositeStorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyItemHelperImpl; -import com.refinedmods.refinedstorage.platform.common.support.energy.ItemBlockEnergyStorage; -import com.refinedmods.refinedstorage.platform.common.support.energy.ItemEnergyStorage; -import com.refinedmods.refinedstorage.platform.common.support.network.ConnectionProviderImpl; -import com.refinedmods.refinedstorage.platform.common.support.network.InWorldNetworkNodeContainerImpl; -import com.refinedmods.refinedstorage.platform.common.support.network.bounditem.NetworkBoundItemHelperImpl; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.S2CPackets; -import com.refinedmods.refinedstorage.platform.common.support.registry.PlatformRegistryImpl; -import com.refinedmods.refinedstorage.platform.common.support.resource.CompositeRecipeModIngredientConverter; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceFactory; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResourceFactory; -import com.refinedmods.refinedstorage.platform.common.support.slotreference.CompositeSlotReferenceProvider; -import com.refinedmods.refinedstorage.platform.common.support.slotreference.InventorySlotReference; -import com.refinedmods.refinedstorage.platform.common.upgrade.BuiltinUpgradeDestinationsImpl; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeRegistryImpl; -import com.refinedmods.refinedstorage.platform.common.util.ServerEventQueue; -import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.CompositeWirelessTransmitterRangeModifier; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.PriorityQueue; -import java.util.Queue; -import java.util.Set; -import java.util.function.Supplier; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.saveddata.SavedData; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; -import static java.util.Objects.requireNonNull; - -public class PlatformApiImpl implements PlatformApi { - private final StorageRepository clientStorageRepository = new ClientStorageRepository( - C2SPackets::sendStorageInfoRequest - ); - private final ComponentMapFactory networkComponentMapFactory = - new ComponentMapFactory<>(); - private final NetworkBuilder networkBuilder = - new NetworkBuilderImpl(new NetworkFactory(networkComponentMapFactory)); - private final PlatformRegistry storageTypeRegistry = new PlatformRegistryImpl<>(); - private final PlatformRegistry resourceTypeRegistry = new PlatformRegistryImpl<>(); - private final PlatformRegistry gridSynchronizerRegistry = new PlatformRegistryImpl<>(); - private final PlatformRegistry importerTransferStrategyRegistry = - new PlatformRegistryImpl<>(); - private final PlatformRegistry exporterTransferStrategyRegistry = - new PlatformRegistryImpl<>(); - private final UpgradeRegistry upgradeRegistry = new UpgradeRegistryImpl(); - private final BuiltinUpgradeDestinations builtinUpgradeDestinations = new BuiltinUpgradeDestinationsImpl(); - private final Queue externalStorageProviderFactories = new PriorityQueue<>( - Comparator.comparingInt(PlatformExternalStorageProviderFactory::getPriority) - ); - private final Queue destructorStrategyFactories = new PriorityQueue<>( - Comparator.comparingInt(DestructorStrategyFactory::getPriority) - ); - private final Queue constructorStrategyFactories = new PriorityQueue<>( - Comparator.comparingInt(ConstructorStrategyFactory::getPriority) - ); - private final CompositeStorageMonitorInsertionStrategy storageMonitorInsertionStrategy = - new CompositeStorageMonitorInsertionStrategy(); - private final CompositeStorageMonitorExtractionStrategy storageMonitorExtractionStrategy = - new CompositeStorageMonitorExtractionStrategy(); - private final CompositeRecipeModIngredientConverter ingredientConverter = - new CompositeRecipeModIngredientConverter(); - private final StorageContainerItemHelper storageContainerItemHelper = new StorageContainerItemHelperImpl(); - private final List gridInsertionStrategyFactories = new ArrayList<>(); - private final GridInsertionHintsImpl gridInsertionHints = new GridInsertionHintsImpl( - new ItemGridInsertionHint(), - new SingleItemGridInsertionHint() - ); - private final List gridExtractionStrategyFactories = new ArrayList<>(); - private final List gridScrollingStrategyFactories = new ArrayList<>(); - private final ResourceFactory itemResourceFactory = new ItemResourceFactory(); - private final ResourceFactory fluidResourceFactory = new FluidResourceFactory(); - private final Set resourceFactories = new HashSet<>(); - private final Map, ResourceRendering> resourceRenderingMap = new HashMap<>(); - private final CompositeWirelessTransmitterRangeModifier wirelessTransmitterRangeModifier = - new CompositeWirelessTransmitterRangeModifier(); - private final EnergyItemHelper energyItemHelper = new EnergyItemHelperImpl(); - private final NetworkBoundItemHelper networkBoundItemHelper = new NetworkBoundItemHelperImpl(); - private final PlatformRegistry slotReferenceFactoryRegistry = new PlatformRegistryImpl<>(); - private final CompositeSlotReferenceProvider slotReferenceProvider = new CompositeSlotReferenceProvider(); - private final PlatformRegistry permissionRegistry = new PlatformRegistryImpl<>(); - - public PlatformApiImpl() { - gridSynchronizerRegistry.register(createIdentifier("off"), NoopGridSynchronizer.INSTANCE); - } - - @Override - public PlatformRegistry getStorageTypeRegistry() { - return storageTypeRegistry; - } - - @Override - public StorageRepository getClientStorageRepository() { - return clientStorageRepository; - } - - @SuppressWarnings("DataFlowIssue") // NeoForge makes null datafixer safe - @Override - public StorageRepository getStorageRepository(final Level level) { - final ServerLevel serverLevel = requireNonNull(level.getServer().getLevel(Level.OVERWORLD)); - return serverLevel.getDataStorage().computeIfAbsent(new SavedData.Factory<>( - StorageRepositoryImpl::new, - StorageRepositoryImpl::new, - null - ), StorageRepositoryImpl.NAME); - } - - @Override - public StorageContainerItemHelper getStorageContainerItemHelper() { - return storageContainerItemHelper; - } - - @Override - public PlatformRegistry getResourceTypeRegistry() { - return resourceTypeRegistry; - } - - @Override - public PlatformRegistry getImporterTransferStrategyRegistry() { - return importerTransferStrategyRegistry; - } - - @Override - public PlatformRegistry getExporterTransferStrategyRegistry() { - return exporterTransferStrategyRegistry; - } - - @Override - public void addExternalStorageProviderFactory(final PlatformExternalStorageProviderFactory factory) { - externalStorageProviderFactories.add(factory); - } - - @Override - public Collection getExternalStorageProviderFactories() { - return externalStorageProviderFactories; - } - - @Override - public Collection getDestructorStrategyFactories() { - return destructorStrategyFactories; - } - - @Override - public void addDestructorStrategyFactory(final DestructorStrategyFactory factory) { - destructorStrategyFactories.add(factory); - } - - @Override - public Collection getConstructorStrategyFactories() { - return constructorStrategyFactories; - } - - @Override - public void addConstructorStrategyFactory(final ConstructorStrategyFactory factory) { - constructorStrategyFactories.add(factory); - } - - @Override - public void addStorageMonitorExtractionStrategy(final StorageMonitorExtractionStrategy strategy) { - storageMonitorExtractionStrategy.addStrategy(strategy); - } - - @Override - public StorageMonitorExtractionStrategy getStorageMonitorExtractionStrategy() { - return storageMonitorExtractionStrategy; - } - - @Override - public void addStorageMonitorInsertionStrategy(final StorageMonitorInsertionStrategy strategy) { - storageMonitorInsertionStrategy.addStrategy(strategy); - } - - @Override - public StorageMonitorInsertionStrategy getStorageMonitorInsertionStrategy() { - return storageMonitorInsertionStrategy; - } - - @Override - public ComponentMapFactory getNetworkComponentMapFactory() { - return networkComponentMapFactory; - } - - @Override - public PlatformRegistry getGridSynchronizerRegistry() { - return gridSynchronizerRegistry; - } - - @Override - public UpgradeRegistry getUpgradeRegistry() { - return upgradeRegistry; - } - - @Override - public BuiltinUpgradeDestinations getBuiltinUpgradeDestinations() { - return builtinUpgradeDestinations; - } - - @Override - public InWorldNetworkNodeContainer createInWorldNetworkNodeContainer( - final BlockEntity blockEntity, - final NetworkNode node, - final String name, - final int priority, - final ConnectionLogic connectionLogic, - @Nullable final Supplier keyProvider - ) { - return new InWorldNetworkNodeContainerImpl(blockEntity, node, name, priority, connectionLogic, keyProvider); - } - - @Override - public void onNetworkNodeContainerInitialized(final InWorldNetworkNodeContainer container, - @Nullable final Level level, - @Nullable final Runnable callback) { - if (level == null || level.isClientSide()) { - return; - } - final ConnectionProviderImpl connectionProvider = new ConnectionProviderImpl(level); - ServerEventQueue.queue(() -> { - // The container could've been removed by the time it has been placed, and by the time the event queue has - // run. In that case, don't initialize the network node because it no longer exists. - // This is a workaround for the "Carry On" mod. The mod places the block (which creates a block entity and - // requests this network node initialization) and then overrides the placed block entity with their own - // block entity. This triggers a new initialization, but then this one can no longer run! - if (container.isRemoved()) { - return; - } - networkBuilder.initialize(container, connectionProvider); - if (callback != null) { - callback.run(); - } - }); - } - - @Override - public void onNetworkNodeContainerRemoved(final InWorldNetworkNodeContainer container, - @Nullable final Level level) { - if (level == null || level.isClientSide()) { - return; - } - // "Carry On" mod places the block (which creates a block entity and requests network node initialization) - // and then overrides the placed block entity with their own information. - // However, when the placed block entity is replaced, the server event queue hasn't run yet and there is - // no network loaded yet, even though the network node initialization was requested. - // Stop continuing here to avoid further code failing due to a missing network. - if (container.getNode().getNetwork() == null) { - return; - } - final ConnectionProviderImpl connectionProvider = new ConnectionProviderImpl(level); - networkBuilder.remove(container, connectionProvider); - } - - @Override - public void onNetworkNodeContainerUpdated(final InWorldNetworkNodeContainer container, - @Nullable final Level level) { - if (level == null || level.isClientSide() || container.getNode().getNetwork() == null) { - return; - } - final ConnectionProviderImpl connectionProvider = new ConnectionProviderImpl(level); - networkBuilder.update(container, connectionProvider); - } - - @Override - public GridInsertionStrategy createGridInsertionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - return new CompositeGridInsertionStrategy( - Platform.INSTANCE.getDefaultGridInsertionStrategyFactory().create( - containerMenu, - player, - grid - ), - gridInsertionStrategyFactories.stream().map(f -> f.create( - containerMenu, - player, - grid - )).toList() - ); - } - - @Override - public void addGridInsertionStrategyFactory(final GridInsertionStrategyFactory insertionStrategyFactory) { - gridInsertionStrategyFactories.add(insertionStrategyFactory); - } - - @Override - public void addAlternativeGridInsertionHint(final GridInsertionHint hint) { - gridInsertionHints.addAlternativeHint(hint); - } - - @Override - public GridInsertionHints getGridInsertionHints() { - return gridInsertionHints; - } - - @Override - public GridExtractionStrategy createGridExtractionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - final List strategies = gridExtractionStrategyFactories - .stream() - .map(f -> f.create(containerMenu, player, grid)) - .toList(); - return new CompositeGridExtractionStrategy(strategies); - } - - @Override - public void addGridExtractionStrategyFactory(final GridExtractionStrategyFactory extractionStrategyFactory) { - gridExtractionStrategyFactories.add(extractionStrategyFactory); - } - - @Override - public GridScrollingStrategy createGridScrollingStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - final List strategies = gridScrollingStrategyFactories - .stream() - .map(f -> f.create(containerMenu, player, grid)) - .toList(); - return new CompositeGridScrollingStrategy(strategies); - } - - @Override - public void addGridScrollingStrategyFactory(final GridScrollingStrategyFactory scrollingStrategyFactory) { - gridScrollingStrategyFactories.add(scrollingStrategyFactory); - } - - @Override - public void addResourceFactory(final ResourceFactory factory) { - resourceFactories.add(factory); - } - - @Override - public ResourceFactory getItemResourceFactory() { - return itemResourceFactory; - } - - @Override - public StorageType getItemStorageType() { - return StorageTypes.ITEM; - } - - @Override - public ResourceFactory getFluidResourceFactory() { - return fluidResourceFactory; - } - - @Override - public StorageType getFluidStorageType() { - return StorageTypes.FLUID; - } - - @Override - public Set getAlternativeResourceFactories() { - return resourceFactories; - } - - @Override - public void registerResourceRendering(final Class resourceClass, - final ResourceRendering rendering) { - resourceRenderingMap.put(resourceClass, rendering); - } - - @Override - public ResourceRendering getResourceRendering(final ResourceKey resource) { - return resourceRenderingMap.get(resource.getClass()); - } - - @Override - public void addIngredientConverter(final RecipeModIngredientConverter converter) { - ingredientConverter.addConverter(converter); - } - - @Override - public RecipeModIngredientConverter getIngredientConverter() { - return ingredientConverter; - } - - @Override - public void addWirelessTransmitterRangeModifier(final WirelessTransmitterRangeModifier rangeModifier) { - wirelessTransmitterRangeModifier.addModifier(rangeModifier); - } - - @Override - public WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier() { - return wirelessTransmitterRangeModifier; - } - - @Override - public Optional getEnergyStorage(final ItemStack stack) { - return Platform.INSTANCE.getEnergyStorage(stack); - } - - @Override - public EnergyItemHelper getEnergyItemHelper() { - return energyItemHelper; - } - - @Override - public EnergyStorage asItemEnergyStorage(final EnergyStorage energyStorage, - final ItemStack stack) { - return new ItemEnergyStorage(stack, energyStorage); - } - - @Override - public EnergyStorage asBlockItemEnergyStorage(final EnergyStorage energyStorage, - final ItemStack stack, - final BlockEntityType blockEntityType) { - return new ItemBlockEnergyStorage(energyStorage, stack, blockEntityType); - } - - @Override - public NetworkBoundItemHelper getNetworkBoundItemHelper() { - return networkBoundItemHelper; - } - - @Override - public PlatformRegistry getSlotReferenceFactoryRegistry() { - return slotReferenceFactoryRegistry; - } - - @Override - public void addSlotReferenceProvider(final SlotReferenceProvider provider) { - slotReferenceProvider.addProvider(provider); - } - - @Override - public SlotReference createInventorySlotReference(final Player player, final InteractionHand hand) { - return InventorySlotReference.of(player, hand); - } - - @Override - public void useSlotReferencedItem(final Player player, final Item... items) { - final Set validItems = new HashSet<>(Arrays.asList(items)); - slotReferenceProvider.findForUse(player, items[0], validItems).ifPresent(C2SPackets::sendUseSlotReferencedItem); - } - - @Override - public BuiltinPermissions getBuiltinPermissions() { - return BuiltinPermission.VIEW; - } - - @Override - public PlatformRegistry getPermissionRegistry() { - return permissionRegistry; - } - - @Override - public SecurityPolicy createDefaultSecurityPolicy() { - return new SecurityPolicy(permissionRegistry.getAll() - .stream() - .filter(PlatformPermission::isAllowedByDefault) - .collect(Collectors.toSet())); - } - - @Override - public void sendNoPermissionToOpenMessage(final ServerPlayer player, final Component target) { - sendNoPermissionMessage(player, createTranslation("misc", "no_permission.open", target)); - } - - @Override - public void sendNoPermissionMessage(final ServerPlayer player, final Component message) { - S2CPackets.sendNoPermission(player, message); - } - - @Override - public boolean canPlaceNetworkNode(final ServerPlayer player, - final Level level, - final BlockPos pos, - final BlockState state) { - for (final Direction direction : Direction.values()) { - final BlockPos adjacentPos = pos.relative(direction); - final BlockEntity adjacentBlockEntity = level.getBlockEntity(adjacentPos); - if (!(adjacentBlockEntity instanceof NetworkNodeContainerBlockEntity adjacentContainerBlockEntity)) { - continue; - } - if (!adjacentContainerBlockEntity.canBuild(player)) { - PlatformApi.INSTANCE.sendNoPermissionMessage( - player, - createTranslation("misc", "no_permission.build.place", state.getBlock().getName()) - ); - return false; - } - } - return true; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/package-info.java deleted file mode 100644 index 1bd7a4c31..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.configurationcard; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractItemConstructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractItemConstructorStrategy.java deleted file mode 100644 index 30d356e43..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractItemConstructorStrategy.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategy; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; - -abstract class AbstractItemConstructorStrategy implements ConstructorStrategy { - protected final ServerLevel level; - protected final BlockPos pos; - protected final Direction direction; - - AbstractItemConstructorStrategy(final ServerLevel level, final BlockPos pos, final Direction direction) { - this.level = level; - this.pos = pos; - this.direction = direction; - } - - protected long getTransferAmount() { - return 1; - } - - @Override - public final boolean apply( - final ResourceKey resource, - final Actor actor, - final Player actingPlayer, - final Network network - ) { - if (!level.isLoaded(pos)) { - return false; - } - if (!(resource instanceof ItemResource itemResource)) { - return false; - } - final StorageChannel storageChannel = network.getComponent(StorageNetworkComponent.class); - final long amount = getTransferAmount(); - final long extractedAmount = storageChannel.extract(itemResource, amount, Action.SIMULATE, actor); - if (extractedAmount == 0) { - return false; - } - final ItemStack itemStack = itemResource.toItemStack(extractedAmount); - final boolean success = apply(itemResource, itemStack, actor, actingPlayer); - if (success) { - storageChannel.extract(itemResource, extractedAmount, Action.EXECUTE, actor); - } - return success; - } - - protected abstract boolean apply( - ItemResource itemResource, - ItemStack itemStack, - Actor actor, - Player actingPlayer - ); - - protected double getDispensePositionX() { - return pos.getX() + 0.5D; - } - - protected double getDispensePositionY() { - return pos.getY() + (direction == Direction.DOWN ? 0.45D : 0.5D); - } - - protected double getDispensePositionZ() { - return pos.getZ() + 0.5D; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/CompositeConstructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/CompositeConstructorStrategy.java deleted file mode 100644 index f8bac9b87..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/CompositeConstructorStrategy.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategy; - -import java.util.Collections; -import java.util.List; - -import net.minecraft.world.entity.player.Player; - -class CompositeConstructorStrategy implements ConstructorStrategy { - private final List strategies; - - CompositeConstructorStrategy(final List strategies) { - this.strategies = Collections.unmodifiableList(strategies); - } - - @Override - public boolean apply(final ResourceKey resource, - final Actor actor, - final Player actingPlayer, - final Network network) { - for (final ConstructorStrategy strategy : strategies) { - if (strategy.apply(resource, actor, actingPlayer, network)) { - return true; - } - } - return false; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/CompositeDestructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/CompositeDestructorStrategy.java deleted file mode 100644 index 76fc966c0..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/CompositeDestructorStrategy.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.resource.filter.Filter; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategy; - -import java.util.Collections; -import java.util.List; -import java.util.function.Supplier; - -import net.minecraft.world.entity.player.Player; - -class CompositeDestructorStrategy implements DestructorStrategy { - private final List strategies; - - CompositeDestructorStrategy(final List strategies) { - this.strategies = Collections.unmodifiableList(strategies); - } - - @Override - public boolean apply(final Filter filter, - final Actor actor, - final Supplier networkSupplier, - final Player actingPlayer) { - for (final DestructorStrategy strategy : strategies) { - if (strategy.apply(filter, actor, networkSupplier, actingPlayer)) { - return true; - } - } - return false; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorBlock.java deleted file mode 100644 index 99658bcaf..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorBlock.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ConstructorBlock extends AbstractConstructorDestructorBlock< - ConstructorBlock, ConstructorBlockEntity, BaseBlockItem - > implements BlockItemProvider { - private static final Component HELP = createTranslation("item", "constructor.help"); - - public ConstructorBlock(final DyeColor color, final MutableComponent name) { - super(color, name, new NetworkNodeBlockEntityTicker<>( - BlockEntities.INSTANCE::getConstructor, - ACTIVE - )); - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getConstructor(); - } - - @Nullable - @Override - public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { - return new ConstructorBlockEntity(blockPos, blockState); - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorContainerMenu.java deleted file mode 100644 index 4406b8c09..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorContainerMenu.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSchedulingContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; - -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ConstructorContainerMenu extends AbstractSchedulingContainerMenu { - private static final MutableComponent FILTER_HELP = createTranslation("gui", "constructor.filter_help"); - - public ConstructorContainerMenu(final int syncId, - final Inventory playerInventory, - final ResourceContainerData resourceContainerData) { - super( - Menus.INSTANCE.getConstructor(), - syncId, - playerInventory.player, - resourceContainerData, - UpgradeDestinations.CONSTRUCTOR, - FILTER_HELP - ); - } - - ConstructorContainerMenu(final int syncId, - final Player player, - final ConstructorBlockEntity constructor, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { - super( - Menus.INSTANCE.getConstructor(), - syncId, - player, - resourceContainer, - upgradeContainer, - constructor, - FILTER_HELP - ); - } - - @Override - protected void registerClientProperties() { - super.registerClientProperties(); - registerProperty(new ClientProperty<>(ConstructorDestructorPropertyTypes.DROP_ITEMS, false)); - } - - @Override - protected void registerServerProperties(final ConstructorBlockEntity blockEntity) { - super.registerServerProperties(blockEntity); - registerProperty(new ServerProperty<>( - ConstructorDestructorPropertyTypes.DROP_ITEMS, - blockEntity::isDropItems, - blockEntity::setDropItems - )); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorDestructorPropertyTypes.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorDestructorPropertyTypes.java deleted file mode 100644 index f81b1cd8a..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorDestructorPropertyTypes.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -final class ConstructorDestructorPropertyTypes { - static final PropertyType PICKUP_ITEMS = PropertyTypes.createBooleanProperty( - createIdentifier("pickup_items") - ); - static final PropertyType DROP_ITEMS = PropertyTypes.createBooleanProperty( - createIdentifier("drop_items") - ); - - private ConstructorDestructorPropertyTypes() { - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java deleted file mode 100644 index a9b5917c5..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractYesNoSideButtonWidget; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -class ConstructorDropItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { - ConstructorDropItemsSideButtonWidget(final ClientProperty property) { - super(property, createTranslation("gui", "constructor.drop_items")); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 80 : 64; - } - - @Override - protected int getYTexture() { - return 16; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorScreen.java deleted file mode 100644 index 6ed01109e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorScreen.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.common.support.AbstractFilterScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.widget.SchedulingModeSideButtonWidget; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; - -public class ConstructorScreen extends AbstractFilterScreen { - public ConstructorScreen(final ConstructorContainerMenu menu, - final Inventory playerInventory, - final Component text) { - super(menu, playerInventory, text); - } - - @Override - protected void init() { - super.init(); - addSideButton(new FuzzyModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.FUZZY_MODE), - () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK - )); - addSideButton(new SchedulingModeSideButtonWidget(getMenu().getProperty(PropertyTypes.SCHEDULING_MODE))); - addSideButton(new ConstructorDropItemsSideButtonWidget( - getMenu().getProperty(ConstructorDestructorPropertyTypes.DROP_ITEMS) - )); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorBlock.java deleted file mode 100644 index d8bcf6cf0..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorBlock.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class DestructorBlock extends AbstractConstructorDestructorBlock< - DestructorBlock, DestructorBlockEntity, BaseBlockItem - > implements BlockItemProvider { - private static final Component HELP = createTranslation("item", "destructor.help"); - - public DestructorBlock(final DyeColor color, final MutableComponent name) { - super(color, name, new NetworkNodeBlockEntityTicker<>( - BlockEntities.INSTANCE::getDestructor, - ACTIVE - )); - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getDestructor(); - } - - @Nullable - @Override - public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { - return new DestructorBlockEntity(blockPos, blockState); - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorContainerMenu.java deleted file mode 100644 index 73a3452da..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorContainerMenu.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSimpleFilterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; - -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class DestructorContainerMenu extends AbstractSimpleFilterContainerMenu { - private static final MutableComponent FILTER_HELP = createTranslation("gui", "destructor.filter_help"); - - public DestructorContainerMenu(final int syncId, - final Inventory playerInventory, - final ResourceContainerData resourceContainerData) { - super( - Menus.INSTANCE.getDestructor(), - syncId, - playerInventory.player, - resourceContainerData, - UpgradeDestinations.DESTRUCTOR, - FILTER_HELP - ); - } - - DestructorContainerMenu(final int syncId, - final Player player, - final DestructorBlockEntity destructor, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { - super( - Menus.INSTANCE.getDestructor(), - syncId, - player, - resourceContainer, - upgradeContainer, - destructor, - FILTER_HELP - ); - } - - @Override - protected void registerClientProperties() { - registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - registerProperty(new ClientProperty<>(PropertyTypes.FILTER_MODE, FilterMode.BLOCK)); - registerProperty(new ClientProperty<>(ConstructorDestructorPropertyTypes.PICKUP_ITEMS, false)); - } - - @Override - protected void registerServerProperties(final DestructorBlockEntity blockEntity) { - registerProperty(new ServerProperty<>( - PropertyTypes.REDSTONE_MODE, - blockEntity::getRedstoneMode, - blockEntity::setRedstoneMode - )); - registerProperty(new ServerProperty<>( - PropertyTypes.FILTER_MODE, - blockEntity::getFilterMode, - blockEntity::setFilterMode - )); - registerProperty(new ServerProperty<>( - ConstructorDestructorPropertyTypes.PICKUP_ITEMS, - blockEntity::isPickupItems, - blockEntity::setPickupItems - )); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java deleted file mode 100644 index ab3af7fe7..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractYesNoSideButtonWidget; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -class DestructorPickupItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { - DestructorPickupItemsSideButtonWidget(final ClientProperty property) { - super(property, createTranslation("gui", "destructor.pickup_items")); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 64 : 80; - } - - @Override - protected int getYTexture() { - return 0; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorScreen.java deleted file mode 100644 index b1137fc1d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorScreen.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.common.storage.FilterModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.AbstractFilterScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class DestructorScreen extends AbstractFilterScreen { - public DestructorScreen(final DestructorContainerMenu menu, final Inventory playerInventory, final Component text) { - super(menu, playerInventory, text); - } - - @Override - protected void init() { - super.init(); - addSideButton(new FilterModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.FILTER_MODE), - createTranslation("gui", "destructor.filter_mode.allow.help"), - createTranslation("gui", "destructor.filter_mode.block.help") - )); - addSideButton(new DestructorPickupItemsSideButtonWidget( - getMenu().getProperty(ConstructorDestructorPropertyTypes.PICKUP_ITEMS) - )); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/FluidBreakDestructorStrategyFactory.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/FluidBreakDestructorStrategyFactory.java deleted file mode 100644 index c4b3a49c5..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/FluidBreakDestructorStrategyFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategy; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; - -import java.util.Optional; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; - -public class FluidBreakDestructorStrategyFactory implements DestructorStrategyFactory { - @Override - public Optional create(final ServerLevel level, - final BlockPos pos, - final Direction direction, - final UpgradeState upgradeState, - final boolean pickupItems) { - return Optional.of(new FluidBreakDestructorStrategy(level, pos)); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategyFactory.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategyFactory.java deleted file mode 100644 index ee9b0b2fc..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategyFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategy; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.common.content.Items; - -import java.util.Optional; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; - -public class ItemDropConstructorStrategyFactory implements ConstructorStrategyFactory { - @Override - public Optional create(final ServerLevel level, - final BlockPos pos, - final Direction direction, - final UpgradeState upgradeState, - final boolean dropItems) { - if (!dropItems) { - return Optional.empty(); - } - return Optional.of(new ItemDropConstructorStrategy( - level, - pos, - direction, - upgradeState.has(Items.INSTANCE.getStackUpgrade()) - )); - } - - @Override - public int getPriority() { - return -1; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemPickupDestructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemPickupDestructorStrategy.java deleted file mode 100644 index 483ee6164..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemPickupDestructorStrategy.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.resource.filter.Filter; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategy; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import java.util.List; -import java.util.function.Supplier; - -import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.item.ItemEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.phys.AABB; - -class ItemPickupDestructorStrategy implements DestructorStrategy { - private final ServerLevel level; - private final BlockPos pos; - - ItemPickupDestructorStrategy(final ServerLevel level, final BlockPos pos) { - this.level = level; - this.pos = pos; - } - - @Override - public boolean apply(final Filter filter, - final Actor actor, - final Supplier networkSupplier, - final Player actingPlayer) { - if (!level.isLoaded(pos)) { - return false; - } - final StorageChannel storageChannel = networkSupplier.get().getComponent(StorageNetworkComponent.class); - final List items = level.getEntitiesOfClass(ItemEntity.class, new AABB(pos)); - for (final ItemEntity itemEntity : items) { - tryInsert(filter, actor, storageChannel, itemEntity); - } - return true; - } - - private void tryInsert(final Filter filter, - final Actor actor, - final StorageChannel storageChannel, - final ItemEntity itemEntity) { - if (itemEntity.isRemoved()) { - return; - } - final ItemStack itemStack = itemEntity.getItem(); - final ItemResource itemResource = ItemResource.ofItemStack(itemStack); - if (!filter.isAllowed(itemResource)) { - return; - } - final int amount = itemStack.getCount(); - final long inserted = storageChannel.insert(itemResource, amount, Action.EXECUTE, actor); - itemStack.shrink((int) inserted); - if (itemStack.isEmpty()) { - itemEntity.discard(); - } - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemPickupDestructorStrategyFactory.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemPickupDestructorStrategyFactory.java deleted file mode 100644 index 58b2d98d1..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemPickupDestructorStrategyFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategy; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; - -import java.util.Optional; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; - -public class ItemPickupDestructorStrategyFactory implements DestructorStrategyFactory { - @Override - public Optional create(final ServerLevel level, - final BlockPos pos, - final Direction direction, - final UpgradeState upgradeState, - final boolean pickupItems) { - if (!pickupItems) { - return Optional.empty(); - } - return Optional.of(new ItemPickupDestructorStrategy(level, pos)); - } - - @Override - public int getPriority() { - return -1; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java deleted file mode 100644 index fc9a8800c..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.ItemStack; - -public class PlaceBlockConstructorStrategy extends AbstractItemConstructorStrategy { - public PlaceBlockConstructorStrategy( - final ServerLevel level, - final BlockPos pos, - final Direction direction - ) { - super(level, pos, direction); - } - - @Override - protected boolean apply( - final ItemResource itemResource, - final ItemStack itemStack, - final Actor actor, - final Player actingPlayer - ) { - if (!(itemStack.getItem() instanceof BlockItem)) { - return false; - } - return Platform.INSTANCE.placeBlock(level, pos, direction, actingPlayer, itemStack); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFluidConstructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFluidConstructorStrategy.java deleted file mode 100644 index 4b8cfe1dd..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFluidConstructorStrategy.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategy; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.player.Player; - -public class PlaceFluidConstructorStrategy implements ConstructorStrategy { - protected final ServerLevel level; - protected final BlockPos pos; - protected final Direction direction; - - public PlaceFluidConstructorStrategy(final ServerLevel level, final BlockPos pos, final Direction direction) { - this.level = level; - this.pos = pos; - this.direction = direction; - } - - @Override - public boolean apply( - final ResourceKey resource, - final Actor actor, - final Player actingPlayer, - final Network network - ) { - if (!level.isLoaded(pos)) { - return false; - } - if (!(resource instanceof FluidResource fluidResource)) { - return false; - } - final StorageChannel storageChannel = network.getComponent(StorageNetworkComponent.class); - final long bucketAmount = Platform.INSTANCE.getBucketAmount(); - final long extractedAmount = storageChannel.extract( - fluidResource, - bucketAmount, - Action.SIMULATE, - actor - ); - if (bucketAmount != extractedAmount) { - return false; - } - final boolean success = Platform.INSTANCE.placeFluid(level, pos, direction, actingPlayer, fluidResource); - if (success) { - storageChannel.extract(fluidResource, bucketAmount, Action.EXECUTE, actor); - } - return success; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/package-info.java deleted file mode 100644 index e56d19073..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/package-info.java deleted file mode 100644 index 98aa40e05..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.content; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlockItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlockItem.java deleted file mode 100644 index b4c5c3887..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerBlockItem.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.controller; - -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyStorageImpl; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.support.energy.AbstractEnergyBlockItem; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; - -import java.util.Optional; - -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.context.BlockPlaceContext; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ControllerBlockItem extends AbstractEnergyBlockItem { - private final Block block; - - ControllerBlockItem(final Block block) { - super(block, new Item.Properties().stacksTo(1), PlatformApi.INSTANCE.getEnergyItemHelper()); - this.block = block; - } - - @Override - public Component getDescription() { - return block.getName(); - } - - @Override - public Component getName(final ItemStack stack) { - return block.getName(); - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return Optional.of(new HelpTooltipComponent(createTranslation("item", "controller.help"))); - } - - public EnergyStorage createEnergyStorage(final ItemStack stack) { - final EnergyStorage energyStorage = new EnergyStorageImpl( - Platform.INSTANCE.getConfig().getController().getEnergyCapacity() - ); - return PlatformApi.INSTANCE.asBlockItemEnergyStorage( - energyStorage, - stack, - BlockEntities.INSTANCE.getController() - ); - } - - @Override - protected boolean placeBlock(final BlockPlaceContext ctx, final BlockState state) { - if (ctx.getPlayer() instanceof ServerPlayer serverPlayer - && !(PlatformApi.INSTANCE.canPlaceNetworkNode(serverPlayer, ctx.getLevel(), ctx.getClickedPos(), state))) { - return false; - } - return super.placeBlock(ctx, state); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerContainerMenu.java deleted file mode 100644 index 0147027fd..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerContainerMenu.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.controller; - -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyInfo; - -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -public class ControllerContainerMenu extends AbstractBaseContainerMenu implements EnergyContainerMenu { - private final EnergyInfo energyInfo; - - public ControllerContainerMenu(final int syncId, - final Inventory playerInventory, - final ControllerData controllerData) { - super(Menus.INSTANCE.getController(), syncId); - addPlayerInventory(playerInventory, 8, 107); - this.energyInfo = EnergyInfo.forClient( - playerInventory.player, - controllerData.stored(), - controllerData.capacity() - ); - registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - } - - ControllerContainerMenu(final int syncId, - final Inventory playerInventory, - final ControllerBlockEntity controller, - final Player player) { - super(Menus.INSTANCE.getController(), syncId); - this.energyInfo = EnergyInfo.forServer( - player, - controller::getActualStored, - controller::getActualCapacity - ); - addPlayerInventory(playerInventory, 8, 107); - registerProperty(new ServerProperty<>( - PropertyTypes.REDSTONE_MODE, - controller::getRedstoneMode, - controller::setRedstoneMode - )); - } - - @Override - public void broadcastChanges() { - super.broadcastChanges(); - energyInfo.detectChanges(); - } - - @Override - public EnergyInfo getEnergyInfo() { - return energyInfo; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerScreen.java deleted file mode 100644 index 7565b4535..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerScreen.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.controller; - -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.ProgressWidget; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; - -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ControllerScreen extends AbstractBaseScreen { - private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/controller.png"); - - @Nullable - private ProgressWidget progressWidget; - - public ControllerScreen(final ControllerContainerMenu menu, final Inventory playerInventory, final Component text) { - super(menu, playerInventory, text); - this.inventoryLabelY = 94; - this.imageWidth = 176; - this.imageHeight = 189; - } - - @Override - protected void init() { - super.init(); - addSideButton(new RedstoneModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.REDSTONE_MODE), - createTranslation("gui", "controller.redstone_mode_help") - )); - if (progressWidget == null) { - progressWidget = new ProgressWidget( - leftPos + 80, - topPos + 20, - 16, - 70, - getMenu().getEnergyInfo()::getPercentageFull, - getMenu().getEnergyInfo()::createTooltip - ); - } else { - progressWidget.setX(leftPos + 80); - progressWidget.setY(topPos + 20); - } - addRenderableWidget(progressWidget); - } - - @Override - protected ResourceLocation getTexture() { - return TEXTURE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerType.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerType.java deleted file mode 100644 index b3dcad21d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/ControllerType.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.controller; - -public enum ControllerType { - NORMAL, - CREATIVE -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/CreativeControllerBlockItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/CreativeControllerBlockItem.java deleted file mode 100644 index 85d33b3a3..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/CreativeControllerBlockItem.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.controller; - -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; - -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.level.block.Block; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class CreativeControllerBlockItem extends NetworkNodeBlockItem { - private static final MutableComponent HELP = createTranslation("item", "creative_controller.help"); - - CreativeControllerBlockItem(final Block block) { - super(block, new Item.Properties().stacksTo(1), HELP); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/package-info.java deleted file mode 100644 index 23195fa3e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/controller/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.controller; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlockEntity.java deleted file mode 100644 index 2e2a5bdf8..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlockEntity.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.detector; - -import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorAmountStrategy; -import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorAmountStrategyImpl; -import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorMode; -import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorNetworkNode; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionSink; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.SingleAmountData; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; - -import java.util.Optional; -import javax.annotation.Nullable; - -import com.google.common.util.concurrent.RateLimiter; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.HolderLookup; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.chat.Component; -import net.minecraft.network.codec.StreamEncoder; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.properties.BooleanProperty; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DetectorBlockEntity extends AbstractRedstoneModeNetworkNodeContainerBlockEntity - implements NetworkNodeExtendedMenuProvider { - private static final Logger LOGGER = LoggerFactory.getLogger(DetectorBlockEntity.class); - - private static final String TAG_AMOUNT = "amount"; - private static final String TAG_MODE = "mode"; - - private final FilterWithFuzzyMode filter; - private final RateLimiter poweredChangeRateLimiter = RateLimiter.create(1); - - private double amount; - - public DetectorBlockEntity(final BlockPos pos, final BlockState state) { - super(BlockEntities.INSTANCE.getDetector(), pos, state, new DetectorNetworkNode( - Platform.INSTANCE.getConfig().getDetector().getEnergyUsage() - )); - final ResourceContainer resourceContainer = ResourceContainerImpl.createForFilter(1); - this.filter = FilterWithFuzzyMode.createAndListenForFilters( - resourceContainer, - () -> { - propagateAmount(); - setChanged(); - }, - filters -> mainNode.setConfiguredResource(filters.isEmpty() ? null : filters.get(0)) - ); - initialize(); - } - - @Override - public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { - super.writeConfiguration(tag, provider); - filter.save(tag, provider); - tag.putDouble(TAG_AMOUNT, amount); - tag.putInt(TAG_MODE, DetectorModeSettings.getDetectorMode(mainNode.getMode())); - } - - @Override - public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { - super.readConfiguration(tag, provider); - filter.load(tag, provider); - if (tag.contains(TAG_AMOUNT)) { - this.amount = tag.getDouble(TAG_AMOUNT); - } - if (tag.contains(TAG_MODE)) { - mainNode.setMode(DetectorModeSettings.getDetectorMode(tag.getInt(TAG_MODE))); - } - initialize(); - propagateAmount(); - } - - void setAmount(final double amount) { - this.amount = amount; - propagateAmount(); - setChanged(); - } - - private void propagateAmount() { - final PlatformResourceKey configuredResource = filter.getFilterContainer().getResource(0); - final long normalizedAmount = configuredResource == null - ? (long) amount - : configuredResource.getResourceType().normalizeAmount(amount); - LOGGER.debug("Updating detector amount of {} normalized as {}", amount, normalizedAmount); - mainNode.setAmount(normalizedAmount); - } - - boolean isFuzzyMode() { - return filter.isFuzzyMode(); - } - - void setFuzzyMode(final boolean fuzzyMode) { - filter.setFuzzyMode(fuzzyMode); - initialize(); - } - - void setMode(final DetectorMode mode) { - mainNode.setMode(mode); - setChanged(); - } - - DetectorMode getMode() { - return mainNode.getMode(); - } - - private void initialize() { - final DetectorAmountStrategy defaultStrategy = new DetectorAmountStrategyImpl(); - final DetectorAmountStrategy strategy = isFuzzyMode() - ? new FuzzyDetectorAmountStrategy(defaultStrategy) - : defaultStrategy; - mainNode.setAmountStrategy(strategy); - } - - @Override - public SingleAmountData getMenuData() { - return new SingleAmountData( - Optional.empty(), - amount, - ResourceContainerData.of(filter.getFilterContainer()) - ); - } - - @Override - public StreamEncoder getMenuCodec() { - return SingleAmountData.STREAM_CODEC; - } - - @Override - public Component getDisplayName() { - return ContentNames.DETECTOR; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return new DetectorContainerMenu(syncId, player, this, filter.getFilterContainer()); - } - - @Override - public void updateActiveness(final BlockState state, @Nullable final BooleanProperty activenessProperty) { - super.updateActiveness(state, activenessProperty); - final boolean powered = mainNode.isActive() && mainNode.isActivated(); - final boolean needToUpdatePowered = state.getValue(DetectorBlock.POWERED) != powered; - if (level != null && needToUpdatePowered && poweredChangeRateLimiter.tryAcquire()) { - level.setBlockAndUpdate(getBlockPos(), state.setValue(DetectorBlock.POWERED, powered)); - } - } - - @Override - public void addOutgoingConnections(final ConnectionSink sink) { - final Direction myDirection = getDirection(); - if (myDirection == null) { - return; - } - for (final Direction direction : Direction.values()) { - if (direction == myDirection.getOpposite()) { - continue; - } - sink.tryConnectInSameDimension(worldPosition.relative(direction), direction.getOpposite()); - } - } - - @Override - public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { - if (!colorsAllowConnecting(connectingState)) { - return false; - } - final Direction myDirection = getDirection(); - if (myDirection != null) { - return myDirection != incomingDirection.getOpposite(); - } - return true; - } - - @Override - protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, - final BlockState newBlockState) { - return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorContainerMenu.java deleted file mode 100644 index f086add1b..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorContainerMenu.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.detector; - -import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorMode; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.SingleAmountData; - -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class DetectorContainerMenu extends AbstractSingleAmountContainerMenu { - private static final Component FILTER_HELP = createTranslation("gui", "detector.filter_help"); - - @Nullable - private DetectorBlockEntity detector; - - public DetectorContainerMenu(final int syncId, - final Inventory playerInventory, - final SingleAmountData singleAmountData) { - super(Menus.INSTANCE.getDetector(), syncId, playerInventory, singleAmountData, FILTER_HELP); - registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); - registerProperty(new ClientProperty<>(DetectorPropertyTypes.MODE, DetectorMode.EQUAL)); - } - - DetectorContainerMenu(final int syncId, - final Player player, - final DetectorBlockEntity detector, - final ResourceContainer resourceContainer) { - super(Menus.INSTANCE.getDetector(), syncId, player, resourceContainer, FILTER_HELP, null); - this.detector = detector; - registerProperty(new ServerProperty<>( - PropertyTypes.FUZZY_MODE, - detector::isFuzzyMode, - detector::setFuzzyMode - )); - registerProperty(new ServerProperty<>( - DetectorPropertyTypes.MODE, - detector::getMode, - detector::setMode - )); - } - - @Override - public void changeAmountOnServer(final double newAmount) { - if (detector == null) { - return; - } - detector.setAmount(newAmount); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorPropertyTypes.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorPropertyTypes.java deleted file mode 100644 index 1bf75cfd7..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorPropertyTypes.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.detector; - -import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -final class DetectorPropertyTypes { - static final PropertyType MODE = new PropertyType<>( - createIdentifier("detector_mode"), - DetectorModeSettings::getDetectorMode, - DetectorModeSettings::getDetectorMode - ); - - private DetectorPropertyTypes() { - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorScreen.java deleted file mode 100644 index 7525f0d98..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorScreen.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.detector; - -import com.refinedmods.refinedstorage.platform.common.support.amount.AbstractSingleAmountScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.FuzzyModeSideButtonWidget; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; - -public class DetectorScreen extends AbstractSingleAmountScreen { - public DetectorScreen(final DetectorContainerMenu menu, final Inventory playerInventory, final Component text) { - super(menu, playerInventory, text, menu.getAmount(), 0); - } - - @Override - protected void init() { - super.init(); - addSideButton(new FuzzyModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.FUZZY_MODE), - () -> FuzzyModeSideButtonWidget.Type.GENERIC - )); - addSideButton(new DetectorModeSideButtonWidget(getMenu().getProperty(DetectorPropertyTypes.MODE))); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/FuzzyDetectorAmountStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/FuzzyDetectorAmountStrategy.java deleted file mode 100644 index 54264ddb0..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/FuzzyDetectorAmountStrategy.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.detector; - -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.impl.node.detector.AbstractDetectorAmountStrategy; -import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorAmountStrategy; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.storage.channel.FuzzyStorageChannel; - -class FuzzyDetectorAmountStrategy extends AbstractDetectorAmountStrategy { - private final DetectorAmountStrategy fallback; - - FuzzyDetectorAmountStrategy(final DetectorAmountStrategy fallback) { - this.fallback = fallback; - } - - @Override - public long getAmount(final Network network, final ResourceKey configuredResource) { - final StorageChannel storageChannel = getStorageChannel(network); - if (!(storageChannel instanceof FuzzyStorageChannel fuzzyStorageChannel)) { - return fallback.getAmount(network, configuredResource); - } - return fuzzyStorageChannel.getFuzzy(configuredResource) - .stream() - .mapToLong(ResourceAmount::getAmount) - .sum(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/package-info.java deleted file mode 100644 index 23dd8bd2c..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.detector; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterBlock.java deleted file mode 100644 index e25dd9983..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterBlock.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.exporter; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalCableBlock; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.ColorableBlock; -import com.refinedmods.refinedstorage.platform.common.support.DirectionalCableBlockShapes; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.shapes.VoxelShape; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ExporterBlock extends AbstractDirectionalCableBlock - implements ColorableBlock, EntityBlock, BlockItemProvider { - private static final Component HELP = createTranslation("item", "exporter.help"); - private static final Map SHAPE_CACHE = new HashMap<>(); - private static final AbstractBlockEntityTicker TICKER = - new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getExporter); - private final DyeColor color; - private final MutableComponent name; - - public ExporterBlock(final DyeColor color, final MutableComponent name) { - super(SHAPE_CACHE); - this.color = color; - this.name = name; - } - - @Override - public DyeColor getColor() { - return color; - } - - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new ExporterBlockEntity(pos, state); - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getExporter(); - } - - @Override - protected VoxelShape getExtensionShape(final Direction direction) { - return switch (direction) { - case NORTH -> DirectionalCableBlockShapes.EXPORTER_NORTH; - case EAST -> DirectionalCableBlockShapes.EXPORTER_EAST; - case SOUTH -> DirectionalCableBlockShapes.EXPORTER_SOUTH; - case WEST -> DirectionalCableBlockShapes.EXPORTER_WEST; - case UP -> DirectionalCableBlockShapes.EXPORTER_UP; - case DOWN -> DirectionalCableBlockShapes.EXPORTER_DOWN; - }; - } - - @Override - public MutableComponent getName() { - return name; - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterContainerMenu.java deleted file mode 100644 index ddd61753a..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterContainerMenu.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.exporter; - -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSchedulingContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; - -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ExporterContainerMenu extends AbstractSchedulingContainerMenu { - private static final MutableComponent FILTER_HELP = createTranslation("gui", "exporter.filter_help"); - - public ExporterContainerMenu(final int syncId, - final Inventory playerInventory, - final ResourceContainerData resourceContainerData) { - super( - Menus.INSTANCE.getExporter(), - syncId, - playerInventory.player, - resourceContainerData, - UpgradeDestinations.EXPORTER, - FILTER_HELP - ); - } - - ExporterContainerMenu(final int syncId, - final Player player, - final ExporterBlockEntity exporter, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { - super( - Menus.INSTANCE.getExporter(), - syncId, - player, - resourceContainer, - upgradeContainer, - exporter, - FILTER_HELP - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterScreen.java deleted file mode 100644 index 63cfb4fe4..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterScreen.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.exporter; - -import com.refinedmods.refinedstorage.platform.common.support.AbstractFilterScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.widget.SchedulingModeSideButtonWidget; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; - -public class ExporterScreen extends AbstractFilterScreen { - public ExporterScreen(final ExporterContainerMenu menu, final Inventory playerInventory, final Component text) { - super(menu, playerInventory, text); - } - - @Override - protected void init() { - super.init(); - addSideButton(new FuzzyModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.FUZZY_MODE), - () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK - )); - addSideButton(new SchedulingModeSideButtonWidget(getMenu().getProperty(PropertyTypes.SCHEDULING_MODE))); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/FuzzyExporterTransferStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/FuzzyExporterTransferStrategy.java deleted file mode 100644 index c7a17f0ed..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/FuzzyExporterTransferStrategy.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.exporter; - -import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterTransferStrategyImpl; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.storage.channel.FuzzyStorageChannel; - -import java.util.Collection; -import java.util.stream.Collectors; - -public class FuzzyExporterTransferStrategy extends ExporterTransferStrategyImpl { - public FuzzyExporterTransferStrategy(final InsertableStorage destination, final long transferQuota) { - super(destination, transferQuota); - } - - @Override - protected Collection expand(final ResourceKey resource, final StorageChannel storageChannel) { - if (storageChannel instanceof FuzzyStorageChannel fuzzyStorageChannel) { - return fuzzyStorageChannel - .getFuzzy(resource) - .stream() - .map(ResourceAmount::getResource) - .collect(Collectors.toSet()); - } - return super.expand(resource, storageChannel); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/package-info.java deleted file mode 100644 index ae767a442..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/exporter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.exporter; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridBlock.java deleted file mode 100644 index fb3bc9b7b..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridBlock.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.support.AbstractActiveColoredDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; - -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.block.EntityBlock; - -public abstract class AbstractGridBlock & BlockItemProvider, I extends BlockItem> - extends AbstractActiveColoredDirectionalBlock implements EntityBlock { - protected AbstractGridBlock(final MutableComponent name, final DyeColor color) { - super(BlockConstants.PROPERTIES, color, name); - } - - @Override - protected DirectionType getDirectionType() { - return BiDirectionType.INSTANCE; - } - - @Override - public boolean canAlwaysConnect() { - return true; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridBlockEntity.java deleted file mode 100644 index 999e66c44..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridBlockEntity.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.impl.node.container.NetworkNodeContainerPriorities; -import com.refinedmods.refinedstorage.api.network.impl.node.grid.GridNetworkNode; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.security.PlatformSecurityNetworkComponent; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; - -import java.util.List; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamEncoder; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; - -import static java.util.Objects.requireNonNull; - -public abstract class AbstractGridBlockEntity - extends AbstractRedstoneModeNetworkNodeContainerBlockEntity - implements Grid, NetworkNodeExtendedMenuProvider { - protected AbstractGridBlockEntity(final BlockEntityType type, - final BlockPos pos, - final BlockState state, - final long energyUsage) { - super(type, pos, state, new GridNetworkNode(energyUsage)); - } - - @Override - protected InWorldNetworkNodeContainer createMainContainer(final GridNetworkNode node) { - return PlatformApi.INSTANCE.createInWorldNetworkNodeContainer( - this, - node, - MAIN_CONTAINER_NAME, - NetworkNodeContainerPriorities.GRID, - this, - null - ); - } - - @Override - public GridData getMenuData() { - return GridData.of(this); - } - - @Override - public StreamEncoder getMenuCodec() { - return GridData.STREAM_CODEC; - } - - @Override - public List getResources(final Class actorType) { - return requireNonNull(mainNode.getNetwork()) - .getComponent(StorageNetworkComponent.class) - .getResources(actorType); - } - - @Override - public GridOperations createOperations(final ResourceType resourceType, final ServerPlayer player) { - final Network network = requireNonNull(mainNode.getNetwork()); - final StorageChannel storageChannel = network.getComponent(StorageNetworkComponent.class); - final PlatformSecurityNetworkComponent security = network.getComponent(PlatformSecurityNetworkComponent.class); - final GridOperations operations = resourceType.createGridOperations(storageChannel, new PlayerActor(player)); - return new SecuredGridOperations(player, security, operations); - } - - @Override - public boolean isGridActive() { - return mainNode.isActive(); - } - - @Override - public Storage getItemStorage() { - return requireNonNull(mainNode.getNetwork()).getComponent(StorageNetworkComponent.class); - } - - @Override - public void addWatcher(final GridWatcher watcher, final Class actorType) { - mainNode.addWatcher(watcher, actorType); - } - - @Override - public void removeWatcher(final GridWatcher watcher) { - mainNode.removeWatcher(watcher); - } - - @Override - protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, - final BlockState newBlockState) { - return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridSynchronizer.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridSynchronizer.java deleted file mode 100644 index 5a9834382..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridSynchronizer.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage.platform.common.support.TextureIds; - -import net.minecraft.resources.ResourceLocation; - -public abstract class AbstractGridSynchronizer implements GridSynchronizer { - @Override - public ResourceLocation getTextureIdentifier() { - return TextureIds.ICONS; - } - - @Override - public int getYTexture() { - return 96; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridBlock.java deleted file mode 100644 index e0bccbbe9..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridBlock.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class CraftingGridBlock extends AbstractGridBlock - implements BlockItemProvider { - private static final Component HELP = createTranslation("item", "crafting_grid.help"); - private static final AbstractBlockEntityTicker TICKER = new NetworkNodeBlockEntityTicker<>( - BlockEntities.INSTANCE::getCraftingGrid, - ACTIVE - ); - - public CraftingGridBlock(final DyeColor color, final MutableComponent name) { - super(name, color); - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getCraftingGrid(); - } - - @Nullable - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new CraftingGridBlockEntity(pos, state); - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridMatrixCloseBehavior.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridMatrixCloseBehavior.java deleted file mode 100644 index fa99129c0..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridMatrixCloseBehavior.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -public enum CraftingGridMatrixCloseBehavior { - NONE, - CLEAR_TO_NETWORK, - CLEAR_TO_INVENTORY -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridRefillContext.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridRefillContext.java deleted file mode 100644 index 036f76b57..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridRefillContext.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import net.minecraft.world.entity.player.Player; - -interface CraftingGridRefillContext extends AutoCloseable { - boolean extract(ItemResource resource, Player player); - - @Override - void close(); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridBlock.java deleted file mode 100644 index e3e6ab612..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridBlock.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class GridBlock extends AbstractGridBlock - implements BlockItemProvider { - private static final Component HELP = createTranslation("item", "grid.help"); - private static final AbstractBlockEntityTicker TICKER = new NetworkNodeBlockEntityTicker<>( - BlockEntities.INSTANCE::getGrid, - ACTIVE - ); - - public GridBlock(final DyeColor color, final MutableComponent name) { - super(name, color); - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getGrid(); - } - - @Nullable - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new GridBlockEntity(pos, state); - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridContainerMenu.java deleted file mode 100644 index 79b214719..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/GridContainerMenu.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; - -import net.minecraft.world.entity.player.Inventory; - -public class GridContainerMenu extends AbstractGridContainerMenu { - public GridContainerMenu(final int syncId, final Inventory playerInventory, final GridData gridData) { - super(Menus.INSTANCE.getGrid(), syncId, playerInventory, gridData); - onScreenReady(0); - registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - } - - GridContainerMenu(final int syncId, final Inventory playerInventory, final GridBlockEntity grid) { - super(Menus.INSTANCE.getGrid(), syncId, playerInventory, grid); - onScreenReady(0); - registerProperty(new ServerProperty<>( - PropertyTypes.REDSTONE_MODE, - grid::getRedstoneMode, - grid::setRedstoneMode - )); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/SnapshotCraftingGridRefillContext.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/SnapshotCraftingGridRefillContext.java deleted file mode 100644 index 9e4d2e98b..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/SnapshotCraftingGridRefillContext.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; - -class SnapshotCraftingGridRefillContext implements CraftingGridRefillContext { - private final PlayerActor playerActor; - private final CraftingGridBlockEntity blockEntity; - private final ResourceList available = new ResourceListImpl(); - private final ResourceList used = new ResourceListImpl(); - - SnapshotCraftingGridRefillContext( - final Player player, - final CraftingGridBlockEntity blockEntity, - final CraftingMatrix craftingMatrix - ) { - this.playerActor = new PlayerActor(player); - this.blockEntity = blockEntity; - addAvailableItems(craftingMatrix); - } - - private void addAvailableItems(final CraftingMatrix craftingMatrix) { - blockEntity.getStorageChannel().ifPresent(storageChannel -> { - for (int i = 0; i < craftingMatrix.getContainerSize(); ++i) { - addAvailableItem(craftingMatrix, storageChannel, i); - } - }); - } - - private void addAvailableItem(final CraftingMatrix craftingMatrix, - final StorageChannel storageChannel, - final int craftingMatrixSlotIndex) { - final ItemStack craftingMatrixStack = craftingMatrix.getItem(craftingMatrixSlotIndex); - if (craftingMatrixStack.isEmpty()) { - return; - } - addAvailableItem(storageChannel, craftingMatrixStack); - } - - private void addAvailableItem(final StorageChannel storageChannel, - final ItemStack craftingMatrixStack) { - final ItemResource craftingMatrixResource = ItemResource.ofItemStack(craftingMatrixStack); - // a single resource can occur multiple times in a recipe, only add it once - if (available.get(craftingMatrixResource).isEmpty()) { - storageChannel.get(craftingMatrixResource).ifPresent(available::add); - } - } - - @Override - public boolean extract(final ItemResource resource, final Player player) { - return blockEntity.getNetwork().map(network -> { - final boolean isAvailable = available.get(resource).isPresent(); - if (isAvailable) { - available.remove(resource, 1); - used.add(resource, 1); - } - return isAvailable; - }).orElse(false); - } - - @Override - public void close() { - blockEntity.getStorageChannel().ifPresent(this::extractUsedItems); - } - - private void extractUsedItems(final StorageChannel storageChannel) { - used.getAll().forEach(u -> storageChannel.extract(u.getResource(), u.getAmount(), Action.EXECUTE, playerActor)); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGrid.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGrid.java deleted file mode 100644 index 66498bbf4..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGrid.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.api.grid.operations.NoopGridOperations; -import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher; -import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManager; -import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManagerImpl; -import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.NoopStorage; -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.security.PlatformSecurityNetworkComponent; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; -import com.refinedmods.refinedstorage.platform.common.Platform; - -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import net.minecraft.server.level.ServerPlayer; - -class WirelessGrid implements Grid { - private final NetworkBoundItemSession session; - private final GridWatcherManager watchers = new GridWatcherManagerImpl(); - - WirelessGrid(final NetworkBoundItemSession session) { - this.session = session; - } - - private Optional getStorage() { - return session.resolveNetwork().map(network -> network.getComponent(StorageNetworkComponent.class)); - } - - private Optional getSecurity() { - return session.resolveNetwork().map(network -> network.getComponent(PlatformSecurityNetworkComponent.class)); - } - - @Override - public void addWatcher(final GridWatcher watcher, final Class actorType) { - session.drainEnergy(Platform.INSTANCE.getConfig().getWirelessGrid().getOpenEnergyUsage()); - session.resolveNetwork().ifPresent(network -> watchers.addWatcher( - watcher, - actorType, - network.getComponent(StorageNetworkComponent.class) - )); - } - - @Override - public void removeWatcher(final GridWatcher watcher) { - session.resolveNetwork().ifPresent(network -> watchers.removeWatcher( - watcher, - network.getComponent(StorageNetworkComponent.class) - )); - } - - @Override - public Storage getItemStorage() { - return getStorage().map(Storage.class::cast).orElseGet(NoopStorage::new); - } - - @Override - public boolean isGridActive() { - final boolean networkActive = session.resolveNetwork().map( - network -> network.getComponent(EnergyNetworkComponent.class).getStored() > 0 - ).orElse(false); - return networkActive && session.isActive(); - } - - @Override - public List getResources(final Class actorType) { - return getStorage().map(storage -> storage.getResources(actorType)).orElse(Collections.emptyList()); - } - - @Override - public GridOperations createOperations(final ResourceType resourceType, final ServerPlayer player) { - return getStorage() - .flatMap(storageChannel -> - getSecurity().map(security -> createGridOperations(resourceType, player, storageChannel, security))) - .map(gridOperations -> (GridOperations) new WirelessGridOperations(gridOperations, session, watchers)) - .orElseGet(NoopGridOperations::new); - } - - private GridOperations createGridOperations(final ResourceType resourceType, - final ServerPlayer player, - final StorageNetworkComponent storageChannel, - final PlatformSecurityNetworkComponent securityNetworkComponent) { - final PlayerActor playerActor = new PlayerActor(player); - final GridOperations operations = resourceType.createGridOperations(storageChannel, playerActor); - return new SecuredGridOperations(player, securityNetworkComponent, operations); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridData.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridData.java deleted file mode 100644 index b547e00e3..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridData.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; - -public record WirelessGridData(GridData gridData, SlotReference slotReference) { - public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - GridData.STREAM_CODEC, WirelessGridData::gridData, - SlotReferenceFactory.STREAM_CODEC, WirelessGridData::slotReference, - WirelessGridData::new - ); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridItem.java deleted file mode 100644 index e27de441d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridItem.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyStorageImpl; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.security.SecurityHelper; -import com.refinedmods.refinedstorage.platform.api.support.energy.AbstractNetworkBoundEnergyItem; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.security.BuiltinPermission; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; - -public class WirelessGridItem extends AbstractNetworkBoundEnergyItem { - public WirelessGridItem() { - super( - new Item.Properties().stacksTo(1), - PlatformApi.INSTANCE.getEnergyItemHelper(), - PlatformApi.INSTANCE.getNetworkBoundItemHelper() - ); - } - - public EnergyStorage createEnergyStorage(final ItemStack stack) { - final EnergyStorage energyStorage = new EnergyStorageImpl( - Platform.INSTANCE.getConfig().getWirelessGrid().getEnergyCapacity() - ); - return PlatformApi.INSTANCE.asItemEnergyStorage(energyStorage, stack); - } - - @Override - protected void use(final ServerPlayer player, - final SlotReference slotReference, - final NetworkBoundItemSession session) { - final boolean isAllowed = session.resolveNetwork() - .map(network -> SecurityHelper.isAllowed(player, BuiltinPermission.OPEN, network)) - .orElse(true); // if the network can't be resolved that will be apparent later in the UI. - if (!isAllowed) { - PlatformApi.INSTANCE.sendNoPermissionToOpenMessage(player, ContentNames.WIRELESS_GRID); - return; - } - final Grid grid = new WirelessGrid(session); - Platform.INSTANCE.getMenuOpener().openMenu(player, new WirelessGridExtendedMenuProvider(grid, slotReference)); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/package-info.java deleted file mode 100644 index 9d81fbf36..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.grid; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AutoSelectedSideButtonWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AutoSelectedSideButtonWidget.java deleted file mode 100644 index e63560600..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AutoSelectedSideButtonWidget.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; - -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractSideButtonWidget; - -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.NO; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.YES; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -class AutoSelectedSideButtonWidget extends AbstractSideButtonWidget { - private static final MutableComponent TITLE = createTranslation("gui", "grid.auto_selected"); - private static final Component HELP = createTranslation("gui", "grid.auto_selected.help"); - - private final AbstractGridContainerMenu menu; - - AutoSelectedSideButtonWidget(final AbstractGridContainerMenu menu) { - super(createPressAction(menu)); - this.menu = menu; - } - - private static OnPress createPressAction(final AbstractGridContainerMenu menu) { - return btn -> menu.setAutoSelected(!menu.isAutoSelected()); - } - - @Override - protected int getXTexture() { - return menu.isAutoSelected() ? 16 : 0; - } - - @Override - protected int getYTexture() { - return 96; - } - - @Override - protected MutableComponent getTitle() { - return TITLE; - } - - @Override - protected MutableComponent getSubText() { - return menu.isAutoSelected() ? YES : NO; - } - - @Override - protected Component getHelpText() { - return HELP; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/GridScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/GridScreen.java deleted file mode 100644 index d9c181d29..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/GridScreen.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen; - -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; - -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public class GridScreen extends AbstractGridScreen { - private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/grid.png"); - - public GridScreen(final T menu, final Inventory inventory, final Component title) { - super(menu, inventory, title, 99); - this.inventoryLabelY = 75; - this.imageWidth = 193; - this.imageHeight = 176; - } - - @Override - protected ResourceLocation getTexture() { - return TEXTURE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/FluidGridInsertionHint.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/FluidGridInsertionHint.java deleted file mode 100644 index d267e4777..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/FluidGridInsertionHint.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen.hint; - -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceRendering; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; - -import java.util.Optional; - -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.world.item.ItemStack; - -public class FluidGridInsertionHint implements GridInsertionHint { - @Override - public Optional getHint(final ItemStack carried) { - return Platform.INSTANCE.getContainedFluid(carried).map(this::createComponent); - } - - private MouseWithIconClientTooltipComponent createComponent(final Platform.ContainedFluid result) { - return new MouseWithIconClientTooltipComponent( - MouseWithIconClientTooltipComponent.Type.RIGHT, - (graphics, x, y) -> Platform.INSTANCE.getFluidRenderer().render( - graphics.pose(), - x, - y, - result.fluid() - ), - result.amount() == Platform.INSTANCE.getBucketAmount() - ? null - : FluidResourceRendering.format(result.amount()) - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/ItemGridInsertionHint.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/ItemGridInsertionHint.java deleted file mode 100644 index 6ea5d5c47..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/ItemGridInsertionHint.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen.hint; - -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; - -import java.util.Optional; - -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.world.item.ItemStack; - -public class ItemGridInsertionHint implements GridInsertionHint { - @Override - public Optional getHint(final ItemStack carried) { - return Optional.of(new MouseWithIconClientTooltipComponent( - MouseWithIconClientTooltipComponent.Type.LEFT, - (graphics, x, y) -> graphics.renderItem(carried, x, y), - carried.getCount() == 1 ? null : AmountFormatting.format(carried.getCount()) - )); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/SingleItemGridInsertionHint.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/SingleItemGridInsertionHint.java deleted file mode 100644 index 1268a1ae3..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/SingleItemGridInsertionHint.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.screen.hint; - -import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; - -import java.util.Optional; - -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.world.item.ItemStack; - -public class SingleItemGridInsertionHint implements GridInsertionHint { - @Override - public Optional getHint(final ItemStack carried) { - return Optional.of(new MouseWithIconClientTooltipComponent( - MouseWithIconClientTooltipComponent.Type.RIGHT, - (graphics, x, y) -> graphics.renderItem(carried, x, y), - null - )); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/package-info.java deleted file mode 100644 index 9045ae5be..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/hint/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.grid.screen.hint; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/package-info.java deleted file mode 100644 index 9ce18ebcd..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.grid.screen; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/ClientGridExtractionStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/ClientGridExtractionStrategy.java deleted file mode 100644 index 0bab9aa80..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/ClientGridExtractionStrategy.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.strategy; - -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; - -public class ClientGridExtractionStrategy implements GridExtractionStrategy { - @Override - public boolean onExtract(final PlatformResourceKey resource, - final GridExtractMode extractMode, - final boolean cursor) { - C2SPackets.sendGridExtract(resource, extractMode, cursor); - return true; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/ClientGridInsertionStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/ClientGridInsertionStrategy.java deleted file mode 100644 index a09384403..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/ClientGridInsertionStrategy.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.strategy; - -import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; - -public class ClientGridInsertionStrategy implements GridInsertionStrategy { - @Override - public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { - C2SPackets.sendGridInsert(insertMode, tryAlternatives); - return true; - } - - @Override - public boolean onTransfer(final int slotIndex) { - throw new UnsupportedOperationException(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/ClientGridScrollingStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/ClientGridScrollingStrategy.java deleted file mode 100644 index cf3eeae92..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/ClientGridScrollingStrategy.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.strategy; - -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; - -public class ClientGridScrollingStrategy implements GridScrollingStrategy { - @Override - public boolean onScroll(final PlatformResourceKey resource, final GridScrollMode scrollMode, final int slotIndex) { - C2SPackets.sendGridScroll(resource, scrollMode, slotIndex); - return true; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/CompositeGridScrollingStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/CompositeGridScrollingStrategy.java deleted file mode 100644 index 540144706..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/CompositeGridScrollingStrategy.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.strategy; - -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; - -import java.util.Collections; -import java.util.List; - -public class CompositeGridScrollingStrategy implements GridScrollingStrategy { - private final List strategies; - - public CompositeGridScrollingStrategy(final List strategies) { - this.strategies = Collections.unmodifiableList(strategies); - } - - @Override - public boolean onScroll(final PlatformResourceKey resource, final GridScrollMode scrollMode, final int slotIndex) { - for (final GridScrollingStrategy strategy : strategies) { - if (strategy.onScroll(resource, scrollMode, slotIndex)) { - return true; - } - } - return false; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/package-info.java deleted file mode 100644 index 77d1e27d2..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/strategy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/FluidGridResource.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/FluidGridResource.java deleted file mode 100644 index ea8366815..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/FluidGridResource.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.grid.view; - -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.api.grid.GridResourceAttributeKeys; -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.grid.view.AbstractPlatformGridResource; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceRendering; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import javax.annotation.Nullable; - -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.network.chat.Component; -import net.minecraft.world.inventory.tooltip.TooltipComponent; - -public class FluidGridResource extends AbstractPlatformGridResource { - private final FluidResource fluidResource; - private final int id; - - public FluidGridResource(final ResourceAmount resourceAmount, - final String name, - final String modId, - final String modName, - final Set tags, - final String tooltip) { - super(resourceAmount, name, Map.of( - GridResourceAttributeKeys.MOD_ID, Set.of(modId), - GridResourceAttributeKeys.MOD_NAME, Set.of(modName), - GridResourceAttributeKeys.TAGS, tags, - GridResourceAttributeKeys.TOOLTIP, Set.of(tooltip) - )); - this.fluidResource = (FluidResource) resourceAmount.getResource(); - this.id = BuiltInRegistries.FLUID.getId(fluidResource.fluid()); - } - - @Override - public int getRegistryId() { - return id; - } - - @Override - public List getExtractionHints() { - return Platform.INSTANCE.convertToBucket(fluidResource).map( - bucket -> (ClientTooltipComponent) new MouseWithIconClientTooltipComponent( - MouseWithIconClientTooltipComponent.Type.LEFT, - (graphics, x, y) -> graphics.renderItem(bucket, x, y), - null - ) - ).stream().toList(); - } - - @Nullable - @Override - public PlatformResourceKey getUnderlyingResource() { - return fluidResource; - } - - @Override - public void onExtract(final GridExtractMode extractMode, - final boolean cursor, - final GridExtractionStrategy extractionStrategy) { - extractionStrategy.onExtract(fluidResource, extractMode, cursor); - } - - @Override - public void onScroll(final GridScrollMode scrollMode, final GridScrollingStrategy scrollingStrategy) { - // no-op - } - - @Override - public void render(final GuiGraphics graphics, final int x, final int y) { - Platform.INSTANCE.getFluidRenderer().render(graphics.pose(), x, y, fluidResource); - } - - @Override - public String getDisplayedAmount() { - return FluidResourceRendering.formatWithUnits(getAmount()); - } - - @Override - public String getAmountInTooltip() { - return FluidResourceRendering.format(getAmount()); - } - - @Override - public List getTooltip() { - return Platform.INSTANCE.getFluidRenderer().getTooltip(fluidResource); - } - - @Override - public Optional getTooltipImage() { - return Optional.empty(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/package-info.java deleted file mode 100644 index bae0e4c98..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/view/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.grid.view; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceScreen.java deleted file mode 100644 index 2d8ca7b47..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/InterfaceScreen.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.iface; - -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; - -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public class InterfaceScreen extends AbstractBaseScreen { - private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/interface.png"); - - public InterfaceScreen(final InterfaceContainerMenu menu, - final Inventory playerInventory, - final Component text) { - super(menu, playerInventory, text); - this.inventoryLabelY = 88; - this.imageWidth = 176; - this.imageHeight = 182; - } - - @Override - protected void init() { - super.init(); - addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); - addSideButton(new FuzzyModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.FUZZY_MODE), - () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK - )); - } - - @Override - protected ResourceLocation getTexture() { - return TEXTURE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/package-info.java deleted file mode 100644 index 8b82a4638..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/iface/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.iface; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterBlock.java deleted file mode 100644 index 6932cff56..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterBlock.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.importer; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalCableBlock; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.ColorableBlock; -import com.refinedmods.refinedstorage.platform.common.support.DirectionalCableBlockShapes; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.shapes.VoxelShape; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ImporterBlock extends AbstractDirectionalCableBlock implements - ColorableBlock, EntityBlock, BlockItemProvider { - private static final Component HELP = createTranslation("item", "importer.help"); - private static final Map SHAPE_CACHE = new HashMap<>(); - private static final AbstractBlockEntityTicker TICKER = - new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getImporter); - private final DyeColor color; - private final MutableComponent name; - - public ImporterBlock(final DyeColor color, final MutableComponent name) { - super(SHAPE_CACHE); - this.color = color; - this.name = name; - } - - @Override - public DyeColor getColor() { - return color; - } - - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new ImporterBlockEntity(pos, state); - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getImporter(); - } - - @Override - protected VoxelShape getExtensionShape(final Direction direction) { - return switch (direction) { - case NORTH -> DirectionalCableBlockShapes.IMPORTER_NORTH; - case EAST -> DirectionalCableBlockShapes.IMPORTER_EAST; - case SOUTH -> DirectionalCableBlockShapes.IMPORTER_SOUTH; - case WEST -> DirectionalCableBlockShapes.IMPORTER_WEST; - case UP -> DirectionalCableBlockShapes.IMPORTER_UP; - case DOWN -> DirectionalCableBlockShapes.IMPORTER_DOWN; - }; - } - - @Override - public MutableComponent getName() { - return name; - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterBlockEntity.java deleted file mode 100644 index eec1924d5..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterBlockEntity.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.importer; - -import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterNetworkNode; -import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.FilterModeSettings; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractUpgradeableNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; - -import java.util.List; -import java.util.Set; -import java.util.function.LongSupplier; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.HolderLookup; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.chat.Component; -import net.minecraft.network.codec.StreamEncoder; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ImporterBlockEntity - extends AbstractUpgradeableNetworkNodeContainerBlockEntity - implements AmountOverride, NetworkNodeExtendedMenuProvider { - private static final Logger LOGGER = LoggerFactory.getLogger(ImporterBlockEntity.class); - - private static final String TAG_FILTER_MODE = "fim"; - - private final FilterWithFuzzyMode filter; - - public ImporterBlockEntity(final BlockPos pos, final BlockState state) { - super( - BlockEntities.INSTANCE.getImporter(), - pos, - state, - new ImporterNetworkNode(0), - UpgradeDestinations.IMPORTER - ); - this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters( - ResourceContainerImpl.createForFilter(), - this::setChanged, - this::setFilters - ); - this.mainNode.setNormalizer(filter.createNormalizer()); - } - - @Override - protected void initialize(final ServerLevel level, final Direction direction) { - final List strategies = createStrategies(level, direction); - LOGGER.debug("Initialized importer at {} with strategies {}", worldPosition, strategies); - mainNode.setTransferStrategies(strategies); - } - - private List createStrategies(final ServerLevel serverLevel, final Direction direction) { - final Direction incomingDirection = direction.getOpposite(); - final BlockPos sourcePosition = worldPosition.relative(direction); - final List factories = - PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().getAll(); - return factories - .stream() - .map(factory -> factory.create(serverLevel, sourcePosition, incomingDirection, upgradeContainer, this)) - .toList(); - } - - @Override - public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { - super.writeConfiguration(tag, provider); - tag.putInt(TAG_FILTER_MODE, FilterModeSettings.getFilterMode(mainNode.getFilterMode())); - filter.save(tag, provider); - } - - @Override - public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { - super.readConfiguration(tag, provider); - if (tag.contains(TAG_FILTER_MODE)) { - mainNode.setFilterMode(FilterModeSettings.getFilterMode(tag.getInt(TAG_FILTER_MODE))); - } - filter.load(tag, provider); - } - - void setFilters(final Set filters) { - mainNode.setFilters(filters); - } - - boolean isFuzzyMode() { - return filter.isFuzzyMode(); - } - - void setFuzzyMode(final boolean fuzzyMode) { - filter.setFuzzyMode(fuzzyMode); - } - - FilterMode getFilterMode() { - return mainNode.getFilterMode(); - } - - void setFilterMode(final FilterMode mode) { - mainNode.setFilterMode(mode); - setChanged(); - } - - @Override - protected void setEnergyUsage(final long upgradeEnergyUsage) { - final long baseEnergyUsage = Platform.INSTANCE.getConfig().getImporter().getEnergyUsage(); - mainNode.setEnergyUsage(baseEnergyUsage + upgradeEnergyUsage); - } - - @Override - public ResourceContainerData getMenuData() { - return ResourceContainerData.of(filter.getFilterContainer()); - } - - @Override - public StreamEncoder getMenuCodec() { - return ResourceContainerData.STREAM_CODEC; - } - - @Override - public Component getDisplayName() { - return ContentNames.IMPORTER; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return new ImporterContainerMenu(syncId, player, this, filter.getFilterContainer(), upgradeContainer); - } - - @Override - public long overrideAmount(final ResourceKey resource, - final long amount, - final LongSupplier currentAmount) { - if (!upgradeContainer.has(Items.INSTANCE.getRegulatorUpgrade())) { - return amount; - } - return upgradeContainer.getRegulatedAmount(resource) - .stream() - .map(desiredAmount -> getAmountStillAvailableForImport(amount, currentAmount.getAsLong(), desiredAmount)) - .findFirst() - .orElse(amount); - } - - private long getAmountStillAvailableForImport(final long amount, - final long currentAmount, - final long desiredAmount) { - final long stillAvailableToImport = currentAmount - desiredAmount; - if (stillAvailableToImport <= 0) { - return 0; - } - return Math.min(stillAvailableToImport, amount); - } - - @Override - protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, - final BlockState newBlockState) { - return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterContainerMenu.java deleted file mode 100644 index 3f8c687ff..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterContainerMenu.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.importer; - -import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSimpleFilterContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; - -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ImporterContainerMenu extends AbstractSimpleFilterContainerMenu { - private static final MutableComponent FILTER_HELP = createTranslation("gui", "importer.filter_help"); - - public ImporterContainerMenu(final int syncId, - final Inventory playerInventory, - final ResourceContainerData resourceContainerData) { - super( - Menus.INSTANCE.getImporter(), - syncId, - playerInventory.player, - resourceContainerData, - UpgradeDestinations.IMPORTER, - FILTER_HELP - ); - } - - ImporterContainerMenu(final int syncId, - final Player player, - final ImporterBlockEntity importer, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { - super( - Menus.INSTANCE.getImporter(), - syncId, - player, - resourceContainer, - upgradeContainer, - importer, - FILTER_HELP - ); - } - - @Override - protected void registerClientProperties() { - registerProperty(new ClientProperty<>(PropertyTypes.FILTER_MODE, FilterMode.BLOCK)); - registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); - registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - } - - @Override - protected void registerServerProperties(final ImporterBlockEntity blockEntity) { - registerProperty(new ServerProperty<>( - PropertyTypes.FILTER_MODE, - blockEntity::getFilterMode, - blockEntity::setFilterMode - )); - registerProperty(new ServerProperty<>( - PropertyTypes.FUZZY_MODE, - blockEntity::isFuzzyMode, - blockEntity::setFuzzyMode - )); - registerProperty(new ServerProperty<>( - PropertyTypes.REDSTONE_MODE, - blockEntity::getRedstoneMode, - blockEntity::setRedstoneMode - )); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterScreen.java deleted file mode 100644 index 6527cdcfd..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterScreen.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.importer; - -import com.refinedmods.refinedstorage.platform.common.storage.FilterModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.AbstractFilterScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.FuzzyModeSideButtonWidget; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ImporterScreen extends AbstractFilterScreen { - public ImporterScreen(final ImporterContainerMenu menu, final Inventory playerInventory, final Component text) { - super(menu, playerInventory, text); - } - - @Override - protected void init() { - super.init(); - addSideButton(new FilterModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.FILTER_MODE), - createTranslation("gui", "importer.filter_mode.allow.help"), - createTranslation("gui", "importer.filter_mode.block.help") - )); - addSideButton(new FuzzyModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.FUZZY_MODE), - () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_SOURCE - )); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/package-info.java deleted file mode 100644 index 97bc9c7e3..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/importer/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.importer; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/misc/WrenchItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/misc/WrenchItem.java deleted file mode 100644 index 4b2db240a..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/misc/WrenchItem.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.misc; - -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; - -import java.util.Optional; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class WrenchItem extends Item { - private static final Component HELP = createTranslation("item", "wrench.help"); - - public WrenchItem() { - super(new Item.Properties().stacksTo(1)); - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return Optional.of(new HelpTooltipComponent(HELP)); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/misc/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/misc/package-info.java deleted file mode 100644 index 8beeae0a5..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/misc/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.misc; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkReceiverBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkReceiverBlock.java deleted file mode 100644 index 2db3e34a5..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkReceiverBlock.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractColoredBlock; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.StateDefinition; -import net.minecraft.world.level.block.state.properties.BooleanProperty; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class NetworkReceiverBlock extends AbstractColoredBlock implements EntityBlock { - public static final BooleanProperty ACTIVE = BooleanProperty.create("active"); - - private static final AbstractBlockEntityTicker TICKER = - new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getNetworkReceiver, ACTIVE); - private static final Component HELP = createTranslation("item", "network_receiver.help"); - - public NetworkReceiverBlock(final DyeColor color, final MutableComponent name) { - super(BlockConstants.PROPERTIES, color, name); - } - - @Override - protected BlockState getDefaultState() { - return super.getDefaultState().setValue(ACTIVE, false); - } - - @Override - protected void createBlockStateDefinition(final StateDefinition.Builder builder) { - super.createBlockStateDefinition(builder); - builder.add(ACTIVE); - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getNetworkReceiver(); - } - - @Nullable - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new NetworkReceiverBlockEntity(pos, state); - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } - - @Override - public boolean canAlwaysConnect() { - return true; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkReceiverBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkReceiverBlockEntity.java deleted file mode 100644 index 17d081a53..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/NetworkReceiverBlockEntity.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.support.network.BaseNetworkNodeContainerBlockEntity; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.state.BlockState; - -public class NetworkReceiverBlockEntity extends BaseNetworkNodeContainerBlockEntity { - public NetworkReceiverBlockEntity(final BlockPos pos, final BlockState state) { - super( - BlockEntities.INSTANCE.getNetworkReceiver(), - pos, - state, - new SimpleNetworkNode(Platform.INSTANCE.getConfig().getNetworkReceiver().getEnergyUsage()) - ); - } - - @Override - protected InWorldNetworkNodeContainer createMainContainer(final SimpleNetworkNode node) { - return PlatformApi.INSTANCE.createInWorldNetworkNodeContainer( - this, - node, - MAIN_CONTAINER_NAME, - 0, - this, - () -> new NetworkReceiverKey(mainContainer.getPosition()) - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayBlock.java deleted file mode 100644 index d43f51659..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayBlock.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractActiveColoredDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.direction.DefaultDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class RelayBlock extends AbstractActiveColoredDirectionalBlock - implements EntityBlock, BlockItemProvider { - private static final Component HELP = createTranslation("item", "relay.help"); - private static final AbstractBlockEntityTicker TICKER = new NetworkNodeBlockEntityTicker<>( - BlockEntities.INSTANCE::getRelay, - ACTIVE - ); - - public RelayBlock(final DyeColor color, final MutableComponent name) { - super(BlockConstants.PROPERTIES, color, name); - } - - @Nullable - @Override - public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { - return new RelayBlockEntity(blockPos, blockState); - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - @Override - protected DirectionType getDirectionType() { - return DefaultDirectionType.FACE_PLAYER; - } - - @Override - public BaseBlockItem createBlockItem() { - return new BaseBlockItem(this, HELP); - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getRelay(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayBlockEntity.java deleted file mode 100644 index f29f25142..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayBlockEntity.java +++ /dev/null @@ -1,253 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayComponentType; -import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayInputNetworkNode; -import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayOutputNetworkNode; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.api.storage.AccessMode; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.storage.AccessModeSettings; -import com.refinedmods.refinedstorage.platform.common.support.FilterModeSettings; -import com.refinedmods.refinedstorage.platform.common.support.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; - -import java.util.HashSet; -import java.util.Set; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.HolderLookup; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.chat.Component; -import net.minecraft.network.codec.StreamEncoder; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; - -import static java.util.Objects.requireNonNull; - -public class RelayBlockEntity extends AbstractRedstoneModeNetworkNodeContainerBlockEntity - implements NetworkNodeExtendedMenuProvider { - private static final String TAG_PASS_THROUGH = "passthrough"; - private static final String TAG_PASS_ENERGY = "passenergy"; - private static final String TAG_PASS_SECURITY = "passsecurity"; - private static final String TAG_PASS_STORAGE = "passstorage"; - private static final String TAG_FILTER_MODE = "fim"; - private static final String TAG_ACCESS_MODE = "am"; - private static final String TAG_PRIORITY = "pri"; - - private final FilterWithFuzzyMode filter; - private final RelayOutputNetworkNode outputNode; - - private boolean passThrough = true; - private FilterMode filterMode = FilterMode.BLOCK; - private AccessMode accessMode = AccessMode.INSERT_EXTRACT; - private int priority = 0; - - public RelayBlockEntity(final BlockPos pos, final BlockState state) { - super(BlockEntities.INSTANCE.getRelay(), pos, state, new RelayInputNetworkNode( - Platform.INSTANCE.getConfig().getRelay().getInputNetworkEnergyUsage() - )); - this.outputNode = new RelayOutputNetworkNode( - Platform.INSTANCE.getConfig().getRelay().getOutputNetworkEnergyUsage() - ); - this.mainNode.setOutputNode(outputNode); - this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters( - ResourceContainerImpl.createForFilter(), - this::setChanged, - this::filterContainerChanged - ); - this.mainNode.setFilterNormalizer(filter.createNormalizer()); - this.addContainer(new RelayOutputNetworkNodeContainer(this, outputNode)); - setRedstoneMode(RedstoneMode.LOW); - } - - boolean isFuzzyMode() { - return filter.isFuzzyMode(); - } - - void setFuzzyMode(final boolean fuzzyMode) { - final boolean wasActive = mainNode.isActive(); - // Updating fuzzy mode will call the filter's listener as the normalizer will yield different outputs. - // However, when updating a filter the storage resets and "self-removes". If the normalizer yields different - // outputs too early, the self-remove operation will partially fail as the expected resources will be different. - // Therefore, we need to deactivate the node, update the fuzzy mode, and then reinitialize the node (ugly hack). - mainNode.setActive(false); - filter.setFuzzyMode(fuzzyMode); - mainNode.setActive(wasActive); - } - - private void filterContainerChanged(final Set filters) { - mainNode.setFilters(filters); - setChanged(); - } - - int getPriority() { - return priority; - } - - void setPriority(final int priority) { - this.priority = priority; - this.mainNode.setPriority(priority); - setChanged(); - } - - AccessMode getAccessMode() { - return accessMode; - } - - void setAccessMode(final AccessMode accessMode) { - this.accessMode = accessMode; - mainNode.setAccessMode(accessMode); - setChanged(); - } - - FilterMode getFilterMode() { - return filterMode; - } - - void setFilterMode(final FilterMode filterMode) { - this.filterMode = filterMode; - mainNode.setFilterMode(filterMode); - setChanged(); - } - - boolean isPassEnergy() { - return mainNode.hasComponentType(RelayComponentType.ENERGY); - } - - void setPassEnergy(final boolean passEnergy) { - mainNode.updateComponentType(RelayComponentType.ENERGY, passEnergy); - setChanged(); - } - - boolean isPassStorage() { - return mainNode.hasComponentType(RelayComponentType.STORAGE); - } - - void setPassStorage(final boolean passStorage) { - mainNode.updateComponentType(RelayComponentType.STORAGE, passStorage); - setChanged(); - } - - boolean isPassSecurity() { - return mainNode.hasComponentType(RelayComponentType.SECURITY); - } - - void setPassSecurity(final boolean passSecurity) { - mainNode.updateComponentType(RelayComponentType.SECURITY, passSecurity); - setChanged(); - } - - boolean isPassThrough() { - return passThrough; - } - - void setPassThrough(final boolean passThrough) { - this.passThrough = passThrough; - this.mainNode.setComponentTypes(Set.of()); - setChanged(); - updateContainers(); - } - - boolean isActiveInternal() { - return mainNode.isActive(); - } - - Direction getDirectionInternal() { - return requireNonNull(getDirection()); - } - - @Override - protected void activenessChanged(final boolean newActive) { - super.activenessChanged(newActive); - outputNode.setActive(newActive); - updateContainers(); - } - - @Override - protected InWorldNetworkNodeContainer createMainContainer(final RelayInputNetworkNode node) { - return new RelayInputNetworkNodeContainer(this, node); - } - - @Override - public ResourceContainerData getMenuData() { - return ResourceContainerData.of(filter.getFilterContainer()); - } - - @Override - public StreamEncoder getMenuCodec() { - return ResourceContainerData.STREAM_CODEC; - } - - @Override - public Component getDisplayName() { - return ContentNames.RELAY; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return new RelayContainerMenu(syncId, player, this, filter.getFilterContainer()); - } - - @Override - public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { - super.writeConfiguration(tag, provider); - filter.save(tag, provider); - tag.putInt(TAG_FILTER_MODE, FilterModeSettings.getFilterMode(filterMode)); - tag.putBoolean(TAG_PASS_THROUGH, passThrough); - tag.putBoolean(TAG_PASS_ENERGY, mainNode.hasComponentType(RelayComponentType.ENERGY)); - tag.putBoolean(TAG_PASS_STORAGE, mainNode.hasComponentType(RelayComponentType.STORAGE)); - tag.putBoolean(TAG_PASS_SECURITY, mainNode.hasComponentType(RelayComponentType.SECURITY)); - tag.putInt(TAG_ACCESS_MODE, AccessModeSettings.getAccessMode(accessMode)); - tag.putInt(TAG_PRIORITY, priority); - } - - @Override - public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { - super.readConfiguration(tag, provider); - filter.load(tag, provider); - if (tag.contains(TAG_FILTER_MODE)) { - filterMode = FilterModeSettings.getFilterMode(tag.getInt(TAG_FILTER_MODE)); - } - mainNode.setFilterMode(filterMode); - if (tag.contains(TAG_PASS_THROUGH)) { - passThrough = tag.getBoolean(TAG_PASS_THROUGH); - } - mainNode.setComponentTypes(getComponentTypes(tag)); - if (tag.contains(TAG_ACCESS_MODE)) { - accessMode = AccessModeSettings.getAccessMode(tag.getInt(TAG_ACCESS_MODE)); - } - mainNode.setAccessMode(accessMode); - if (tag.contains(TAG_PRIORITY)) { - priority = tag.getInt(TAG_PRIORITY); - } - mainNode.setPriority(priority); - } - - private Set getComponentTypes(final CompoundTag tag) { - final Set types = new HashSet<>(); - if (tag.getBoolean(TAG_PASS_ENERGY)) { - types.add(RelayComponentType.ENERGY); - } - if (tag.getBoolean(TAG_PASS_SECURITY)) { - types.add(RelayComponentType.SECURITY); - } - if (tag.getBoolean(TAG_PASS_STORAGE)) { - types.add(RelayComponentType.STORAGE); - } - return types; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayInputNetworkNodeContainer.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayInputNetworkNodeContainer.java deleted file mode 100644 index 93c70bad6..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayInputNetworkNodeContainer.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionSink; -import com.refinedmods.refinedstorage.platform.common.support.network.InWorldNetworkNodeContainerImpl; - -import net.minecraft.core.Direction; -import net.minecraft.world.level.block.state.BlockState; - -class RelayInputNetworkNodeContainer extends InWorldNetworkNodeContainerImpl { - private final RelayBlockEntity blockEntity; - - RelayInputNetworkNodeContainer(final RelayBlockEntity blockEntity, final NetworkNode node) { - super(blockEntity, node, "input", 0, blockEntity, null); - this.blockEntity = blockEntity; - } - - @Override - public void addOutgoingConnections(final ConnectionSink sink) { - final Direction direction = blockEntity.getDirectionInternal(); - for (final Direction otherDirection : Direction.values()) { - if (otherDirection != direction || (blockEntity.isPassThrough() && blockEntity.isActiveInternal())) { - sink.tryConnectInSameDimension( - blockEntity.getBlockPos().relative(otherDirection), - otherDirection.getOpposite() - ); - } - } - } - - @Override - public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { - return incomingDirection != blockEntity.getDirectionInternal() - || (blockEntity.isPassThrough() && blockEntity.isActiveInternal()); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayOutputNetworkNodeContainer.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayOutputNetworkNodeContainer.java deleted file mode 100644 index da0ee9be3..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayOutputNetworkNodeContainer.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayOutputNetworkNode; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionSink; -import com.refinedmods.refinedstorage.platform.common.support.network.InWorldNetworkNodeContainerImpl; - -import net.minecraft.core.Direction; -import net.minecraft.world.level.block.state.BlockState; - -class RelayOutputNetworkNodeContainer extends InWorldNetworkNodeContainerImpl { - private final RelayBlockEntity blockEntity; - - RelayOutputNetworkNodeContainer(final RelayBlockEntity blockEntity, final RelayOutputNetworkNode node) { - super(blockEntity, node, "output", 0, blockEntity, null); - this.blockEntity = blockEntity; - } - - // The output network node container must always have an outgoing and incoming connection. - // If not, network node containers after the output network node container may end up without a network - // because the graph algorithm won't be able to work properly and won't be able to reassign a new network. - // The output network node container *never* provides a connection with the input network node container. - // The input network node container controls whether the output network node container is connected. - @Override - public void addOutgoingConnections(final ConnectionSink sink) { - final Direction direction = blockEntity.getDirectionInternal(); - sink.tryConnectInSameDimension( - blockEntity.getBlockPos().relative(direction), - direction.getOpposite() - ); - } - - @Override - public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { - return incomingDirection == blockEntity.getDirectionInternal(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassEnergySideButtonWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassEnergySideButtonWidget.java deleted file mode 100644 index 023e1e6b7..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassEnergySideButtonWidget.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractYesNoSideButtonWidget; - -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -class RelayPassEnergySideButtonWidget extends AbstractYesNoSideButtonWidget { - private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_energy"); - private static final MutableComponent HELP = createTranslation("gui", "relay.pass_energy.help"); - - RelayPassEnergySideButtonWidget(final ClientProperty property) { - super(property, TITLE); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 128 : 144; - } - - @Override - protected int getYTexture() { - return 0; - } - - @Nullable - @Override - protected Component getHelpText() { - return HELP; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassSecuritySideButtonWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassSecuritySideButtonWidget.java deleted file mode 100644 index 77b236435..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassSecuritySideButtonWidget.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractYesNoSideButtonWidget; - -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -class RelayPassSecuritySideButtonWidget extends AbstractYesNoSideButtonWidget { - private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_security"); - private static final MutableComponent HELP = createTranslation("gui", "relay.pass_security.help"); - - RelayPassSecuritySideButtonWidget(final ClientProperty property) { - super(property, TITLE); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 128 : 144; - } - - @Override - protected int getYTexture() { - return 32; - } - - @Nullable - @Override - protected Component getHelpText() { - return HELP; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassStorageSideButtonWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassStorageSideButtonWidget.java deleted file mode 100644 index db2b50904..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassStorageSideButtonWidget.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractYesNoSideButtonWidget; - -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -class RelayPassStorageSideButtonWidget extends AbstractYesNoSideButtonWidget { - private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_storage"); - private static final MutableComponent HELP = createTranslation("gui", "relay.pass_storage.help"); - - RelayPassStorageSideButtonWidget(final ClientProperty property) { - super(property, TITLE); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 128 : 144; - } - - @Override - protected int getYTexture() { - return 16; - } - - @Nullable - @Override - protected Component getHelpText() { - return HELP; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassThroughSideButtonWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassThroughSideButtonWidget.java deleted file mode 100644 index da4be54fe..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPassThroughSideButtonWidget.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractYesNoSideButtonWidget; - -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -class RelayPassThroughSideButtonWidget extends AbstractYesNoSideButtonWidget { - private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_through"); - private static final MutableComponent HELP = createTranslation("gui", "relay.pass_through.help"); - - RelayPassThroughSideButtonWidget(final ClientProperty property) { - super(property, TITLE); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 96 : 112; - } - - @Override - protected int getYTexture() { - return 0; - } - - @Nullable - @Override - protected Component getHelpText() { - return HELP; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPropertyTypes.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPropertyTypes.java deleted file mode 100644 index 8fa986184..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/RelayPropertyTypes.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -final class RelayPropertyTypes { - static final PropertyType PASS_THROUGH = PropertyTypes.createBooleanProperty( - createIdentifier("pass_through") - ); - static final PropertyType PASS_ENERGY = PropertyTypes.createBooleanProperty( - createIdentifier("pass_energy") - ); - static final PropertyType PASS_STORAGE = PropertyTypes.createBooleanProperty( - createIdentifier("pass_storage") - ); - static final PropertyType PASS_SECURITY = PropertyTypes.createBooleanProperty( - createIdentifier("pass_security") - ); - - private RelayPropertyTypes() { - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/package-info.java deleted file mode 100644 index d3d6c5954..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.networking; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/package-info.java deleted file mode 100644 index 1e1668a02..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardExtendedMenuProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardExtendedMenuProvider.java deleted file mode 100644 index 7717d2280..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardExtendedMenuProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.security; - -import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ExtendedMenuProvider; - -import java.util.List; -import java.util.Set; - -abstract class AbstractSecurityCardExtendedMenuProvider implements ExtendedMenuProvider { - private final SecurityPolicy securityPolicy; - private final Set dirtyPermissions; - - AbstractSecurityCardExtendedMenuProvider(final SecurityPolicy securityPolicy, - final Set dirtyPermissions) { - this.securityPolicy = securityPolicy; - this.dirtyPermissions = dirtyPermissions; - } - - protected final List getDataPermissions() { - return PlatformApi.INSTANCE.getPermissionRegistry().getAll().stream().map(this::toDataPermission).toList(); - } - - private SecurityCardData.Permission toDataPermission(final PlatformPermission permission) { - return new SecurityCardData.Permission( - permission, - securityPolicy.isAllowed(permission), - dirtyPermissions.contains(permission) - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/BuiltinPermission.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/BuiltinPermission.java deleted file mode 100644 index 27fa26f1d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/BuiltinPermission.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.security; - -import com.refinedmods.refinedstorage.platform.api.security.BuiltinPermissions; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; - -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public enum BuiltinPermission implements PlatformPermission { - /** - * Whether the player can insert resources into a network. - */ - INSERT("insert"), - /** - * Whether the player can extract resources from a network. - */ - EXTRACT("extract"), - /** - * Whether the player can start, cancel or view an autocrafting task. - */ - AUTOCRAFTING("autocrafting"), - /** - * Whether the player can open network device GUIs. - */ - OPEN("open"), - /** - * Whether the player can add or remove network devices. - */ - BUILD("build"), - /** - * Whether the player can manage the security options for a network. - */ - SECURITY("security"); - - public static final BuiltinPermissions VIEW = new BuiltinPermissions( - INSERT, - EXTRACT, - AUTOCRAFTING, - OPEN, - BUILD, - SECURITY - ); - - private final ResourceLocation id; - private final Component name; - private final Component description; - - BuiltinPermission(final String id) { - this.id = createIdentifier(id); - this.name = createTranslation("permission", id); - this.description = createTranslation("permission", id + ".description"); - } - - public ResourceLocation getId() { - return id; - } - - @Override - public Component getName() { - return name; - } - - @Override - public Component getDescription() { - return description; - } - - @Override - public Component getOwnerName() { - return ContentNames.MOD; - } - - @Override - public boolean isAllowedByDefault() { - return true; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/PlayerSecurityActor.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/PlayerSecurityActor.java deleted file mode 100644 index 57ec3b289..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/PlayerSecurityActor.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.security; - -import com.refinedmods.refinedstorage.api.network.security.SecurityActor; - -import java.util.UUID; - -public record PlayerSecurityActor(UUID playerId) implements SecurityActor { -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardData.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardData.java deleted file mode 100644 index 2f1358792..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardData.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.security; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; - -public record SecurityCardData(SlotReference slotReference, List permissions) { - public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - SlotReferenceFactory.STREAM_CODEC, SecurityCardData::slotReference, - ByteBufCodecs.collection( - ArrayList::new, - StreamCodec.composite( - PlatformApi.INSTANCE.getPermissionRegistry().streamCodec(), Permission::permission, - ByteBufCodecs.BOOL, Permission::allowed, - ByteBufCodecs.BOOL, Permission::dirty, - Permission::new - ) - ), SecurityCardData::permissions, - SecurityCardData::new - ); - - record Permission(PlatformPermission permission, boolean allowed, boolean dirty) { - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerBlock.java deleted file mode 100644 index 4b1a0a421..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerBlock.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.security; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractActiveColoredDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.HorizontalDirection; -import com.refinedmods.refinedstorage.platform.common.support.direction.HorizontalDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class SecurityManagerBlock - extends AbstractActiveColoredDirectionalBlock - implements BlockItemProvider, EntityBlock { - private static final MutableComponent HELP = createTranslation("block", "security_manager.help"); - private static final AbstractBlockEntityTicker TICKER = - new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getSecurityManager, ACTIVE); - - public SecurityManagerBlock(final DyeColor color, final MutableComponent name) { - super(BlockConstants.PROPERTIES, color, name); - } - - @Override - protected DirectionType getDirectionType() { - return HorizontalDirectionType.INSTANCE; - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getSecurityManager(); - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } - - @Nullable - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new SecurityManagerBlockEntity(pos, state); - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - @Override - public boolean canAlwaysConnect() { - return true; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerBlockEntity.java deleted file mode 100644 index d12f96dd3..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerBlockEntity.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.security; - -import com.refinedmods.refinedstorage.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode; -import com.refinedmods.refinedstorage.api.network.impl.security.SecurityDecisionProviderImpl; -import com.refinedmods.refinedstorage.platform.api.security.SecurityHelper; -import com.refinedmods.refinedstorage.platform.api.security.SecurityPolicyContainerItem; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionSink; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.BlockEntityWithDrops; -import com.refinedmods.refinedstorage.platform.common.support.FilteredContainer; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.util.ContainerUtil; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.HolderLookup; -import net.minecraft.core.NonNullList; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.state.BlockState; - -public class SecurityManagerBlockEntity - extends AbstractRedstoneModeNetworkNodeContainerBlockEntity - implements BlockEntityWithDrops, NetworkNodeMenuProvider { - static final int CARD_AMOUNT = 18; - - private static final String TAG_SECURITY_CARDS = "sc"; - private static final String TAG_FALLBACK_SECURITY_CARD = "fsc"; - - private final FilteredContainer securityCards = new FilteredContainer( - CARD_AMOUNT, - SecurityManagerBlockEntity::isValidSecurityCard - ); - private final FilteredContainer fallbackSecurityCard = new FilteredContainer( - 1, - SecurityManagerBlockEntity::isValidFallbackSecurityCard - ); - - private final SecurityDecisionProviderImpl securityDecisionProvider = new SecurityDecisionProviderImpl(); - - public SecurityManagerBlockEntity(final BlockPos pos, final BlockState state) { - super( - BlockEntities.INSTANCE.getSecurityManager(), - pos, - state, - new SecurityDecisionProviderProxyNetworkNode( - Platform.INSTANCE.getConfig().getSecurityManager().getEnergyUsage() - ) - ); - securityCards.addListener(c -> invalidate()); - fallbackSecurityCard.addListener(c -> invalidate()); - mainNode.setDelegate(securityDecisionProvider); - } - - private void invalidate() { - if (level != null) { - setChanged(); - } - securityDecisionProvider.clearPolicies(); - long energyUsage = Platform.INSTANCE.getConfig().getSecurityManager().getEnergyUsage(); - for (int i = 0; i < securityCards.getContainerSize(); ++i) { - final ItemStack securityCard = securityCards.getItem(i); - if (!(securityCard.getItem() instanceof SecurityPolicyContainerItem securityPolicyContainerItem)) { - continue; - } - energyUsage += securityPolicyContainerItem.getEnergyUsage(); - securityPolicyContainerItem.getPolicy(securityCard).ifPresent( - policy -> securityPolicyContainerItem.getActor(securityCard).ifPresent( - actor -> securityDecisionProvider.setPolicy(actor, policy))); - } - energyUsage += updateDefaultPolicyAndGetEnergyUsage(); - mainNode.setEnergyUsage(energyUsage); - } - - private long updateDefaultPolicyAndGetEnergyUsage() { - final ItemStack fallbackSecurityCardStack = fallbackSecurityCard.getItem(0); - if (fallbackSecurityCardStack.getItem() instanceof SecurityPolicyContainerItem securityPolicyContainerItem) { - securityPolicyContainerItem.getPolicy(fallbackSecurityCardStack).ifPresentOrElse( - securityDecisionProvider::setDefaultPolicy, - () -> securityDecisionProvider.setDefaultPolicy(null) - ); - return securityPolicyContainerItem.getEnergyUsage(); - } - securityDecisionProvider.setDefaultPolicy(null); - return 0; - } - - @Override - public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { - if (tag.contains(TAG_SECURITY_CARDS)) { - ContainerUtil.read(tag.getCompound(TAG_SECURITY_CARDS), securityCards, provider); - } - if (tag.contains(TAG_FALLBACK_SECURITY_CARD)) { - ContainerUtil.read(tag.getCompound(TAG_FALLBACK_SECURITY_CARD), fallbackSecurityCard, provider); - } - super.loadAdditional(tag, provider); - } - - @Override - public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { - super.saveAdditional(tag, provider); - tag.put(TAG_SECURITY_CARDS, ContainerUtil.write(securityCards, provider)); - tag.put(TAG_FALLBACK_SECURITY_CARD, ContainerUtil.write(fallbackSecurityCard, provider)); - } - - @Override - public NonNullList getDrops() { - final NonNullList drops = NonNullList.create(); - for (int i = 0; i < securityCards.getContainerSize(); ++i) { - drops.add(securityCards.getItem(i)); - } - drops.add(fallbackSecurityCard.getItem(0)); - return drops; - } - - FilteredContainer getSecurityCards() { - return securityCards; - } - - FilteredContainer getFallbackSecurityCard() { - return fallbackSecurityCard; - } - - static boolean isValidSecurityCard(final ItemStack stack) { - return stack.getItem() instanceof SecurityPolicyContainerItem securityPolicyContainerItem - && securityPolicyContainerItem.isValid(stack) - && !(stack.getItem() instanceof FallbackSecurityCardItem); - } - - static boolean isValidFallbackSecurityCard(final ItemStack stack) { - return stack.getItem() instanceof FallbackSecurityCardItem; - } - - @Override - public Component getDisplayName() { - return ContentNames.SECURITY_MANAGER; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return new SecurityManagerContainerMenu(syncId, inventory, this); - } - - @Override - public boolean canOpen(final ServerPlayer player) { - final boolean isAllowedViaSecuritySystem = NetworkNodeMenuProvider.super.canOpen(player) - && SecurityHelper.isAllowed(player, BuiltinPermission.SECURITY, getContainers()); - return isAllowedViaSecuritySystem || isPlacedBy(player.getGameProfile().getId()); - } - - @Override - public boolean canBuild(final ServerPlayer player) { - return super.canBuild(player) || isPlacedBy(player.getGameProfile().getId()); - } - - @Override - public void addOutgoingConnections(final ConnectionSink sink) { - for (final Direction direction : Direction.values()) { - if (direction == Direction.UP) { - continue; - } - sink.tryConnectInSameDimension(worldPosition.relative(direction), direction.getOpposite()); - } - } - - @Override - public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { - if (!colorsAllowConnecting(connectingState)) { - return false; - } - return incomingDirection != Direction.UP; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerContainerMenu.java deleted file mode 100644 index dafc1f52a..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerContainerMenu.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.security; - -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.FilteredContainer; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ValidatedSlot; - -import javax.annotation.Nullable; - -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.inventory.Slot; - -import static com.refinedmods.refinedstorage.platform.common.security.SecurityManagerBlockEntity.CARD_AMOUNT; - -public class SecurityManagerContainerMenu extends AbstractBaseContainerMenu { - @Nullable - private Slot fallbackSecurityCardSlot; - - public SecurityManagerContainerMenu(final int syncId, final Inventory playerInventory) { - super(Menus.INSTANCE.getSecurityManager(), syncId); - addSlots( - playerInventory, - new FilteredContainer(CARD_AMOUNT, SecurityManagerBlockEntity::isValidSecurityCard), - new FilteredContainer(1, SecurityManagerBlockEntity::isValidFallbackSecurityCard) - ); - registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - } - - SecurityManagerContainerMenu(final int syncId, - final Inventory playerInventory, - final SecurityManagerBlockEntity securityManager) { - super(Menus.INSTANCE.getSecurityManager(), syncId); - addSlots(playerInventory, securityManager.getSecurityCards(), securityManager.getFallbackSecurityCard()); - registerProperty(new ServerProperty<>( - PropertyTypes.REDSTONE_MODE, - securityManager::getRedstoneMode, - securityManager::setRedstoneMode - )); - } - - private void addSlots(final Inventory playerInventory, - final FilteredContainer securityCards, - final FilteredContainer fallbackSecurityCard) { - for (int i = 0; i < CARD_AMOUNT; ++i) { - final int column = i % 9; - final int x = 8 + (column * 18); - final int row = i / 9; - final int y = 20 + (row * 18); - addSlot(new ValidatedSlot(securityCards, i, x, y, SecurityManagerBlockEntity::isValidSecurityCard)); - } - fallbackSecurityCardSlot = new ValidatedSlot( - fallbackSecurityCard, - 0, - 174, - 20, - SecurityManagerBlockEntity::isValidFallbackSecurityCard - ); - addSlot(fallbackSecurityCardSlot); - addPlayerInventory(playerInventory, 8, 72); - transferManager.addBiTransfer(playerInventory, securityCards); - transferManager.addBiTransfer(playerInventory, fallbackSecurityCard); - } - - @Nullable - Slot getFallbackSecurityCardSlot() { - return fallbackSecurityCardSlot; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerScreen.java deleted file mode 100644 index 5d2aba12b..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityManagerScreen.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.security; - -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.HelpClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; - -import java.util.List; - -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class SecurityManagerScreen extends AbstractBaseScreen { - private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/security_manager.png"); - - public SecurityManagerScreen(final SecurityManagerContainerMenu menu, - final Inventory playerInventory, - final Component text) { - super(menu, playerInventory, text); - this.inventoryLabelY = 59; - this.imageWidth = 197; - this.imageHeight = 154; - } - - @Override - protected void init() { - super.init(); - addSideButton(new RedstoneModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.REDSTONE_MODE), - createTranslation("gui", "security_manager.redstone_mode_help") - )); - } - - @Override - protected void renderTooltip(final GuiGraphics graphics, final int x, final int y) { - if (hoveredSlot != null && hoveredSlot == menu.getFallbackSecurityCardSlot() && !hoveredSlot.hasItem()) { - Platform.INSTANCE.renderTooltip(graphics, List.of( - ClientTooltipComponent.create( - createTranslation("gui", "security_manager.fallback_security_card_slot_hint").getVisualOrderText() - ), - HelpClientTooltipComponent.create( - createTranslation("gui", "security_manager.no_fallback_security_card_consequence") - ) - ), x, y); - return; - } - super.renderTooltip(graphics, x, y); - } - - @Override - protected ResourceLocation getTexture() { - return TEXTURE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/package-info.java deleted file mode 100644 index 41a347413..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.security; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/FluidStorageType.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/FluidStorageType.java deleted file mode 100644 index e68d49576..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/FluidStorageType.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage; - -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageType; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; - -import javax.annotation.Nullable; - -import com.mojang.serialization.MapCodec; - -public class FluidStorageType implements StorageType { - FluidStorageType() { - } - - @Override - public SerializableStorage create(@Nullable final Long capacity, final Runnable listener) { - return StorageTypes.createHomogeneousStorage( - StorageTypes.FLUID, - StorageCodecs.StorageData.empty(capacity), - listener - ); - } - - @Override - public MapCodec getMapCodec(final Runnable listener) { - return StorageCodecs.homogeneousStorageData( - ResourceCodecs.FLUID_CODEC - ).xmap(storageData -> StorageTypes.createHomogeneousStorage( - StorageTypes.FLUID, - storageData, - listener - ), storage -> StorageCodecs.StorageData.ofHomogeneousStorage( - storage, - FluidStorageType.this::isAllowed, - FluidResource.class::cast - )); - } - - @Override - public boolean isAllowed(final ResourceKey resource) { - return resource instanceof FluidResource; - } - - @Override - public long getDiskInterfaceTransferQuota(final boolean stackUpgrade) { - return stackUpgrade ? Platform.INSTANCE.getBucketAmount() * 16 : Platform.INSTANCE.getBucketAmount(); - } - - public enum Variant { - SIXTY_FOUR_B("64b", 64L), - TWO_HUNDRED_FIFTY_SIX_B("256b", 256L), - THOUSAND_TWENTY_FOUR_B("1024b", 1024L), - FOUR_THOUSAND_NINETY_SIX_B("4096b", 4096L), - CREATIVE("creative", null); - - private final String name; - @Nullable - private final Long capacityInBuckets; - - Variant(final String name, @Nullable final Long capacityInBuckets) { - this.name = name; - this.capacityInBuckets = capacityInBuckets; - } - - public String getName() { - return name; - } - - @Nullable - public Long getCapacityInBuckets() { - return capacityInBuckets; - } - - @Nullable - public Long getCapacity() { - if (capacityInBuckets == null) { - return null; - } - return capacityInBuckets * Platform.INSTANCE.getBucketAmount(); - } - - public boolean hasCapacity() { - return capacityInBuckets != null; - } - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/ItemStorageType.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/ItemStorageType.java deleted file mode 100644 index a1d8db5c1..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/ItemStorageType.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage; - -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageType; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; - -import javax.annotation.Nullable; - -import com.mojang.serialization.MapCodec; - -public class ItemStorageType implements StorageType { - ItemStorageType() { - } - - @Override - public SerializableStorage create(@Nullable final Long capacity, final Runnable listener) { - return StorageTypes.createHomogeneousStorage( - StorageTypes.ITEM, - StorageCodecs.StorageData.empty(capacity), - listener - ); - } - - @Override - public MapCodec getMapCodec(final Runnable listener) { - return StorageCodecs.homogeneousStorageData( - ResourceCodecs.ITEM_CODEC - ).xmap(storageData -> StorageTypes.createHomogeneousStorage( - StorageTypes.ITEM, - storageData, - listener - ), storage -> StorageCodecs.StorageData.ofHomogeneousStorage( - storage, - ItemStorageType.this::isAllowed, - ItemResource.class::cast - )); - } - - @Override - public boolean isAllowed(final ResourceKey resource) { - return resource instanceof ItemResource; - } - - @Override - public long getDiskInterfaceTransferQuota(final boolean stackUpgrade) { - return stackUpgrade ? 64 : 1; - } - - public enum Variant { - ONE_K("1k", 1024L), - FOUR_K("4k", 1024 * 4L), - SIXTEEN_K("16k", 1024 * 4 * 4L), - SIXTY_FOUR_K("64k", 1024 * 4 * 4 * 4L), - CREATIVE("creative", null); - - private final String name; - @Nullable - private final Long capacity; - - Variant(final String name, @Nullable final Long capacity) { - this.name = name; - this.capacity = capacity; - } - - public String getName() { - return name; - } - - @Nullable - public Long getCapacity() { - return capacity; - } - - public boolean hasCapacity() { - return capacity != null; - } - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageAccessor.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageAccessor.java deleted file mode 100644 index e75df6a63..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageAccessor.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage; - -public interface StorageAccessor { - long getStored(); - - long getCapacity(); - - double getProgress(); - - boolean hasCapacity(); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StoragePropertyTypes.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StoragePropertyTypes.java deleted file mode 100644 index 2b1bec840..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StoragePropertyTypes.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage; - -import com.refinedmods.refinedstorage.api.storage.AccessMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public final class StoragePropertyTypes { - public static final PropertyType PRIORITY = PropertyTypes.createIntegerProperty( - createIdentifier("priority") - ); - - public static final PropertyType ACCESS_MODE = new PropertyType<>( - createIdentifier("access_mode"), - AccessModeSettings::getAccessMode, - AccessModeSettings::getAccessMode - ); - - public static final PropertyType VOID_EXCESS = PropertyTypes.createBooleanProperty( - createIdentifier("void_excess") - ); - - private StoragePropertyTypes() { - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageTypes.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageTypes.java deleted file mode 100644 index 9dcea3419..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/StorageTypes.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage; - -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; -import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; -import com.refinedmods.refinedstorage.api.storage.tracked.InMemoryTrackedStorageRepository; -import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl; -import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageRepository; -import com.refinedmods.refinedstorage.platform.api.storage.StorageType; - -public final class StorageTypes { - public static final StorageType ITEM = new ItemStorageType(); - public static final StorageType FLUID = new FluidStorageType(); - - private StorageTypes() { - } - - static PlatformStorage createHomogeneousStorage(final StorageType type, - final StorageCodecs.StorageData data, - final Runnable listener) { - final TrackedStorageRepository trackingRepository = new InMemoryTrackedStorageRepository(); - final TrackedStorageImpl tracked = new TrackedStorageImpl( - new InMemoryStorageImpl(), - trackingRepository, - System::currentTimeMillis - ); - final PlatformStorage storage = data.capacity().map(capacity -> { - final LimitedStorageImpl limited = new LimitedStorageImpl(tracked, capacity); - return (PlatformStorage) new LimitedPlatformStorage(limited, type, trackingRepository, listener); - }).orElseGet(() -> new PlatformStorage(tracked, type, trackingRepository, listener)); - data.resources().forEach(storage::load); - return storage; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/VoidExcessSideButtonWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/VoidExcessSideButtonWidget.java deleted file mode 100644 index cd2583f75..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/VoidExcessSideButtonWidget.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.widget.AbstractYesNoSideButtonWidget; - -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class VoidExcessSideButtonWidget extends AbstractYesNoSideButtonWidget { - private static final Component HELP = createTranslation("gui", "void_excess.help"); - private static final Component ALLOWLIST_WARNING = createTranslation( - "gui", - "void_excess.allowlist_warning" - ); - - public VoidExcessSideButtonWidget(final ClientProperty property) { - super(property, createTranslation("gui", "void_excess")); - } - - public void setWarningVisible(final boolean visible) { - if (visible) { - setWarning(ALLOWLIST_WARNING); - } else { - setWarning(null); - } - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 16 : 0; - } - - @Override - protected int getYTexture() { - return 240 - 15; - } - - @Override - @Nullable - protected Component getHelpText() { - return HELP; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/DiskDriveBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/DiskDriveBlock.java deleted file mode 100644 index 860a2be16..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/DiskDriveBlock.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskdrive; - -import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.storage.DiskContainerBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; - -import java.util.function.BiFunction; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class DiskDriveBlock extends AbstractDirectionalBlock implements EntityBlock { - private static final Component HELP = createTranslation("item", "disk_drive.help"); - private static final DiskContainerBlockEntityTicker TICKER = - new DiskContainerBlockEntityTicker<>(BlockEntities.INSTANCE::getDiskDrive); - - private final BiFunction blockEntityFactory; - - public DiskDriveBlock(final BiFunction blockEntityFactory) { - super(BlockConstants.PROPERTIES); - this.blockEntityFactory = blockEntityFactory; - } - - @Override - protected DirectionType getDirectionType() { - return BiDirectionType.INSTANCE; - } - - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return blockEntityFactory.apply(pos, state); - } - - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState state, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - public BlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/DiskDriveContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/DiskDriveContainerMenu.java deleted file mode 100644 index f8c7d47e2..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/DiskDriveContainerMenu.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskdrive; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItem; -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.storage.AbstractStorageContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.StorageAccessor; -import com.refinedmods.refinedstorage.platform.common.storage.StorageConfigurationContainer; -import com.refinedmods.refinedstorage.platform.common.support.FilteredContainer; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlot; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlotType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ValidatedSlot; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class DiskDriveContainerMenu extends AbstractStorageContainerMenu implements StorageAccessor { - private static final int DISK_SLOT_X = 61; - private static final int DISK_SLOT_Y = 54; - - private static final int FILTER_SLOT_X = 8; - private static final int FILTER_SLOT_Y = 20; - - private final StorageDiskInfoAccessor storageInfoAccessor; - - private final List diskSlots = new ArrayList<>(); - - public DiskDriveContainerMenu(final int syncId, - final Inventory playerInventory, - final ResourceContainerData resourceContainerData) { - super(Menus.INSTANCE.getDiskDrive(), syncId); - this.storageInfoAccessor = new StorageDiskInfoAccessorImpl(PlatformApi.INSTANCE.getClientStorageRepository()); - addSlots( - playerInventory.player, - new FilteredContainer( - AbstractDiskDriveBlockEntity.AMOUNT_OF_DISKS, - StorageContainerItem.stackValidator() - ), - ResourceContainerImpl.createForFilter(resourceContainerData) - ); - } - - DiskDriveContainerMenu(final int syncId, - final Player player, - final FilteredContainer diskInventory, - final ResourceContainer filterContainer, - final StorageConfigurationContainer configContainer, - final StorageDiskInfoAccessor storageInfoAccessor) { - super(Menus.INSTANCE.getDiskDrive(), syncId, player, configContainer); - this.storageInfoAccessor = storageInfoAccessor; - addSlots(player, diskInventory, filterContainer); - } - - private void addSlots(final Player player, - final FilteredContainer diskInventory, - final ResourceContainer filterContainer) { - for (int i = 0; i < diskInventory.getContainerSize(); ++i) { - diskSlots.add(addSlot(createDiskSlot(diskInventory, i))); - } - for (int i = 0; i < filterContainer.size(); ++i) { - addSlot(createFilterSlot(filterContainer, i)); - } - addPlayerInventory(player.getInventory(), 8, 141); - - transferManager.addBiTransfer(player.getInventory(), diskInventory); - transferManager.addFilterTransfer(player.getInventory()); - } - - private Slot createFilterSlot(final ResourceContainer filterContainer, final int i) { - final int x = FILTER_SLOT_X + (18 * i); - return new ResourceSlot( - filterContainer, - i, - createTranslation("gui", "storage.filter_help"), - x, - FILTER_SLOT_Y, - ResourceSlotType.FILTER - ); - } - - private Slot createDiskSlot(final FilteredContainer diskInventory, final int i) { - final int x = DISK_SLOT_X + ((i % 2) * 18); - final int y = DISK_SLOT_Y + Math.floorDiv(i, 2) * 18; - return ValidatedSlot.forStorageContainer(diskInventory, i, x, y); - } - - @Override - public boolean hasCapacity() { - return getStorageDiskInfo().allMatch(info -> info.capacity() > 0); - } - - @Override - public double getProgress() { - if (!hasCapacity()) { - return 0; - } - return (double) getStored() / (double) getCapacity(); - } - - @Override - public long getCapacity() { - return getStorageDiskInfo().mapToLong(StorageInfo::capacity).sum(); - } - - @Override - public long getStored() { - return getStorageDiskInfo().mapToLong(StorageInfo::stored).sum(); - } - - private Stream getDiskStacks() { - return diskSlots - .stream() - .map(Slot::getItem) - .filter(stack -> !stack.isEmpty()); - } - - private Stream getStorageDiskInfo() { - return getDiskStacks() - .map(storageInfoAccessor::getInfo) - .flatMap(Optional::stream); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/DiskDriveScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/DiskDriveScreen.java deleted file mode 100644 index 745da1481..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/DiskDriveScreen.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskdrive; - -import com.refinedmods.refinedstorage.platform.common.storage.AbstractProgressStorageScreen; - -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class DiskDriveScreen extends AbstractProgressStorageScreen { - private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/disk_drive.png"); - private static final MutableComponent DISKS_TEXT = createTranslation("gui", "disk_drive.disks"); - - public DiskDriveScreen(final DiskDriveContainerMenu menu, final Inventory playerInventory, final Component text) { - super(menu, playerInventory, text, 99); - } - - @Override - protected ResourceLocation getTexture() { - return TEXTURE; - } - - @Override - protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { - super.renderLabels(graphics, mouseX, mouseY); - graphics.drawString(font, DISKS_TEXT, 60, 42, 4210752, false); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/EmptyStorageDiskInfoAccessor.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/EmptyStorageDiskInfoAccessor.java deleted file mode 100644 index b8ccde194..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/EmptyStorageDiskInfoAccessor.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskdrive; - -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; - -import java.util.Optional; - -import net.minecraft.world.item.ItemStack; - -class EmptyStorageDiskInfoAccessor implements StorageDiskInfoAccessor { - @Override - public Optional getInfo(final ItemStack stack) { - return Optional.empty(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/StorageDiskInfoAccessor.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/StorageDiskInfoAccessor.java deleted file mode 100644 index bcfb91fa7..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/StorageDiskInfoAccessor.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskdrive; - -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; - -import java.util.Optional; - -import net.minecraft.world.item.ItemStack; - -interface StorageDiskInfoAccessor { - Optional getInfo(ItemStack stack); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/StorageDiskInfoAccessorImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/StorageDiskInfoAccessorImpl.java deleted file mode 100644 index 72c37a22a..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/StorageDiskInfoAccessorImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskdrive; - -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItem; -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; - -import java.util.Optional; - -import net.minecraft.world.item.ItemStack; - -class StorageDiskInfoAccessorImpl implements StorageDiskInfoAccessor { - private final StorageRepository storageRepository; - - StorageDiskInfoAccessorImpl(final StorageRepository storageRepository) { - this.storageRepository = storageRepository; - } - - @Override - public Optional getInfo(final ItemStack stack) { - if (stack.getItem() instanceof StorageContainerItem storageContainerItem) { - return storageContainerItem.getInfo(storageRepository, stack); - } - return Optional.empty(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/package-info.java deleted file mode 100644 index 5969eb633..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskdrive/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.storage.diskdrive; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfaceBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfaceBlock.java deleted file mode 100644 index 516bd4498..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfaceBlock.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskinterface; - -import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferNetworkNode; -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.storage.DiskContainerBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.AbstractActiveColoredDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; - -import java.util.function.BiFunction; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class DiskInterfaceBlock - extends AbstractActiveColoredDirectionalBlock - implements EntityBlock, BlockItemProvider { - private static final Component HELP = createTranslation("item", "disk_interface.help"); - private static final DiskContainerBlockEntityTicker - TICKER = new DiskContainerBlockEntityTicker<>(BlockEntities.INSTANCE::getDiskInterface, ACTIVE); - - private final BiFunction blockEntityFactory; - - public DiskInterfaceBlock(final DyeColor color, - final MutableComponent name, - final BiFunction - blockEntityFactory) { - super(BlockConstants.PROPERTIES, color, name); - this.blockEntityFactory = blockEntityFactory; - } - - @Override - protected DirectionType getDirectionType() { - return BiDirectionType.INSTANCE; - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - @Nullable - @Override - public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { - return blockEntityFactory.apply(blockPos, blockState); - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getDiskInterface(); - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } - - @Override - public boolean canAlwaysConnect() { - return true; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfaceContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfaceContainerMenu.java deleted file mode 100644 index 3d72909cb..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfaceContainerMenu.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskinterface; - -import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferMode; -import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItem; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.storage.DiskInventory; -import com.refinedmods.refinedstorage.platform.common.support.FilteredContainer; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlot; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlotType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ValidatedSlot; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeSlot; - -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class DiskInterfaceContainerMenu extends AbstractResourceContainerMenu { - private static final int DISK_SLOT_X1 = 44; - private static final int DISK_SLOT_X2 = 116; - private static final int DISK_SLOT_Y = 57; - - private static final int FILTER_SLOT_X = 8; - private static final int FILTER_SLOT_Y = 20; - - DiskInterfaceContainerMenu(final int syncId, - final Player player, - final AbstractDiskInterfaceBlockEntity blockEntity, - final DiskInventory diskInventory, - final ResourceContainer filterContainer, - final UpgradeContainer upgradeContainer) { - super(Menus.INSTANCE.getDiskInterface(), syncId, player); - addSlots(player, diskInventory, filterContainer, upgradeContainer); - registerProperty(new ServerProperty<>( - PropertyTypes.REDSTONE_MODE, - blockEntity::getRedstoneMode, - blockEntity::setRedstoneMode - )); - registerProperty(new ServerProperty<>( - PropertyTypes.FUZZY_MODE, - blockEntity::isFuzzyMode, - blockEntity::setFuzzyMode - )); - registerProperty(new ServerProperty<>( - PropertyTypes.FILTER_MODE, - blockEntity::getFilterMode, - blockEntity::setFilterMode - )); - registerProperty(new ServerProperty<>( - DiskInterfacePropertyTypes.TRANSFER_MODE, - blockEntity::getTransferMode, - blockEntity::setTransferMode - )); - } - - public DiskInterfaceContainerMenu(final int syncId, - final Inventory playerInventory, - final ResourceContainerData resourceContainerData) { - super(Menus.INSTANCE.getDiskInterface(), syncId); - addSlots( - playerInventory.player, - new FilteredContainer( - AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS, - StorageContainerItem.stackValidator() - ), - ResourceContainerImpl.createForFilter(resourceContainerData), - new UpgradeContainer(UpgradeDestinations.DISK_INTERFACE, PlatformApi.INSTANCE.getUpgradeRegistry()) - ); - registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); - registerProperty(new ClientProperty<>(PropertyTypes.FILTER_MODE, FilterMode.BLOCK)); - registerProperty(new ClientProperty<>( - DiskInterfacePropertyTypes.TRANSFER_MODE, - StorageTransferMode.INSERT_INTO_NETWORK - )); - } - - private void addSlots(final Player player, - final FilteredContainer diskInventory, - final ResourceContainer filterContainer, - final UpgradeContainer upgradeContainer) { - for (int i = 0; i < diskInventory.getContainerSize(); ++i) { - addSlot(createDiskSlot(diskInventory, i)); - } - for (int i = 0; i < filterContainer.size(); ++i) { - addSlot(createFilterSlot(filterContainer, i)); - } - for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { - addSlot(new UpgradeSlot(upgradeContainer, i, 187, 6 + (i * 18))); - } - addPlayerInventory(player.getInventory(), 8, 129); - - transferManager.addBiTransfer(player.getInventory(), upgradeContainer); - transferManager.addBiTransfer(player.getInventory(), diskInventory); - transferManager.addFilterTransfer(player.getInventory()); - } - - private Slot createFilterSlot(final ResourceContainer filterContainer, final int i) { - final int x = FILTER_SLOT_X + (18 * i); - return new ResourceSlot( - filterContainer, - i, - createTranslation("gui", "disk_interface.filter_help"), - x, - FILTER_SLOT_Y, - ResourceSlotType.FILTER - ); - } - - private Slot createDiskSlot(final FilteredContainer diskInventory, final int i) { - final int x = i < 3 ? DISK_SLOT_X1 : DISK_SLOT_X2; - final int y = DISK_SLOT_Y + ((i % 3) * 18); - return ValidatedSlot.forStorageContainer(diskInventory, i, x, y); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfacePropertyTypes.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfacePropertyTypes.java deleted file mode 100644 index 05e1eed81..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/DiskInterfacePropertyTypes.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskinterface; - -import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -class DiskInterfacePropertyTypes { - public static final PropertyType TRANSFER_MODE = new PropertyType<>( - createIdentifier("transfer_mode"), - TransferModeSettings::getTransferMode, - TransferModeSettings::getTransferMode - ); - - private DiskInterfacePropertyTypes() { - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSettings.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSettings.java deleted file mode 100644 index 3f0419cb8..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSettings.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.diskinterface; - -import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferMode; - -class TransferModeSettings { - private static final int INSERT_INTO_NETWORK = 0; - private static final int EXTRACT_FROM_NETWORK = 1; - - private TransferModeSettings() { - } - - static StorageTransferMode getTransferMode(final int transferMode) { - return switch (transferMode) { - case INSERT_INTO_NETWORK -> StorageTransferMode.INSERT_INTO_NETWORK; - case EXTRACT_FROM_NETWORK -> StorageTransferMode.EXTRACT_FROM_NETWORK; - default -> StorageTransferMode.INSERT_INTO_NETWORK; - }; - } - - static int getTransferMode(final StorageTransferMode transferMode) { - return switch (transferMode) { - case INSERT_INTO_NETWORK -> INSERT_INTO_NETWORK; - case EXTRACT_FROM_NETWORK -> EXTRACT_FROM_NETWORK; - }; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/package-info.java deleted file mode 100644 index a7e3a6fd5..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.storage.diskinterface; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java deleted file mode 100644 index 785db57fa..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.externalstorage; - -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.storage.AbstractStorageContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.StorageConfigurationContainer; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlot; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlotType; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; - -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ExternalStorageContainerMenu extends AbstractStorageContainerMenu { - private static final int FILTER_SLOT_X = 8; - private static final int FILTER_SLOT_Y = 20; - - public ExternalStorageContainerMenu(final int syncId, - final Inventory playerInventory, - final ResourceContainerData resourceContainerData) { - super(Menus.INSTANCE.getExternalStorage(), syncId); - addSlots(playerInventory.player, ResourceContainerImpl.createForFilter(resourceContainerData)); - } - - ExternalStorageContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { - super(Menus.INSTANCE.getExternalStorage(), syncId, player, configContainer); - addSlots(player, resourceContainer); - } - - private void addSlots(final Player player, - final ResourceContainer resourceContainer) { - for (int i = 0; i < resourceContainer.size(); ++i) { - addSlot(createFilterSlot(resourceContainer, i)); - } - addPlayerInventory(player.getInventory(), 8, 55); - transferManager.addFilterTransfer(player.getInventory()); - } - - private Slot createFilterSlot(final ResourceContainer resourceContainer, final int i) { - final int x = FILTER_SLOT_X + (18 * i); - return new ResourceSlot( - resourceContainer, - i, - createTranslation("gui", "storage.filter_help"), - x, - FILTER_SLOT_Y, - ResourceSlotType.FILTER - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageScreen.java deleted file mode 100644 index cc24c5c12..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageScreen.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.externalstorage; - -import com.refinedmods.refinedstorage.platform.common.storage.AbstractStorageScreen; -import com.refinedmods.refinedstorage.platform.common.support.AbstractFilterScreen; - -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -public class ExternalStorageScreen extends AbstractStorageScreen { - public ExternalStorageScreen(final ExternalStorageContainerMenu menu, - final Inventory inventory, - final Component title) { - super(menu, inventory, title); - this.inventoryLabelY = 42; - this.imageWidth = 210; - this.imageHeight = 137; - } - - @Override - protected ResourceLocation getTexture() { - return AbstractFilterScreen.TEXTURE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/package-info.java deleted file mode 100644 index bc6a6ba23..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.storage.externalstorage; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/package-info.java deleted file mode 100644 index 5f48a4196..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.storage; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/AbstractPortableGridContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/AbstractPortableGridContainerMenu.java deleted file mode 100644 index f1d8c93b8..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/AbstractPortableGridContainerMenu.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; - -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItem; -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.grid.PortableGridData; -import com.refinedmods.refinedstorage.platform.common.storage.DiskInventory; -import com.refinedmods.refinedstorage.platform.common.support.FilteredContainer; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ValidatedSlot; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyInfo; - -import javax.annotation.Nullable; - -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.inventory.Slot; - -public abstract class AbstractPortableGridContainerMenu extends AbstractGridContainerMenu - implements EnergyContainerMenu { - private final FilteredContainer diskInventory; - private final EnergyInfo energyInfo; - - @Nullable - private Slot diskSlot; - - AbstractPortableGridContainerMenu( - final MenuType menuType, - final int syncId, - final Inventory playerInventory, - final PortableGridData portableGridData - ) { - super(menuType, syncId, playerInventory, portableGridData.gridData()); - this.diskInventory = new FilteredContainer(1, StorageContainerItem.stackValidator()); - this.energyInfo = EnergyInfo.forClient( - playerInventory.player, - portableGridData.stored(), - portableGridData.capacity() - ); - } - - AbstractPortableGridContainerMenu( - final MenuType menuType, - final int syncId, - final Inventory playerInventory, - final DiskInventory diskInventory, - final Grid grid, - final EnergyStorage energyStorage - ) { - super(menuType, syncId, playerInventory, grid); - this.diskInventory = diskInventory; - this.energyInfo = EnergyInfo.forServer( - playerInventory.player, - energyStorage::getStored, - energyStorage::getCapacity - ); - } - - @Override - public void broadcastChanges() { - super.broadcastChanges(); - energyInfo.detectChanges(); - } - - @Override - protected boolean canTransferSlot(final Slot slot) { - return slot != diskSlot; - } - - @Override - public void onScreenReady(final int playerInventoryY) { - super.onScreenReady(playerInventoryY); - diskSlot = ValidatedSlot.forStorageContainer(diskInventory, 0, -19, 8); - addSlot(diskSlot); - transferManager.addBiTransfer(playerInventory, diskInventory); - } - - @Override - public EnergyInfo getEnergyInfo() { - return energyInfo; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGrid.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGrid.java deleted file mode 100644 index b93d7a033..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGrid.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.api.grid.operations.NoopGridOperations; -import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher; -import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManager; -import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManagerImpl; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.NoopStorage; -import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage; -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.storage.DiskInventory; - -import java.util.Collections; -import java.util.List; -import javax.annotation.Nullable; - -import net.minecraft.server.level.ServerPlayer; - -class PortableGrid implements Grid { - private final EnergyStorage energyStorage; - private final DiskInventory diskInventory; - private final GridWatcherManager watchers = new GridWatcherManagerImpl(); - private final StateTrackedStorage.Listener diskListener; - @Nullable - private PortableGridStorage storage; - - PortableGrid(final EnergyStorage energyStorage, - final DiskInventory diskInventory, - final StateTrackedStorage.Listener diskListener) { - this.energyStorage = energyStorage; - this.diskInventory = diskInventory; - this.diskListener = diskListener; - } - - void updateStorage() { - if (storage != null) { - watchers.detachAll(storage.getStorageChannel()); - } - - this.storage = diskInventory.resolve(0) - .map(diskStorage -> new StateTrackedStorage(diskStorage, diskListener)) - .map(PortableGridStorage::new) - .orElse(null); - - watchers.attachAll(getStorageChannel()); - } - - void activeChanged(final boolean active) { - watchers.activeChanged(active); - } - - StorageState getStorageState() { - if (storage == null) { - return StorageState.NONE; - } - if (!isGridActive()) { - return StorageState.INACTIVE; - } - return storage.getState(); - } - - @Override - public void addWatcher(final GridWatcher watcher, final Class actorType) { - energyStorage.extract(Platform.INSTANCE.getConfig().getPortableGrid().getOpenEnergyUsage(), Action.EXECUTE); - watchers.addWatcher(watcher, actorType, getStorageChannel()); - } - - @Override - public void removeWatcher(final GridWatcher watcher) { - watchers.removeWatcher(watcher, getStorageChannel()); - } - - @Nullable - private StorageChannel getStorageChannel() { - return storage != null ? storage.getStorageChannel() : null; - } - - @Override - public Storage getItemStorage() { - if (storage == null) { - return new NoopStorage(); - } - return storage.getStorageChannel(); - } - - @Override - public boolean isGridActive() { - return energyStorage.getStored() > 0 && storage != null; - } - - @Override - public List getResources(final Class actorType) { - if (storage == null) { - return Collections.emptyList(); - } - final StorageChannel storageChannel = storage.getStorageChannel(); - return storageChannel.getAll().stream().map(resource -> new TrackedResourceAmount( - resource, - storageChannel.findTrackedResourceByActorType(resource.getResource(), actorType).orElse(null) - )).toList(); - } - - @Override - public GridOperations createOperations(final ResourceType resourceType, final ServerPlayer player) { - if (storage == null) { - return new NoopGridOperations(); - } - final StorageChannel storageChannel = this.storage.getStorageChannel(); - final GridOperations operations = resourceType.createGridOperations(storageChannel, new PlayerActor(player)); - return new PortableGridOperations(operations, energyStorage); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockContainerMenu.java deleted file mode 100644 index 705d9326e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockContainerMenu.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; - -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.grid.PortableGridData; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; - -import net.minecraft.world.entity.player.Inventory; - -public class PortableGridBlockContainerMenu extends AbstractPortableGridContainerMenu { - public PortableGridBlockContainerMenu(final int syncId, - final Inventory playerInventory, - final PortableGridData portableGridData) { - super(Menus.INSTANCE.getPortableGridBlock(), syncId, playerInventory, portableGridData); - registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - this.onScreenReady(0); - } - - PortableGridBlockContainerMenu(final int syncId, - final Inventory playerInventory, - final AbstractPortableGridBlockEntity portableGrid) { - super( - Menus.INSTANCE.getPortableGridBlock(), - syncId, - playerInventory, - portableGrid.getDiskInventory(), - portableGrid.getGrid(), - portableGrid.getEnergyStorage() - ); - registerProperty(new ServerProperty<>( - PropertyTypes.REDSTONE_MODE, - portableGrid::getRedstoneMode, - portableGrid::setRedstoneMode - )); - this.onScreenReady(0); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItemRenderInfo.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItemRenderInfo.java deleted file mode 100644 index 622e5ff67..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItemRenderInfo.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; - -import com.refinedmods.refinedstorage.platform.common.storage.Disk; - -public record PortableGridBlockItemRenderInfo(boolean active, Disk disk) { -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemContainerMenu.java deleted file mode 100644 index 4b38368e8..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemContainerMenu.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; - -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.grid.PortableGridData; -import com.refinedmods.refinedstorage.platform.common.storage.DiskInventory; - -import net.minecraft.world.entity.player.Inventory; - -public class PortableGridItemContainerMenu extends AbstractPortableGridContainerMenu { - public PortableGridItemContainerMenu(final int syncId, - final Inventory playerInventory, - final PortableGridData portableGridData) { - super(Menus.INSTANCE.getPortableGridItem(), syncId, playerInventory, portableGridData); - this.disabledSlot = portableGridData.slotReference().orElse(null); - this.onScreenReady(0); - } - - PortableGridItemContainerMenu(final int syncId, - final Inventory playerInventory, - final DiskInventory diskInventory, - final Grid grid, - final EnergyStorage energyStorage, - final SlotReference slotReference) { - super( - Menus.INSTANCE.getPortableGridItem(), - syncId, - playerInventory, - diskInventory, - grid, - energyStorage - ); - this.disabledSlot = slotReference; - this.onScreenReady(0); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridStorage.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridStorage.java deleted file mode 100644 index 4d50d8b66..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridStorage.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; - -import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage; -import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannelImpl; - -class PortableGridStorage { - private final StorageChannel storageChannel; - private final StateTrackedStorage diskStorage; - - PortableGridStorage(final StateTrackedStorage diskStorage) { - this.storageChannel = new StorageChannelImpl(); - this.diskStorage = diskStorage; - this.storageChannel.addSource(diskStorage); - } - - StorageState getState() { - return diskStorage.getState(); - } - - StorageChannel getStorageChannel() { - return storageChannel; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridType.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridType.java deleted file mode 100644 index d918199a9..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridType.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; - -public enum PortableGridType { - NORMAL, - CREATIVE -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/package-info.java deleted file mode 100644 index 1e9358339..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.storage.portablegrid; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlockContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlockContainerMenu.java deleted file mode 100644 index 8391f7b20..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlockContainerMenu.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; -import com.refinedmods.refinedstorage.platform.common.storage.AbstractStorageContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.StorageAccessor; -import com.refinedmods.refinedstorage.platform.common.storage.StorageConfigurationContainer; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlot; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlotType; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; - -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.inventory.Slot; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public abstract class AbstractStorageBlockContainerMenu extends AbstractStorageContainerMenu - implements StorageAccessor { - private static final int FILTER_SLOT_X = 8; - private static final int FILTER_SLOT_Y = 20; - - private long stored; - private long capacity; - - protected AbstractStorageBlockContainerMenu(final MenuType type, - final int syncId, - final Player player, - final StorageBlockData storageBlockData, - final ResourceFactory resourceFactory) { - super(type, syncId); - this.stored = storageBlockData.stored(); - this.capacity = storageBlockData.capacity(); - addSlots( - player, - ResourceContainerImpl.createForFilter(resourceFactory, storageBlockData.resourceContainerData()) - ); - } - - protected AbstractStorageBlockContainerMenu(final MenuType type, - final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { - super(type, syncId, player, configContainer); - addSlots(player, resourceContainer); - } - - private void addSlots(final Player player, final ResourceContainer resourceContainer) { - for (int i = 0; i < resourceContainer.size(); ++i) { - addSlot(createFilterSlot(resourceContainer, i)); - } - addPlayerInventory(player.getInventory(), 8, 141); - - transferManager.addFilterTransfer(player.getInventory()); - } - - private Slot createFilterSlot(final ResourceContainer resourceContainer, final int i) { - final int x = FILTER_SLOT_X + (18 * i); - return new ResourceSlot( - resourceContainer, - i, - createTranslation("gui", "storage.filter_help"), - x, - FILTER_SLOT_Y, - ResourceSlotType.FILTER - ); - } - - @Override - public double getProgress() { - if (capacity == 0) { - return 0; - } - return (double) getStored() / (double) getCapacity(); - } - - @Override - public long getCapacity() { - return capacity; - } - - @Override - public long getStored() { - return stored; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlockScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlockScreen.java deleted file mode 100644 index 0dad49c2e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/AbstractStorageBlockScreen.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.platform.common.storage.AbstractProgressStorageScreen; - -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -abstract class AbstractStorageBlockScreen extends AbstractProgressStorageScreen { - private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/storage.png"); - - protected AbstractStorageBlockScreen(final AbstractStorageBlockContainerMenu menu, - final Inventory inventory, - final Component title) { - super(menu, inventory, title, 80); - } - - @Override - protected ResourceLocation getTexture() { - return TEXTURE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlock.java deleted file mode 100644 index a718fcfab..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlock.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; - -public class FluidStorageBlock extends AbstractStorageBlock { - private final FluidStorageType.Variant variant; - - public FluidStorageBlock(final FluidStorageType.Variant variant) { - super( - BlockConstants.PROPERTIES, - new NetworkNodeBlockEntityTicker<>(() -> BlockEntities.INSTANCE.getFluidStorageBlock(variant)) - ); - this.variant = variant; - } - - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new FluidStorageBlockBlockEntity(pos, state, variant); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java deleted file mode 100644 index a80ef93d2..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.StorageTypes; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class FluidStorageBlockBlockEntity extends AbstractStorageBlockBlockEntity { - private final FluidStorageType.Variant variant; - private final Component displayName; - - public FluidStorageBlockBlockEntity(final BlockPos pos, - final BlockState state, - final FluidStorageType.Variant variant) { - super( - BlockEntities.INSTANCE.getFluidStorageBlock(variant), - pos, - state, - new StorageNetworkNode(getEnergyUsage(variant), 0, 1), - PlatformApi.INSTANCE.getFluidResourceFactory() - ); - this.variant = variant; - this.displayName = createTranslation( - "block", - String.format("%s_fluid_storage_block", variant.getName()) - ); - } - - private static long getEnergyUsage(final FluidStorageType.Variant variant) { - return switch (variant) { - case SIXTY_FOUR_B -> Platform.INSTANCE.getConfig().getFluidStorageBlock().get64bEnergyUsage(); - case TWO_HUNDRED_FIFTY_SIX_B -> Platform.INSTANCE.getConfig().getFluidStorageBlock().get256bEnergyUsage(); - case THOUSAND_TWENTY_FOUR_B -> Platform.INSTANCE.getConfig().getFluidStorageBlock().get1024bEnergyUsage(); - case FOUR_THOUSAND_NINETY_SIX_B -> - Platform.INSTANCE.getConfig().getFluidStorageBlock().get4096bEnergyUsage(); - case CREATIVE -> Platform.INSTANCE.getConfig().getFluidStorageBlock().getCreativeEnergyUsage(); - }; - } - - @Override - protected SerializableStorage createStorage(final Runnable listener) { - return StorageTypes.FLUID.create(variant.getCapacity(), listener); - } - - @Override - public Component getDisplayName() { - return displayName; - } - - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return new FluidStorageBlockContainerMenu( - syncId, - player, - getFilterContainer(), - configContainer - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java deleted file mode 100644 index afb1675c5..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.AbstractStorageContainerBlockItem; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceRendering; - -import java.util.Optional; -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.context.BlockPlaceContext; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class FluidStorageBlockBlockItem extends AbstractStorageContainerBlockItem { - private static final Component CREATIVE_HELP = createTranslation("item", "creative_fluid_storage_block.help"); - - private final FluidStorageType.Variant variant; - private final Component helpText; - - public FluidStorageBlockBlockItem(final Block block, final FluidStorageType.Variant variant) { - super( - block, - new Item.Properties().stacksTo(1).fireResistant(), - PlatformApi.INSTANCE.getStorageContainerItemHelper() - ); - this.variant = variant; - this.helpText = getHelpText(variant); - } - - private static Component getHelpText(final FluidStorageType.Variant variant) { - if (variant.getCapacityInBuckets() == null) { - return CREATIVE_HELP; - } - return createTranslation( - "item", - "fluid_storage_block.help", - AmountFormatting.format(variant.getCapacityInBuckets()) - ); - } - - @Override - protected boolean hasCapacity() { - return variant.hasCapacity(); - } - - @Override - protected String formatAmount(final long amount) { - return FluidResourceRendering.format(amount); - } - - @Override - protected ItemStack createPrimaryDisassemblyByproduct(final int count) { - return new ItemStack(Blocks.INSTANCE.getMachineCasing(), count); - } - - @Override - @Nullable - protected ItemStack createSecondaryDisassemblyByproduct(final int count) { - if (variant == FluidStorageType.Variant.CREATIVE) { - return null; - } - return new ItemStack(Items.INSTANCE.getFluidStoragePart(variant), count); - } - - @Override - protected boolean placeBlock(final BlockPlaceContext ctx, final BlockState state) { - if (ctx.getPlayer() instanceof ServerPlayer serverPlayer - && !(PlatformApi.INSTANCE.canPlaceNetworkNode(serverPlayer, ctx.getLevel(), ctx.getClickedPos(), state))) { - return false; - } - return super.placeBlock(ctx, state); - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return Optional.of(new HelpTooltipComponent(helpText)); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java deleted file mode 100644 index 288ed0574..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.storage.StorageConfigurationContainer; - -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -public class FluidStorageBlockContainerMenu extends AbstractStorageBlockContainerMenu { - public FluidStorageBlockContainerMenu(final int syncId, - final Inventory playerInventory, - final StorageBlockData storageBlockData) { - super( - Menus.INSTANCE.getFluidStorage(), - syncId, - playerInventory.player, - storageBlockData, - PlatformApi.INSTANCE.getFluidResourceFactory() - ); - } - - FluidStorageBlockContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { - super(Menus.INSTANCE.getFluidStorage(), syncId, player, resourceContainer, configContainer); - } - - @Override - public boolean hasCapacity() { - return getCapacity() > 0; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlock.java deleted file mode 100644 index a148f9097..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlock.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; - -public class ItemStorageBlock extends AbstractStorageBlock { - private final ItemStorageType.Variant variant; - - public ItemStorageBlock(final ItemStorageType.Variant variant) { - super( - BlockConstants.PROPERTIES, - new NetworkNodeBlockEntityTicker<>(() -> BlockEntities.INSTANCE.getItemStorageBlock(variant)) - ); - this.variant = variant; - } - - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new ItemStorageBlockBlockEntity(pos, state, variant); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java deleted file mode 100644 index a687ebfd7..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.StorageTypes; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ItemStorageBlockBlockEntity extends AbstractStorageBlockBlockEntity { - private final ItemStorageType.Variant variant; - private final Component displayName; - - public ItemStorageBlockBlockEntity(final BlockPos pos, - final BlockState state, - final ItemStorageType.Variant variant) { - super( - BlockEntities.INSTANCE.getItemStorageBlock(variant), - pos, - state, - new StorageNetworkNode(getEnergyUsage(variant), 0, 1), - PlatformApi.INSTANCE.getItemResourceFactory() - ); - this.variant = variant; - this.displayName = createTranslation("block", String.format("%s_storage_block", variant.getName())); - } - - private static long getEnergyUsage(final ItemStorageType.Variant variant) { - return switch (variant) { - case ONE_K -> Platform.INSTANCE.getConfig().getStorageBlock().get1kEnergyUsage(); - case FOUR_K -> Platform.INSTANCE.getConfig().getStorageBlock().get4kEnergyUsage(); - case SIXTEEN_K -> Platform.INSTANCE.getConfig().getStorageBlock().get16kEnergyUsage(); - case SIXTY_FOUR_K -> Platform.INSTANCE.getConfig().getStorageBlock().get64kEnergyUsage(); - case CREATIVE -> Platform.INSTANCE.getConfig().getStorageBlock().getCreativeEnergyUsage(); - }; - } - - @Override - protected SerializableStorage createStorage(final Runnable listener) { - return StorageTypes.ITEM.create(variant.getCapacity(), listener); - } - - @Override - public Component getDisplayName() { - return displayName; - } - - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return new ItemStorageBlockContainerMenu( - syncId, - player, - getFilterContainer(), - configContainer - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockBlockItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockBlockItem.java deleted file mode 100644 index 68b1d48ea..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockBlockItem.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.AbstractStorageContainerBlockItem; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; - -import java.util.Optional; -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.context.BlockPlaceContext; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ItemStorageBlockBlockItem extends AbstractStorageContainerBlockItem { - private static final Component CREATIVE_HELP = createTranslation("item", "creative_storage_block.help"); - - private final ItemStorageType.Variant variant; - private final Component helpText; - - public ItemStorageBlockBlockItem(final Block block, final ItemStorageType.Variant variant) { - super( - block, - new Item.Properties().stacksTo(1).fireResistant(), - PlatformApi.INSTANCE.getStorageContainerItemHelper() - ); - this.variant = variant; - this.helpText = variant.getCapacity() == null - ? CREATIVE_HELP - : createTranslation("item", "storage_block.help", AmountFormatting.format(variant.getCapacity())); - } - - @Override - protected boolean hasCapacity() { - return variant.hasCapacity(); - } - - @Override - protected String formatAmount(final long amount) { - return AmountFormatting.format(amount); - } - - @Override - protected ItemStack createPrimaryDisassemblyByproduct(final int count) { - return new ItemStack(Blocks.INSTANCE.getMachineCasing(), count); - } - - @Override - @Nullable - protected ItemStack createSecondaryDisassemblyByproduct(final int count) { - if (variant == ItemStorageType.Variant.CREATIVE) { - return null; - } - return new ItemStack(Items.INSTANCE.getItemStoragePart(variant), count); - } - - @Override - protected boolean placeBlock(final BlockPlaceContext ctx, final BlockState state) { - if (ctx.getPlayer() instanceof ServerPlayer serverPlayer - && !(PlatformApi.INSTANCE.canPlaceNetworkNode(serverPlayer, ctx.getLevel(), ctx.getClickedPos(), state))) { - return false; - } - return super.placeBlock(ctx, state); - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return Optional.of(new HelpTooltipComponent(helpText)); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java deleted file mode 100644 index 8d1205b1d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.storage.StorageConfigurationContainer; - -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -public class ItemStorageBlockContainerMenu extends AbstractStorageBlockContainerMenu { - public ItemStorageBlockContainerMenu(final int syncId, - final Inventory playerInventory, - final StorageBlockData storageBlockData) { - super( - Menus.INSTANCE.getItemStorage(), - syncId, - playerInventory.player, - storageBlockData, - PlatformApi.INSTANCE.getItemResourceFactory() - ); - } - - ItemStorageBlockContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { - super(Menus.INSTANCE.getItemStorage(), syncId, player, resourceContainer, configContainer); - } - - @Override - public boolean hasCapacity() { - return getCapacity() > 0; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/StorageBlockLootItemFunction.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/StorageBlockLootItemFunction.java deleted file mode 100644 index 465ed152f..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/StorageBlockLootItemFunction.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.StorageBlockEntity; -import com.refinedmods.refinedstorage.platform.common.content.LootFunctions; - -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.storage.loot.LootContext; -import net.minecraft.world.level.storage.loot.functions.LootItemFunction; -import net.minecraft.world.level.storage.loot.functions.LootItemFunctionType; -import net.minecraft.world.level.storage.loot.parameters.LootContextParams; - -public class StorageBlockLootItemFunction implements LootItemFunction { - @Override - public LootItemFunctionType getType() { - return LootFunctions.INSTANCE.getStorageBlock(); - } - - @Override - public ItemStack apply(final ItemStack stack, final LootContext lootContext) { - final BlockEntity blockEntity = lootContext.getParam(LootContextParams.BLOCK_ENTITY); - if (blockEntity instanceof StorageBlockEntity transferable) { - PlatformApi.INSTANCE.getStorageContainerItemHelper().transferFromBlockEntity(stack, transferable); - } - return stack; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/package-info.java deleted file mode 100644 index 6326547d9..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storageblock/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.storage.storageblock; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storagedisk/FluidStorageDiskItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storagedisk/FluidStorageDiskItem.java deleted file mode 100644 index 7edd66afe..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storagedisk/FluidStorageDiskItem.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storagedisk; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.AbstractStorageContainerItem; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.StorageTypes; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceRendering; - -import java.util.Optional; -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class FluidStorageDiskItem extends AbstractStorageContainerItem { - private static final Component CREATIVE_HELP = createTranslation("item", "creative_fluid_storage_disk.help"); - - private final FluidStorageType.Variant variant; - private final Component helpText; - - public FluidStorageDiskItem(final FluidStorageType.Variant variant) { - super( - new Item.Properties().stacksTo(1).fireResistant(), - PlatformApi.INSTANCE.getStorageContainerItemHelper() - ); - this.variant = variant; - this.helpText = getHelpText(variant); - } - - private static Component getHelpText(final FluidStorageType.Variant variant) { - if (variant.getCapacityInBuckets() == null) { - return CREATIVE_HELP; - } - return createTranslation( - "item", - "fluid_storage_disk.help", - AmountFormatting.format(variant.getCapacityInBuckets()) - ); - } - - @Override - protected boolean hasCapacity() { - return variant.hasCapacity(); - } - - @Override - protected String formatAmount(final long amount) { - return FluidResourceRendering.format(amount); - } - - @Override - protected SerializableStorage createStorage(final StorageRepository storageRepository) { - return StorageTypes.FLUID.create(variant.getCapacity(), storageRepository::markAsChanged); - } - - @Override - protected ItemStack createPrimaryDisassemblyByproduct(final int count) { - return new ItemStack(Items.INSTANCE.getStorageHousing(), count); - } - - @Override - @Nullable - protected ItemStack createSecondaryDisassemblyByproduct(final int count) { - if (variant == FluidStorageType.Variant.CREATIVE) { - return null; - } - return new ItemStack(Items.INSTANCE.getFluidStoragePart(variant), count); - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return Optional.of(new HelpTooltipComponent(helpText)); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storagedisk/ItemStorageDiskItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storagedisk/ItemStorageDiskItem.java deleted file mode 100644 index e4794bad5..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storagedisk/ItemStorageDiskItem.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage.storagedisk; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.AbstractStorageContainerItem; -import com.refinedmods.refinedstorage.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.platform.api.support.AmountFormatting; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.StorageTypes; - -import java.util.Optional; -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class ItemStorageDiskItem extends AbstractStorageContainerItem { - private static final Component CREATIVE_HELP = createTranslation("item", "creative_storage_disk.help"); - - private final ItemStorageType.Variant variant; - private final Component helpText; - - public ItemStorageDiskItem(final ItemStorageType.Variant variant) { - super( - new Item.Properties().stacksTo(1).fireResistant(), - PlatformApi.INSTANCE.getStorageContainerItemHelper() - ); - this.variant = variant; - this.helpText = variant.getCapacity() == null - ? CREATIVE_HELP - : createTranslation("item", "storage_disk.help", AmountFormatting.format(variant.getCapacity())); - } - - @Override - protected boolean hasCapacity() { - return variant.hasCapacity(); - } - - @Override - protected String formatAmount(final long amount) { - return AmountFormatting.format(amount); - } - - @Override - protected SerializableStorage createStorage(final StorageRepository storageRepository) { - return StorageTypes.ITEM.create(variant.getCapacity(), storageRepository::markAsChanged); - } - - @Override - protected ItemStack createPrimaryDisassemblyByproduct(final int count) { - return new ItemStack(Items.INSTANCE.getStorageHousing(), count); - } - - @Override - @Nullable - protected ItemStack createSecondaryDisassemblyByproduct(final int count) { - if (variant == ItemStorageType.Variant.CREATIVE) { - return null; - } - return new ItemStack(Items.INSTANCE.getItemStoragePart(variant), count); - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return Optional.of(new HelpTooltipComponent(helpText)); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storagedisk/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storagedisk/package-info.java deleted file mode 100644 index 448222b1e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/storagedisk/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.storage.storagedisk; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/FluidStorageMonitorExtractionStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/FluidStorageMonitorExtractionStrategy.java deleted file mode 100644 index 1db48d11d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/FluidStorageMonitorExtractionStrategy.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; - -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.TransferHelper; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.storage.BucketPlayerInventoryInsertableStorage; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; - -import net.minecraft.world.entity.player.Player; - -public class FluidStorageMonitorExtractionStrategy implements StorageMonitorExtractionStrategy { - @Override - public boolean extract(final ResourceKey resource, - final boolean fullStack, - final Player player, - final Actor actor, - final Network network) { - if (!(resource instanceof FluidResource fluidResource)) { - return false; - } - final BucketPlayerInventoryInsertableStorage target = new BucketPlayerInventoryInsertableStorage( - player.getInventory(), - network.getComponent(StorageNetworkComponent.class), - true - ); - final StorageChannel source = network.getComponent(StorageNetworkComponent.class); - return TransferHelper.transfer( - fluidResource, - Platform.INSTANCE.getBucketAmount(), - actor, - source, - target, - source - ) > 0; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/FluidStorageMonitorInsertionStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/FluidStorageMonitorInsertionStrategy.java deleted file mode 100644 index fb0e66347..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/FluidStorageMonitorInsertionStrategy.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; - -import java.util.Optional; -import javax.annotation.Nullable; - -import net.minecraft.world.item.ItemStack; - -public class FluidStorageMonitorInsertionStrategy implements StorageMonitorInsertionStrategy { - @Override - public Optional insert( - final ResourceKey configuredResource, - final ItemStack stack, - final Actor actor, - final Network network - ) { - if (!(configuredResource instanceof FluidResource configuredFluidResource)) { - return Optional.empty(); - } - final StorageChannel fluidStorageChannel = network.getComponent(StorageNetworkComponent.class); - return Platform.INSTANCE.getContainedFluid(stack) - .map(extracted -> tryInsert(actor, configuredFluidResource, extracted, fluidStorageChannel)) - .map(extracted -> doInsert(actor, extracted, fluidStorageChannel)); - } - - @Nullable - private Platform.ContainedFluid tryInsert(final Actor actor, - final FluidResource configuredResource, - final Platform.ContainedFluid result, - final StorageChannel storageChannel) { - if (!result.fluid().equals(configuredResource)) { - return null; - } - final long insertedSimulated = storageChannel.insert( - result.fluid(), - result.amount(), - Action.SIMULATE, - actor - ); - final boolean insertedSuccessfully = insertedSimulated == result.amount(); - return insertedSuccessfully ? result : null; - } - - private ItemStack doInsert(final Actor actor, - final Platform.ContainedFluid extracted, - final StorageChannel storageChannel) { - storageChannel.insert( - extracted.fluid(), - extracted.amount(), - Action.EXECUTE, - actor - ); - return extracted.remainderContainer(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorContainerMenu.java deleted file mode 100644 index 9794ef467..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorContainerMenu.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; - -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlot; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlotType; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class StorageMonitorContainerMenu extends AbstractResourceContainerMenu { - private static final Component FILTER_HELP = createTranslation("gui", "storage_monitor.filter_help"); - - public StorageMonitorContainerMenu(final int syncId, - final Inventory playerInventory, - final ResourceContainerData resourceContainerData) { - super(Menus.INSTANCE.getStorageMonitor(), syncId); - registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); - registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - addSlots(playerInventory, ResourceContainerImpl.createForFilter(resourceContainerData)); - } - - StorageMonitorContainerMenu(final int syncId, - final Player player, - final StorageMonitorBlockEntity storageMonitor, - final ResourceContainer resourceContainer) { - super(Menus.INSTANCE.getStorageMonitor(), syncId, player); - registerProperty(new ServerProperty<>( - PropertyTypes.FUZZY_MODE, - storageMonitor::isFuzzyMode, - storageMonitor::setFuzzyMode - )); - registerProperty(new ServerProperty<>( - PropertyTypes.REDSTONE_MODE, - storageMonitor::getRedstoneMode, - storageMonitor::setRedstoneMode - )); - addSlots(player.getInventory(), resourceContainer); - } - - private void addSlots(final Inventory playerInventory, final ResourceContainer resourceContainer) { - addSlot(new ResourceSlot(resourceContainer, 0, FILTER_HELP, 80, 20, ResourceSlotType.FILTER)); - addPlayerInventory(playerInventory, 8, 55); - transferManager.addFilterTransfer(playerInventory); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorScreen.java deleted file mode 100644 index c52c2d38f..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorScreen.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storagemonitor; - -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; - -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public class StorageMonitorScreen extends AbstractBaseScreen { - private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/storage_monitor.png"); - - public StorageMonitorScreen(final StorageMonitorContainerMenu menu, - final Inventory playerInventory, - final Component text) { - super(menu, playerInventory, text); - this.inventoryLabelY = 43; - this.imageWidth = 211; - this.imageHeight = 137; - } - - @Override - protected void init() { - super.init(); - addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); - addSideButton(new FuzzyModeSideButtonWidget( - getMenu().getProperty(PropertyTypes.FUZZY_MODE), - () -> FuzzyModeSideButtonWidget.Type.GENERIC - )); - } - - @Override - protected ResourceLocation getTexture() { - return TEXTURE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/package-info.java deleted file mode 100644 index defbc00e2..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.storagemonitor; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractFilterScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractFilterScreen.java deleted file mode 100644 index 490e088d3..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractFilterScreen.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; - -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public abstract class AbstractFilterScreen extends AbstractBaseScreen { - public static final ResourceLocation TEXTURE = createIdentifier("textures/gui/generic_filter.png"); - - protected AbstractFilterScreen(final T menu, - final Inventory playerInventory, - final Component text) { - super(menu, playerInventory, text); - this.inventoryLabelY = 42; - this.imageWidth = hasUpgrades() ? 210 : 176; - this.imageHeight = 137; - } - - protected boolean hasUpgrades() { - return true; - } - - @Override - protected void init() { - super.init(); - addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); - } - - @Override - protected ResourceLocation getTexture() { - return TEXTURE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractSafeSavedData.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractSafeSavedData.java deleted file mode 100644 index d920b5f0d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractSafeSavedData.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import java.io.File; -import java.io.IOException; -import java.nio.file.AtomicMoveNotSupportedException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; - -import com.mojang.logging.LogUtils; -import net.minecraft.core.HolderLookup; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.NbtIo; -import net.minecraft.nbt.NbtUtils; -import net.minecraft.world.level.saveddata.SavedData; -import org.slf4j.Logger; - -public abstract class AbstractSafeSavedData extends SavedData { - private static final Logger LOGGER = LogUtils.getLogger(); - - @Override - public void save(final File file, final HolderLookup.Provider provider) { - if (!isDirty()) { - return; - } - final var targetPath = file.toPath().toAbsolutePath(); - final var tempFile = targetPath.getParent().resolve(file.getName() + ".temp"); - final CompoundTag compoundTag = new CompoundTag(); - compoundTag.put("data", this.save(new CompoundTag(), provider)); - NbtUtils.addCurrentDataVersion(compoundTag); - try { - doSave(compoundTag, tempFile, targetPath); - } catch (final IOException e) { - LOGGER.error("Could not save data {}", this, e); - } - setDirty(false); - } - - private void doSave(final CompoundTag compoundTag, - final Path tempFile, - final Path targetPath) throws IOException { - // Write to temp file first. - NbtIo.writeCompressed(compoundTag, tempFile); - // Try atomic move - try { - Files.move(tempFile, targetPath, StandardCopyOption.ATOMIC_MOVE); - } catch (final AtomicMoveNotSupportedException ignored) { - Files.move(tempFile, targetPath, StandardCopyOption.REPLACE_EXISTING); - } - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/BlockEntityWithDrops.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/BlockEntityWithDrops.java deleted file mode 100644 index 2595dc3cd..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/BlockEntityWithDrops.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import net.minecraft.core.NonNullList; -import net.minecraft.world.item.ItemStack; - -@FunctionalInterface -public interface BlockEntityWithDrops { - NonNullList getDrops(); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/BlockItemProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/BlockItemProvider.java deleted file mode 100644 index 520362875..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/BlockItemProvider.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import net.minecraft.world.item.BlockItem; - -@FunctionalInterface -public interface BlockItemProvider { - T createBlockItem(); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/CableShapeCacheKey.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/CableShapeCacheKey.java deleted file mode 100644 index 1b28030d5..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/CableShapeCacheKey.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.support.CableBlockSupport.DOWN; -import static com.refinedmods.refinedstorage.platform.common.support.CableBlockSupport.EAST; -import static com.refinedmods.refinedstorage.platform.common.support.CableBlockSupport.NORTH; -import static com.refinedmods.refinedstorage.platform.common.support.CableBlockSupport.SOUTH; -import static com.refinedmods.refinedstorage.platform.common.support.CableBlockSupport.UP; -import static com.refinedmods.refinedstorage.platform.common.support.CableBlockSupport.WEST; - -public record CableShapeCacheKey(boolean north, boolean east, boolean south, boolean west, boolean up, boolean down) { - public static CableShapeCacheKey of(final BlockState state) { - return new CableShapeCacheKey( - state.getValue(NORTH), - state.getValue(EAST), - state.getValue(SOUTH), - state.getValue(WEST), - state.getValue(UP), - state.getValue(DOWN) - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ClientToServerCommunications.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ClientToServerCommunications.java deleted file mode 100644 index 708fb6eb3..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ClientToServerCommunications.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import java.util.List; -import java.util.UUID; - -public interface ClientToServerCommunications { - void sendGridExtract(PlatformResourceKey resource, GridExtractMode mode, boolean cursor); - - void sendGridScroll(PlatformResourceKey resource, GridScrollMode mode, int slotIndex); - - void sendGridInsert(GridInsertMode mode, boolean tryAlternatives); - - void sendCraftingGridClear(boolean toPlayerInventory); - - void sendCraftingGridRecipeTransfer(List> recipe); - - void sendPropertyChange(PropertyType type, T value); - - void sendStorageInfoRequest(UUID storageId); - - void sendResourceSlotChange(int slotIndex, boolean tryAlternatives); - - void sendResourceFilterSlotChange(PlatformResourceKey resource, int slotIndex); - - void sendResourceSlotAmountChange(int slotIndex, long amount); - - void sendSingleAmountChange(double amount); - - void sendUseNetworkBoundItem(SlotReference slotReference); - - void sendSecurityCardPermission(PlatformPermission permission, boolean allowed); - - void sendSecurityCardResetPermission(PlatformPermission permission); - - void sendSecurityCardBoundPlayer(UUID playerId); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ColorableBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ColorableBlock.java deleted file mode 100644 index abe75dbf6..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ColorableBlock.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; - -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.block.Block; - -public interface ColorableBlock, I extends BlockItem> { - BlockColorMap getBlockColorMap(); - - DyeColor getColor(); - - default boolean canAlwaysConnect() { - return getBlockColorMap().isDefaultColor(getColor()); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterModeSettings.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterModeSettings.java deleted file mode 100644 index 91047d61f..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterModeSettings.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; - -public class FilterModeSettings { - private static final int BLOCK = 0; - private static final int ALLOW = 1; - - private FilterModeSettings() { - } - - public static FilterMode getFilterMode(final int filterMode) { - return switch (filterMode) { - case BLOCK -> FilterMode.BLOCK; - case ALLOW -> FilterMode.ALLOW; - default -> FilterMode.BLOCK; - }; - } - - public static int getFilterMode(final FilterMode filterMode) { - return switch (filterMode) { - case BLOCK -> BLOCK; - case ALLOW -> ALLOW; - }; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/PlayerAwareBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/PlayerAwareBlockEntity.java deleted file mode 100644 index 4442c240a..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/PlayerAwareBlockEntity.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import java.util.UUID; - -public interface PlayerAwareBlockEntity { - void setPlacedBy(UUID playerId); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SimpleBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SimpleBlock.java deleted file mode 100644 index 412af2fbf..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SimpleBlock.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; - -import net.minecraft.world.level.block.Block; - -public final class SimpleBlock extends Block { - public SimpleBlock() { - super(BlockConstants.PROPERTIES); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SimpleItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SimpleItem.java deleted file mode 100644 index d1cc9f98f..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/SimpleItem.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import net.minecraft.world.item.Item; - -public final class SimpleItem extends Item { - public SimpleItem() { - super(new Item.Properties()); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/TextureIds.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/TextureIds.java deleted file mode 100644 index 0638b62b7..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/TextureIds.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support; - -import net.minecraft.resources.ResourceLocation; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public final class TextureIds { - public static final ResourceLocation ICONS = createIdentifier("textures/icons.png"); - - private TextureIds() { - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/package-info.java deleted file mode 100644 index 6f5b1def1..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/amount/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.amount; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/MenuOpener.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/MenuOpener.java deleted file mode 100644 index d89d2c61e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/MenuOpener.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.MenuProvider; - -public interface MenuOpener { - void openMenu(ServerPlayer player, MenuProvider menuProvider); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/NetworkNodeExtendedMenuProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/NetworkNodeExtendedMenuProvider.java deleted file mode 100644 index 2c4ef6c1a..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/NetworkNodeExtendedMenuProvider.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; - -public interface NetworkNodeExtendedMenuProvider extends ExtendedMenuProvider, NetworkNodeMenuProvider { -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/NetworkNodeMenuProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/NetworkNodeMenuProvider.java deleted file mode 100644 index 88c8cba67..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/NetworkNodeMenuProvider.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; - -import com.refinedmods.refinedstorage.platform.api.security.SecurityHelper; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.common.security.BuiltinPermission; - -import java.util.Set; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.MenuProvider; - -public interface NetworkNodeMenuProvider extends MenuProvider { - Set getContainers(); - - default boolean canOpen(final ServerPlayer player) { - return SecurityHelper.isAllowed(player, BuiltinPermission.OPEN, getContainers()); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/Property.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/Property.java deleted file mode 100644 index ce8c87035..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/Property.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; - -import net.minecraft.world.inventory.DataSlot; - -public interface Property { - PropertyType getType(); - - T getValue(); - - DataSlot getDataSlot(); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/PropertyTypes.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/PropertyTypes.java deleted file mode 100644 index 9f7856eb6..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/PropertyTypes.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; - -import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.platform.common.support.FilterModeSettings; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneModeSettings; -import com.refinedmods.refinedstorage.platform.common.support.SchedulingModeType; - -import net.minecraft.resources.ResourceLocation; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public final class PropertyTypes { - public static final PropertyType REDSTONE_MODE = new PropertyType<>( - createIdentifier("redstone_mode"), - RedstoneModeSettings::getRedstoneMode, - RedstoneModeSettings::getRedstoneMode - ); - - public static final PropertyType FILTER_MODE = new PropertyType<>( - createIdentifier("filter_mode"), - FilterModeSettings::getFilterMode, - FilterModeSettings::getFilterMode - ); - - public static final PropertyType SCHEDULING_MODE = new PropertyType<>( - createIdentifier("scheduling_mode"), - SchedulingModeType::getId, - SchedulingModeType::getById - ); - - public static final PropertyType FUZZY_MODE = createBooleanProperty(createIdentifier("fuzzy_mode")); - - private PropertyTypes() { - } - - public static PropertyType createBooleanProperty(final ResourceLocation id) { - return new PropertyType<>( - id, - value -> Boolean.TRUE.equals(value) ? 1 : 0, - value -> value == 1 - ); - } - - public static PropertyType createIntegerProperty(final ResourceLocation id) { - return new PropertyType<>( - id, - value -> value, - value -> value - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ResourceSlotType.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ResourceSlotType.java deleted file mode 100644 index b33606224..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/ResourceSlotType.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; - -public enum ResourceSlotType { - FILTER, - FILTER_WITH_AMOUNT, - CONTAINER -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/SingleAmountData.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/SingleAmountData.java deleted file mode 100644 index 448f3e9d1..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/SingleAmountData.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; - -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; - -import java.util.Optional; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; - -public record SingleAmountData(Optional slotReference, - double amount, - ResourceContainerData resourceContainerData) { - public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - ByteBufCodecs.optional(SlotReferenceFactory.STREAM_CODEC), SingleAmountData::slotReference, - ByteBufCodecs.DOUBLE, SingleAmountData::amount, - ResourceContainerData.STREAM_CODEC, SingleAmountData::resourceContainerData, - SingleAmountData::new - ); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/TransferDestination.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/TransferDestination.java deleted file mode 100644 index 32bc8ce79..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/TransferDestination.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.containermenu; - -import javax.annotation.Nullable; - -import net.minecraft.world.item.ItemStack; - -@FunctionalInterface -public interface TransferDestination { - @Nullable - ItemStack transfer(ItemStack stack); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/package-info.java deleted file mode 100644 index 98f7ca00b..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.containermenu; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/package-info.java deleted file mode 100644 index aa86018fd..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/direction/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.direction; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyContainerMenu.java deleted file mode 100644 index 8d0dd9135..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyContainerMenu.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.energy; - -@FunctionalInterface -public interface EnergyContainerMenu { - EnergyInfo getEnergyInfo(); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyItemHelperImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyItemHelperImpl.java deleted file mode 100644 index bbcabe45b..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/EnergyItemHelperImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.energy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.energy.EnergyItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.energy.TransferableBlockEntityEnergy; - -import java.util.List; - -import net.minecraft.ChatFormatting; -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.util.Mth; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createStoredWithCapacityTranslation; - -public class EnergyItemHelperImpl implements EnergyItemHelper { - @Override - public void addTooltip(final ItemStack stack, final List lines) { - PlatformApi.INSTANCE.getEnergyStorage(stack).ifPresent(energyStorage -> { - final long stored = energyStorage.getStored(); - final long capacity = energyStorage.getCapacity(); - final double pct = stored / (double) capacity; - lines.add(createStoredWithCapacityTranslation(stored, capacity, pct).withStyle(ChatFormatting.GRAY)); - }); - } - - @Override - public boolean isBarVisible(final ItemStack stack) { - return PlatformApi.INSTANCE.getEnergyStorage(stack).isPresent(); - } - - @Override - public int getBarWidth(final ItemStack stack) { - return PlatformApi.INSTANCE.getEnergyStorage(stack).map(energyStorage -> (int) Math.round( - (energyStorage.getStored() / (double) energyStorage.getCapacity()) * 13D - )).orElse(0); - } - - @Override - public int getBarColor(final ItemStack stack) { - return PlatformApi.INSTANCE.getEnergyStorage(stack).map(energyStorage -> Mth.hsvToRgb( - Math.max(0.0F, (float) energyStorage.getStored() / (float) energyStorage.getCapacity()) / 3.0F, - 1.0F, - 1.0F - )).orElse(0); - } - - @Override - public ItemStack createAtEnergyCapacity(final Item item) { - final ItemStack stack = item.getDefaultInstance(); - PlatformApi.INSTANCE.getEnergyStorage(stack).ifPresent(energyStorage -> energyStorage.receive( - energyStorage.getCapacity(), - Action.EXECUTE - )); - return stack; - } - - @Override - public void passEnergyToBlockEntity(final BlockPos pos, final Level level, final ItemStack stack) { - if (level.isClientSide() - || !(level.getBlockEntity(pos) instanceof TransferableBlockEntityEnergy transferableBlockEntityEnergy)) { - return; - } - PlatformApi.INSTANCE.getEnergyStorage(stack).ifPresent( - energyStorage -> transferableBlockEntityEnergy.getEnergyStorage() - .receive(energyStorage.getStored(), Action.EXECUTE) - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/package-info.java deleted file mode 100644 index 6fb3511ab..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/energy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.energy; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/BaseNetworkNodeContainerBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/BaseNetworkNodeContainerBlockEntity.java deleted file mode 100644 index 45c0967d0..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/BaseNetworkNodeContainerBlockEntity.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.network; - -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; -import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; -import com.refinedmods.refinedstorage.platform.api.support.network.AbstractNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionLogic; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionSink; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemTargetBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.ColorableBlock; - -import javax.annotation.Nullable; - -import com.google.common.util.concurrent.RateLimiter; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.properties.BooleanProperty; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class BaseNetworkNodeContainerBlockEntity - extends AbstractNetworkNodeContainerBlockEntity - implements ConnectionLogic, NetworkBoundItemTargetBlockEntity { - private static final Logger LOGGER = LoggerFactory.getLogger(BaseNetworkNodeContainerBlockEntity.class); - - private final RateLimiter activenessChangeRateLimiter = RateLimiter.create(1); - - public BaseNetworkNodeContainerBlockEntity(final BlockEntityType type, - final BlockPos pos, - final BlockState state, - final T networkNode) { - super(type, pos, state, networkNode); - } - - protected boolean calculateActive() { - final long energyUsage = mainNode.getEnergyUsage(); - final boolean hasLevel = level != null && level.isLoaded(worldPosition); - return hasLevel - && mainNode.getNetwork() != null - && mainNode.getNetwork().getComponent(EnergyNetworkComponent.class).getStored() >= energyUsage; - } - - public void updateActiveness(final BlockState state, @Nullable final BooleanProperty activenessProperty) { - final boolean newActive = calculateActive(); - final boolean nodeActivenessNeedsUpdate = newActive != mainNode.isActive(); - final boolean blockStateActivenessNeedsUpdate = activenessProperty != null - && state.getValue(activenessProperty) != newActive; - final boolean activenessNeedsUpdate = nodeActivenessNeedsUpdate || blockStateActivenessNeedsUpdate; - if (activenessNeedsUpdate && activenessChangeRateLimiter.tryAcquire()) { - if (nodeActivenessNeedsUpdate) { - activenessChanged(newActive); - } - if (blockStateActivenessNeedsUpdate) { - updateActivenessBlockState(state, activenessProperty, newActive); - } - } - } - - protected void activenessChanged(final boolean newActive) { - LOGGER.debug("Activeness change for node at {}: {} -> {}", getBlockPos(), mainNode.isActive(), newActive); - mainNode.setActive(newActive); - } - - private void updateActivenessBlockState(final BlockState state, - final BooleanProperty activenessProperty, - final boolean active) { - if (level != null) { - LOGGER.debug( - "Sending block update at {} due to activeness change: {} -> {}", - getBlockPos(), - state.getValue(activenessProperty), - active - ); - level.setBlockAndUpdate(getBlockPos(), state.setValue(activenessProperty, active)); - } - } - - public void doWork() { - mainNode.doWork(); - } - - @Override - public void addOutgoingConnections(final ConnectionSink sink) { - final Direction myDirection = getDirection(); - if (myDirection == null) { - super.addOutgoingConnections(sink); - return; - } - for (final Direction direction : Direction.values()) { - if (direction == myDirection) { - continue; - } - sink.tryConnectInSameDimension(worldPosition.relative(direction), direction.getOpposite()); - } - } - - @Override - public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { - if (!colorsAllowConnecting(connectingState)) { - return false; - } - final Direction myDirection = getDirection(); - if (myDirection != null) { - return myDirection != incomingDirection; - } - return true; - } - - protected final boolean colorsAllowConnecting(final BlockState connectingState) { - if (!(connectingState.getBlock() instanceof ColorableBlock otherColorableBlock)) { - return true; - } - final ColorableBlock colorableBlock = getColor(); - if (colorableBlock == null) { - return true; - } - return otherColorableBlock.getColor() == colorableBlock.getColor() - || colorableBlock.canAlwaysConnect() - || otherColorableBlock.canAlwaysConnect(); - } - - @Nullable - private ColorableBlock getColor() { - if (!(getBlockState().getBlock() instanceof ColorableBlock colorableBlock)) { - return null; - } - return colorableBlock; - } - - @Nullable - protected final Direction getDirection() { - final BlockState blockState = getBlockState(); - if (!(blockState.getBlock() instanceof AbstractDirectionalBlock directionalBlock)) { - return null; - } - return directionalBlock.extractDirection(blockState); - } - - protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate( - final BlockState oldBlockState, - final BlockState newBlockState - ) { - return false; - } - - @Override - @SuppressWarnings("deprecation") - public void setBlockState(final BlockState newBlockState) { - final BlockState oldBlockState = getBlockState(); - super.setBlockState(newBlockState); - if (!doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState)) { - return; - } - updateContainers(); - } - - @Nullable - @Override - public Network getNetworkForBoundItem() { - return mainNode.getNetwork(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java deleted file mode 100644 index 493f1ab44..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.network.bounditem; - -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemTargetBlockEntity; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.DataComponents; - -import java.util.List; -import java.util.Optional; - -import net.minecraft.ChatFormatting; -import net.minecraft.core.GlobalPos; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.context.UseOnContext; -import net.minecraft.world.level.block.entity.BlockEntity; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class NetworkBoundItemHelperImpl implements NetworkBoundItemHelper { - private static final MutableComponent UNBOUND = createTranslation("item", "network_item.unbound") - .withStyle(ChatFormatting.RED); - private static final Component UNBOUND_HELP = createTranslation("item", "network_item.unbound.help"); - - @Override - public boolean isBound(final ItemStack stack) { - return stack.has(DataComponents.INSTANCE.getNetworkLocation()); - } - - @Override - public void addTooltip(final ItemStack stack, final List lines) { - getNetworkLocation(stack).ifPresentOrElse( - network -> lines.add(createTranslation( - "item", - "network_item.bound_to", - network.pos().getX(), - network.pos().getY(), - network.pos().getZ() - ).withStyle(ChatFormatting.GRAY)), - () -> lines.add(UNBOUND) - ); - } - - @Override - public InteractionResult bind(final UseOnContext ctx) { - if (ctx.getPlayer() == null) { - return InteractionResult.PASS; - } - final ItemStack stack = ctx.getPlayer().getItemInHand(ctx.getHand()); - final BlockEntity blockEntity = ctx.getLevel().getBlockEntity(ctx.getClickedPos()); - if (!(blockEntity instanceof NetworkBoundItemTargetBlockEntity)) { - return InteractionResult.PASS; - } - final GlobalPos pos = GlobalPos.of(ctx.getLevel().dimension(), blockEntity.getBlockPos()); - stack.set(DataComponents.INSTANCE.getNetworkLocation(), pos); - return InteractionResult.SUCCESS; - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - if (isBound(stack)) { - return Optional.empty(); - } - return Optional.of(new HelpTooltipComponent(UNBOUND_HELP)); - } - - @Override - public NetworkBoundItemSession openSession(final ItemStack stack, - final ServerPlayer player, - final SlotReference slotReference) { - final Optional location = getNetworkLocation(stack); - return new NetworkBoundItemSessionImpl( - player, - slotReference, - location.orElse(null) - ); - } - - private Optional getNetworkLocation(final ItemStack stack) { - return Optional.ofNullable(stack.get(DataComponents.INSTANCE.getNetworkLocation())); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemItemPropertyFunction.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemItemPropertyFunction.java deleted file mode 100644 index f0d6d422e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemItemPropertyFunction.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.network.bounditem; - -import com.refinedmods.refinedstorage.platform.api.support.energy.AbstractNetworkBoundEnergyItem; - -import javax.annotation.Nullable; - -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.renderer.item.ClampedItemPropertyFunction; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.ItemStack; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public class NetworkBoundItemItemPropertyFunction implements ClampedItemPropertyFunction { - public static final ResourceLocation NAME = createIdentifier("network_bound_active"); - - @Override - public float unclampedCall(final ItemStack itemStack, - @Nullable final ClientLevel clientLevel, - @Nullable final LivingEntity livingEntity, - final int i) { - if (itemStack.getItem() instanceof AbstractNetworkBoundEnergyItem boundItem) { - return boundItem.isBound(itemStack) ? 1 : 0; - } - return 0; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java deleted file mode 100644 index d8fc7e9a1..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.network.bounditem; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemTargetBlockEntity; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitter; -import com.refinedmods.refinedstorage.platform.common.Platform; - -import java.util.Optional; -import javax.annotation.Nullable; - -import net.minecraft.core.GlobalPos; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.phys.Vec3; - -class NetworkBoundItemSessionImpl implements NetworkBoundItemSession { - private final Player player; - private final Vec3 playerPosition; - private final SlotReference slotReference; - @Nullable - private final GlobalPos networkLocation; - - NetworkBoundItemSessionImpl( - final Player player, - final SlotReference slotReference, - @Nullable final GlobalPos networkLocation - ) { - this.player = player; - // We copy the player position as it can change after opening the network bound item (opening while walking) - // and could cause the network not being accessible anymore (due to being out of range of a transmitter). - // If the network is no longer accessible, certain assumptions will break (e.g. grid watcher can no longer - // be removed after it was added). - this.playerPosition = new Vec3(player.position().x, player.position().y, player.position().z); - this.slotReference = slotReference; - this.networkLocation = networkLocation; - } - - @Override - public Optional resolveNetwork() { - if (networkLocation == null) { - return Optional.empty(); - } - return Optional.ofNullable(player.getServer()) - .map(server -> server.getLevel(networkLocation.dimension())) - .filter(level -> level.isLoaded(networkLocation.pos())) - .map(level -> level.getBlockEntity(networkLocation.pos())) - .filter(NetworkBoundItemTargetBlockEntity.class::isInstance) - .map(NetworkBoundItemTargetBlockEntity.class::cast) - .map(NetworkBoundItemTargetBlockEntity::getNetworkForBoundItem) - .filter(this::isInRange); - } - - private boolean isInRange(final Network network) { - return network.getComponent(GraphNetworkComponent.class) - .getContainers(WirelessTransmitter.class) - .stream() - .anyMatch(wirelessTransmitter -> wirelessTransmitter.isInRange( - player.level().dimension(), - playerPosition - )); - } - - @Override - public boolean isActive() { - return slotReference.resolve(player) - .flatMap(Platform.INSTANCE::getEnergyStorage) - .map(energyStorage -> energyStorage.getStored() > 0) - .orElse(true); - } - - @Override - public void drainEnergy(final long amount) { - slotReference.resolve(player).flatMap(Platform.INSTANCE::getEnergyStorage).ifPresent( - energyStorage -> energyStorage.extract(amount, Action.EXECUTE) - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/package-info.java deleted file mode 100644 index b3a507768..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.network.bounditem; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/component/PlatformStorageNetworkComponent.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/component/PlatformStorageNetworkComponent.java deleted file mode 100644 index 77a9f3164..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/component/PlatformStorageNetworkComponent.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.network.component; - -import com.refinedmods.refinedstorage.api.network.impl.storage.StorageNetworkComponentImpl; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; -import com.refinedmods.refinedstorage.platform.api.storage.channel.FuzzyStorageChannel; -import com.refinedmods.refinedstorage.platform.api.support.resource.list.FuzzyResourceList; -import com.refinedmods.refinedstorage.platform.common.support.resource.list.FuzzyResourceListImpl; - -import java.util.Collection; - -public class PlatformStorageNetworkComponent extends StorageNetworkComponentImpl implements FuzzyStorageChannel { - private final FuzzyResourceList fuzzyResourceList; - - public PlatformStorageNetworkComponent() { - this(new FuzzyResourceListImpl(new ResourceListImpl())); - } - - private PlatformStorageNetworkComponent(final FuzzyResourceList fuzzyResourceList) { - super(fuzzyResourceList); - this.fuzzyResourceList = fuzzyResourceList; - } - - @Override - public Collection getFuzzy(final ResourceKey resource) { - return fuzzyResourceList.getFuzzy(resource); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/component/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/component/package-info.java deleted file mode 100644 index af74c55be..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/component/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.network.component; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/package-info.java deleted file mode 100644 index 73a63e93d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.network; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/package-info.java deleted file mode 100644 index b8dc97c84..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/PacketContext.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/PacketContext.java deleted file mode 100644 index d6a473b78..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/PacketContext.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet; - -import net.minecraft.world.entity.player.Player; - -@FunctionalInterface -public interface PacketContext { - Player getPlayer(); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/PacketHandler.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/PacketHandler.java deleted file mode 100644 index b4f7be605..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/PacketHandler.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet; - -@FunctionalInterface -public interface PacketHandler { - void handle(T packet, PacketContext ctx); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/CraftingGridRecipeTransferPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/CraftingGridRecipeTransferPacket.java deleted file mode 100644 index d041788c0..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/CraftingGridRecipeTransferPacket.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public record CraftingGridRecipeTransferPacket(List> recipe) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>( - createIdentifier("crafting_grid_recipe_transfer") - ); - public static final StreamCodec STREAM_CODEC = - StreamCodec.composite( - ByteBufCodecs.collection(ArrayList::new, - ByteBufCodecs.collection(ArrayList::new, ResourceCodecs.ITEM_STREAM_CODEC)), - CraftingGridRecipeTransferPacket::recipe, - CraftingGridRecipeTransferPacket::new - ); - - public static void handle(final CraftingGridRecipeTransferPacket packet, final PacketContext ctx) { - if (ctx.getPlayer().containerMenu instanceof CraftingGridContainerMenu craftingGridContainerMenu) { - craftingGridContainerMenu.transferRecipe(packet.recipe()); - } - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/GridExtractPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/GridExtractPacket.java deleted file mode 100644 index 340ded865..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/GridExtractPacket.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.PacketUtil.enumStreamCodec; - -public record GridExtractPacket( - PlatformResourceKey resource, - GridExtractMode mode, - boolean cursor -) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_extract")); - public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - ResourceCodecs.STREAM_CODEC, GridExtractPacket::resource, - enumStreamCodec(GridExtractMode.values()), GridExtractPacket::mode, - ByteBufCodecs.BOOL, GridExtractPacket::cursor, - GridExtractPacket::new - ); - - public static void handle(final GridExtractPacket packet, final PacketContext ctx) { - if (ctx.getPlayer().containerMenu instanceof GridExtractionStrategy strategy) { - strategy.onExtract(packet.resource, packet.mode, packet.cursor); - } - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/GridInsertPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/GridInsertPacket.java deleted file mode 100644 index 3467985bd..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/GridInsertPacket.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.PacketUtil.enumStreamCodec; - -public record GridInsertPacket(GridInsertMode mode, boolean tryAlternatives) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_insert")); - public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - enumStreamCodec(GridInsertMode.values()), GridInsertPacket::mode, - ByteBufCodecs.BOOL, GridInsertPacket::tryAlternatives, - GridInsertPacket::new - ); - - public static void handle(final GridInsertPacket packet, final PacketContext ctx) { - if (ctx.getPlayer().containerMenu instanceof GridInsertionStrategy strategy) { - strategy.onInsert(packet.mode, packet.tryAlternatives); - } - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/GridScrollPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/GridScrollPacket.java deleted file mode 100644 index 801e8ba86..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/GridScrollPacket.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.PacketUtil.enumStreamCodec; - -public record GridScrollPacket( - PlatformResourceKey resource, - GridScrollMode mode, - int slotIndex -) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_scroll")); - public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - ResourceCodecs.STREAM_CODEC, GridScrollPacket::resource, - enumStreamCodec(GridScrollMode.values()), GridScrollPacket::mode, - ByteBufCodecs.INT, GridScrollPacket::slotIndex, - GridScrollPacket::new - ); - - public static void handle(final GridScrollPacket packet, final PacketContext ctx) { - if (ctx.getPlayer().containerMenu instanceof GridScrollingStrategy strategy) { - strategy.onScroll(packet.resource, packet.mode, packet.slotIndex); - } - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/ResourceFilterSlotChangePacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/ResourceFilterSlotChangePacket.java deleted file mode 100644 index 9d056c01b..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/ResourceFilterSlotChangePacket.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static java.util.Objects.requireNonNull; - -public record ResourceFilterSlotChangePacket(int slotIndex, PlatformResourceKey resource) - implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>( - createIdentifier("resource_filter_slot_change") - ); - public static final StreamCodec STREAM_CODEC = StreamCodec - .composite( - ByteBufCodecs.INT, ResourceFilterSlotChangePacket::slotIndex, - ResourceCodecs.STREAM_CODEC, ResourceFilterSlotChangePacket::resource, - ResourceFilterSlotChangePacket::new - ); - - public static void handle(final ResourceFilterSlotChangePacket packet, final PacketContext ctx) { - if (ctx.getPlayer().containerMenu instanceof AbstractResourceContainerMenu containerMenu) { - containerMenu.handleResourceFilterSlotUpdate(packet.slotIndex, requireNonNull(packet.resource)); - } - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SecurityCardPermissionPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SecurityCardPermissionPacket.java deleted file mode 100644 index 6db41c08e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SecurityCardPermissionPacket.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.common.security.AbstractSecurityCardContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public record SecurityCardPermissionPacket(PlatformPermission permission, boolean allowed) - implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>( - createIdentifier("security_card_permission") - ); - public static final StreamCodec STREAM_CODEC = StreamCodec - .composite( - PlatformApi.INSTANCE.getPermissionRegistry().streamCodec(), SecurityCardPermissionPacket::permission, - ByteBufCodecs.BOOL, SecurityCardPermissionPacket::allowed, - SecurityCardPermissionPacket::new - ); - - public static void handle(final SecurityCardPermissionPacket packet, final PacketContext ctx) { - if (ctx.getPlayer().containerMenu instanceof AbstractSecurityCardContainerMenu securityCardContainerMenu) { - securityCardContainerMenu.setPermission(packet.permission, packet.allowed); - } - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SecurityCardResetPermissionPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SecurityCardResetPermissionPacket.java deleted file mode 100644 index 283a7226e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/SecurityCardResetPermissionPacket.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.common.security.AbstractSecurityCardContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public record SecurityCardResetPermissionPacket(PlatformPermission permission) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>( - createIdentifier("security_card_reset_permission") - ); - public static final StreamCodec STREAM_CODEC = - StreamCodec.composite( - PlatformApi.INSTANCE.getPermissionRegistry().streamCodec(), SecurityCardResetPermissionPacket::permission, - SecurityCardResetPermissionPacket::new - ); - - public static void handle(final SecurityCardResetPermissionPacket packet, final PacketContext ctx) { - if (ctx.getPlayer().containerMenu instanceof AbstractSecurityCardContainerMenu securityCardContainerMenu) { - securityCardContainerMenu.resetPermissionServer(packet.permission); - } - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/StorageInfoRequestPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/StorageInfoRequestPacket.java deleted file mode 100644 index feb69f833..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/StorageInfoRequestPacket.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.storage.StorageInfo; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.S2CPackets; - -import java.util.UUID; - -import net.minecraft.core.UUIDUtil; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public record StorageInfoRequestPacket(UUID storageId) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>( - createIdentifier("storage_info_request") - ); - public static final StreamCodec STREAM_CODEC = StreamCodec - .composite( - UUIDUtil.STREAM_CODEC, StorageInfoRequestPacket::storageId, - StorageInfoRequestPacket::new - ); - - public static void handle(final StorageInfoRequestPacket packet, final PacketContext ctx) { - final Player player = ctx.getPlayer(); - final StorageInfo info = PlatformApi.INSTANCE - .getStorageRepository(player.getCommandSenderWorld()) - .getInfo(packet.storageId()); - S2CPackets.sendStorageInfoResponse((ServerPlayer) player, packet.storageId, info); - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseSlotReferencedItemPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseSlotReferencedItemPacket.java deleted file mode 100644 index 7d1d65720..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseSlotReferencedItemPacket.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceHandlerItem; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public record UseSlotReferencedItemPacket(SlotReference slotReference) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>( - createIdentifier("use_slot_referenced_item") - ); - public static final StreamCodec STREAM_CODEC = StreamCodec - .composite( - SlotReferenceFactory.STREAM_CODEC, UseSlotReferencedItemPacket::slotReference, - UseSlotReferencedItemPacket::new - ); - - public static void handle(final UseSlotReferencedItemPacket packet, final PacketContext ctx) { - final Player player = ctx.getPlayer(); - packet.slotReference.resolve(player).ifPresent(stack -> { - if (!(stack.getItem() instanceof SlotReferenceHandlerItem handlerItem)) { - return; - } - handlerItem.use((ServerPlayer) player, stack, packet.slotReference); - }); - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/package-info.java deleted file mode 100644 index 03a90e6ba..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/package-info.java deleted file mode 100644 index ee49a1cad..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.packet; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/GridClearPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/GridClearPacket.java deleted file mode 100644 index c1b69567e..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/GridClearPacket.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; - -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.world.inventory.AbstractContainerMenu; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public class GridClearPacket implements CustomPacketPayload { - public static final GridClearPacket INSTANCE = new GridClearPacket(); - public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_clear")); - public static final StreamCodec STREAM_CODEC = StreamCodec.unit(INSTANCE); - - private GridClearPacket() { - } - - public static void handle(final PacketContext ctx) { - final AbstractContainerMenu menu = ctx.getPlayer().containerMenu; - if (menu instanceof AbstractGridContainerMenu grid) { - grid.onClear(); - } - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/GridUpdatePacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/GridUpdatePacket.java deleted file mode 100644 index 1d2ab28a1..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/GridUpdatePacket.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; - -import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.platform.common.storage.StorageCodecs; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceCodecs; - -import java.util.Optional; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public record GridUpdatePacket( - PlatformResourceKey resource, - long amount, - Optional trackedResource -) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>(createIdentifier("grid_update")); - public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - ResourceCodecs.STREAM_CODEC, GridUpdatePacket::resource, - ByteBufCodecs.VAR_LONG, GridUpdatePacket::amount, - StorageCodecs.TRACKED_RESOURCE_OPTIONAL_STREAM_CODEC, GridUpdatePacket::trackedResource, - GridUpdatePacket::new - ); - - public static void handle(final GridUpdatePacket packet, final PacketContext ctx) { - if (ctx.getPlayer().containerMenu instanceof AbstractGridContainerMenu containerMenu) { - containerMenu.onResourceUpdate(packet.resource, packet.amount, packet.trackedResource.orElse(null)); - } - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/package-info.java deleted file mode 100644 index 7696751fd..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/s2c/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.packet.s2c; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/registry/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/registry/package-info.java deleted file mode 100644 index f1fea47b4..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/registry/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.registry; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/package-info.java deleted file mode 100644 index 8d1651457..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/render/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.render; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResource.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResource.java deleted file mode 100644 index adae101b7..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResource.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; - -import com.refinedmods.refinedstorage.api.core.CoreValidations; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.FuzzyModeNormalizer; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; - -import net.minecraft.core.component.DataComponentPatch; -import net.minecraft.world.level.material.Fluid; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") -public record FluidResource(Fluid fluid, DataComponentPatch components) - implements PlatformResourceKey, FuzzyModeNormalizer { - public FluidResource(final Fluid fluid) { - this(fluid, DataComponentPatch.EMPTY); - } - - public FluidResource(final Fluid fluid, final DataComponentPatch components) { - this.fluid = CoreValidations.validateNotNull(fluid, "Fluid must not be null"); - this.components = CoreValidations.validateNotNull(components, "Components must not be null"); - } - - @Override - public ResourceKey normalize() { - return new FluidResource(fluid); - } - - @Override - public long getInterfaceExportLimit() { - return ResourceTypes.FLUID.getInterfaceExportLimit(); - } - - @Override - public ResourceType getResourceType() { - return ResourceTypes.FLUID; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceFactory.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceFactory.java deleted file mode 100644 index f0ad2b9a3..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceFactory.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; - -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; -import com.refinedmods.refinedstorage.platform.common.Platform; - -import java.util.Optional; - -import net.minecraft.world.item.ItemStack; - -public class FluidResourceFactory implements ResourceFactory { - @Override - public Optional create(final ItemStack stack) { - return Platform.INSTANCE.getContainedFluid(stack).map(result -> new ResourceAmount( - result.fluid(), - Platform.INSTANCE.getBucketAmount() - )); - } - - @Override - public boolean isValid(final ResourceKey resource) { - return resource instanceof FluidResource; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceType.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceType.java deleted file mode 100644 index 089155b26..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceType.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; - -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperationsImpl; -import com.refinedmods.refinedstorage.api.grid.view.GridResource; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.support.resource.AbstractResourceType; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.grid.view.FluidGridResource; -import com.refinedmods.refinedstorage.platform.common.support.TextureIds; - -import java.util.Optional; - -import com.mojang.serialization.Codec; -import com.mojang.serialization.MapCodec; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -class FluidResourceType extends AbstractResourceType { - FluidResourceType() { - super( - "FLUID", - createTranslation("misc", "resource_type.fluid"), - TextureIds.ICONS, - 16, - 128 - ); - } - - @Override - public Optional toGridResource(final ResourceAmount resourceAmount) { - return Platform.INSTANCE.getFluidGridResourceFactory().apply(resourceAmount); - } - - @Override - public boolean isGridResourceBelonging(final GridResource gridResource) { - return gridResource instanceof FluidGridResource; - } - - @Override - public long normalizeAmount(final double amount) { - return (long) (amount * Platform.INSTANCE.getBucketAmount()); - } - - @Override - public double getDisplayAmount(final long amount) { - return amount / (double) Platform.INSTANCE.getBucketAmount(); - } - - @Override - public long getInterfaceExportLimit() { - return Platform.INSTANCE.getBucketAmount() * 16; - } - - @Override - public GridOperations createGridOperations(final StorageChannel storageChannel, final Actor actor) { - return new GridOperationsImpl( - storageChannel, - actor, - fluidResource -> Long.MAX_VALUE, - Platform.INSTANCE.getBucketAmount() - ); - } - - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public MapCodec getMapCodec() { - return (MapCodec) ResourceCodecs.FLUID_MAP_CODEC; - } - - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public Codec getCodec() { - return (Codec) ResourceCodecs.FLUID_CODEC; - } - - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public StreamCodec getStreamCodec() { - return (StreamCodec) ResourceCodecs.FLUID_STREAM_CODEC; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceType.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceType.java deleted file mode 100644 index 88fb86469..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceType.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; - -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperationsImpl; -import com.refinedmods.refinedstorage.api.grid.view.GridResource; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.platform.api.support.resource.AbstractResourceType; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.grid.view.ItemGridResource; -import com.refinedmods.refinedstorage.platform.common.support.TextureIds; - -import java.util.Optional; - -import com.mojang.serialization.Codec; -import com.mojang.serialization.MapCodec; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -class ItemResourceType extends AbstractResourceType { - ItemResourceType() { - super( - "ITEM", - createTranslation("misc", "resource_type.item"), - TextureIds.ICONS, - 0, - 128 - ); - } - - @Override - public Optional toGridResource(final ResourceAmount resourceAmount) { - return Platform.INSTANCE.getItemGridResourceFactory().apply(resourceAmount); - } - - @Override - public boolean isGridResourceBelonging(final GridResource gridResource) { - return gridResource instanceof ItemGridResource; - } - - @Override - public long normalizeAmount(final double amount) { - return (long) amount; - } - - @Override - public double getDisplayAmount(final long amount) { - return amount; - } - - @Override - public long getInterfaceExportLimit() { - return 64; - } - - @Override - public GridOperations createGridOperations(final StorageChannel storageChannel, final Actor actor) { - return new GridOperationsImpl( - storageChannel, - actor, - resource -> resource instanceof ItemResource itemResource - ? itemResource.item().getDefaultMaxStackSize() - : 0, - 1 - ); - } - - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public MapCodec getMapCodec() { - return (MapCodec) ResourceCodecs.ITEM_MAP_CODEC; - } - - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public Codec getCodec() { - return (Codec) ResourceCodecs.ITEM_CODEC; - } - - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public StreamCodec getStreamCodec() { - return (StreamCodec) ResourceCodecs.ITEM_STREAM_CODEC; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceTypes.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceTypes.java deleted file mode 100644 index 6f98902ab..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceTypes.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.resource; - -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; - -public final class ResourceTypes { - public static final ResourceType ITEM = new ItemResourceType(); - public static final ResourceType FLUID = new FluidResourceType(); - - private ResourceTypes() { - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/package-info.java deleted file mode 100644 index 4690dea16..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.resource.list; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/package-info.java deleted file mode 100644 index 0c60b6476..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.resource; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/package-info.java deleted file mode 100644 index e88132e07..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.slotreference; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/ScreenSizeListener.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/ScreenSizeListener.java deleted file mode 100644 index 94d7f2330..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/ScreenSizeListener.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.stretching; - -@FunctionalInterface -public interface ScreenSizeListener { - void onScreenReady(int playerInventoryY); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/package-info.java deleted file mode 100644 index 1972d0580..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/stretching/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.stretching; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/MouseWithIconClientTooltipComponent.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/MouseWithIconClientTooltipComponent.java deleted file mode 100644 index 379f8f341..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/MouseWithIconClientTooltipComponent.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.tooltip; - -import com.refinedmods.refinedstorage.platform.common.support.TextureIds; - -import javax.annotation.Nullable; - -import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.client.gui.Font; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; - -public class MouseWithIconClientTooltipComponent implements ClientTooltipComponent { - private final Type type; - private final IconRenderer iconRenderer; - @Nullable - private final String amount; - - public MouseWithIconClientTooltipComponent(final Type type, - final IconRenderer iconRenderer, - @Nullable final String amount) { - this.type = type; - this.iconRenderer = iconRenderer; - this.amount = amount; - } - - @Override - public int getHeight() { - return 18; - } - - @Override - public int getWidth(final Font font) { - return 9 + 4 + 18; - } - - @Override - public void renderImage(final Font font, final int x, final int y, final GuiGraphics graphics) { - graphics.blit(TextureIds.ICONS, x + type.leftPad, y, type.x, type.y, type.width, type.height); - iconRenderer.render(graphics, x + 9 + 4, y); - if (amount != null) { - final PoseStack poseStack = graphics.pose(); - poseStack.pushPose(); - poseStack.translate(0.0F, 0.0F, 200.0F); - graphics.drawString(font, amount, x + 9 + 4 + 16 - font.width(amount), y + 9, 16777215, true); - poseStack.popPose(); - } - } - - @FunctionalInterface - public interface IconRenderer { - void render(GuiGraphics graphics, int x, int y); - } - - public enum Type { - LEFT(247, 0, 180, 9, 13), - RIGHT(238, 2, 180, 9, 13); - - private final int x; - private final int leftPad; - private final int y; - private final int width; - private final int height; - - Type(final int x, final int leftPad, final int y, final int width, final int height) { - this.x = x; - this.leftPad = leftPad; - this.y = y; - this.width = width; - this.height = height; - } - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/package-info.java deleted file mode 100644 index cddbc8150..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/tooltip/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.tooltip; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/AbstractYesNoSideButtonWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/AbstractYesNoSideButtonWidget.java deleted file mode 100644 index 3e7d4769b..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/AbstractYesNoSideButtonWidget.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.widget; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; - -import net.minecraft.network.chat.MutableComponent; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.NO; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.YES; - -public abstract class AbstractYesNoSideButtonWidget extends AbstractSideButtonWidget { - protected final ClientProperty property; - private final MutableComponent title; - - protected AbstractYesNoSideButtonWidget(final ClientProperty property, final MutableComponent title) { - super(createPressAction(property)); - this.property = property; - this.title = title; - } - - private static OnPress createPressAction(final ClientProperty property) { - return btn -> property.setValue(!property.getValue()); - } - - @Override - protected MutableComponent getTitle() { - return title; - } - - @Override - protected MutableComponent getSubText() { - return Boolean.TRUE.equals(property.getValue()) ? YES : NO; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/package-info.java deleted file mode 100644 index 68c7eb13d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.support.widget; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/BuiltinUpgradeDestinationsImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/BuiltinUpgradeDestinationsImpl.java deleted file mode 100644 index 1b1b501e8..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/BuiltinUpgradeDestinationsImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; - -import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeDestination; - -public class BuiltinUpgradeDestinationsImpl implements BuiltinUpgradeDestinations { - @Override - public UpgradeDestination getImporter() { - return UpgradeDestinations.IMPORTER; - } - - @Override - public UpgradeDestination getExporter() { - return UpgradeDestinations.EXPORTER; - } - - @Override - public UpgradeDestination getDestructor() { - return UpgradeDestinations.DESTRUCTOR; - } - - @Override - public UpgradeDestination getConstructor() { - return UpgradeDestinations.CONSTRUCTOR; - } - - @Override - public UpgradeDestination getWirelessTransmitter() { - return UpgradeDestinations.WIRELESS_TRANSMITTER; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RangeUpgradeItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RangeUpgradeItem.java deleted file mode 100644 index 335344563..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RangeUpgradeItem.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; - -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.upgrade.AbstractUpgradeItem; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; -import com.refinedmods.refinedstorage.platform.common.Platform; - -import java.util.Optional; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class RangeUpgradeItem extends AbstractUpgradeItem { - private static final Component HELP = createTranslation("item", "range_upgrade.help"); - private static final Component CREATIVE_HELP = createTranslation("item", "creative_range_upgrade.help"); - - private final boolean creative; - - public RangeUpgradeItem(final UpgradeRegistry registry, final boolean creative) { - super(new Item.Properties(), registry); - this.creative = creative; - } - - @Override - public long getEnergyUsage() { - if (creative) { - return Platform.INSTANCE.getConfig().getUpgrade().getCreativeRangeUpgradeEnergyUsage(); - } - return Platform.INSTANCE.getConfig().getUpgrade().getRangeUpgradeEnergyUsage(); - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return Optional.of(new HelpTooltipComponent(creative ? CREATIVE_HELP : HELP)); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeContainerMenu.java deleted file mode 100644 index a0a0feb62..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeContainerMenu.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; - -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.SingleAmountData; - -import java.util.function.Consumer; -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class RegulatorUpgradeContainerMenu extends AbstractSingleAmountContainerMenu { - private static final Component FILTER_HELP = createTranslation("gui", "regulator_upgrade.filter_help"); - - @Nullable - private Consumer amountAcceptor; - - public RegulatorUpgradeContainerMenu(final int syncId, - final Inventory playerInventory, - final SingleAmountData singleAmountData) { - super(Menus.INSTANCE.getRegulatorUpgrade(), syncId, playerInventory, singleAmountData, FILTER_HELP); - } - - RegulatorUpgradeContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final Consumer amountAcceptor, - final SlotReference slotReference) { - super( - Menus.INSTANCE.getRegulatorUpgrade(), - syncId, - player, - resourceContainer, - FILTER_HELP, - slotReference - ); - this.amountAcceptor = amountAcceptor; - } - - @Override - public void changeAmountOnServer(final double newAmount) { - if (amountAcceptor == null) { - return; - } - amountAcceptor.accept(newAmount); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java deleted file mode 100644 index a11139476..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; - -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; -import com.refinedmods.refinedstorage.platform.api.upgrade.AbstractUpgradeItem; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.content.DataComponents; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.SingleAmountData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; - -import java.util.Optional; -import java.util.OptionalLong; -import java.util.function.Consumer; -import javax.annotation.Nullable; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.chat.Component; -import net.minecraft.network.codec.StreamEncoder; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResultHolder; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class RegulatorUpgradeItem extends AbstractUpgradeItem { - private static final Component HELP = createTranslation("item", "regulator_upgrade.help"); - - public RegulatorUpgradeItem(final UpgradeRegistry registry) { - super(new Item.Properties(), registry); - } - - @Override - public InteractionResultHolder use(final Level level, final Player player, final InteractionHand hand) { - final ItemStack stack = player.getItemInHand(hand); - if (player instanceof ServerPlayer serverPlayer) { - final RegulatorUpgradeState initialState = stack.getOrDefault( - DataComponents.INSTANCE.getRegulatorUpgradeState(), - RegulatorUpgradeState.EMPTY - ); - Platform.INSTANCE.getMenuOpener().openMenu(serverPlayer, new ExtendedMenuProviderImpl( - createResourceFilterContainer(stack, initialState), - initialState.amount(), - newAmount -> setAmount(stack, newAmount), - PlatformApi.INSTANCE.createInventorySlotReference(player, hand) - )); - } - return InteractionResultHolder.success(stack); - } - - private ResourceContainer createResourceFilterContainer(final ItemStack stack, - final RegulatorUpgradeState initialState) { - final ResourceContainer container = ResourceContainerImpl.createForFilter(1); - container.setListener(() -> { - final RegulatorUpgradeState state = stack.getOrDefault( - DataComponents.INSTANCE.getRegulatorUpgradeState(), - RegulatorUpgradeState.EMPTY - ); - final PlatformResourceKey resource = container.getResource(0); - stack.set(DataComponents.INSTANCE.getRegulatorUpgradeState(), state.withResource(resource)); - }); - initialState.resource().ifPresent(initialResource -> container.set(0, new ResourceAmount(initialResource, 1))); - return container; - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return Optional.of(new RegulatorTooltipComponent(HELP, getConfiguredResource(stack))); - } - - private void setAmount(final ItemStack stack, final double amount) { - final RegulatorUpgradeState state = stack.getOrDefault( - DataComponents.INSTANCE.getRegulatorUpgradeState(), - RegulatorUpgradeState.EMPTY - ); - stack.set(DataComponents.INSTANCE.getRegulatorUpgradeState(), state.withAmount(amount)); - } - - @Override - public long getEnergyUsage() { - return Platform.INSTANCE.getConfig().getUpgrade().getRegulatorUpgradeEnergyUsage(); - } - - @Nullable - private ResourceAmount getConfiguredResource(final ItemStack stack) { - final RegulatorUpgradeState state = stack.get(DataComponents.INSTANCE.getRegulatorUpgradeState()); - if (state == null) { - return null; - } - return state.resource().map(resource -> { - final double amount = state.amount(); - final long normalizedAmount = resource.getResourceType().normalizeAmount(amount); - return new ResourceAmount(resource, normalizedAmount); - }).orElse(null); - } - - public OptionalLong getDesiredAmount(final ItemStack stack, final ResourceKey resource) { - final RegulatorUpgradeState state = stack.getOrDefault( - DataComponents.INSTANCE.getRegulatorUpgradeState(), - RegulatorUpgradeState.EMPTY - ); - return state.resource().flatMap(configuredResource -> { - final boolean same = configuredResource.equals(resource); - if (!same) { - return Optional.empty(); - } - return Optional.of(configuredResource.getResourceType()); - }).map(type -> { - final double amount = state.amount(); - final long normalizedAmount = type.normalizeAmount(amount); - return OptionalLong.of(normalizedAmount); - }).orElse(OptionalLong.empty()); - } - - public record RegulatorTooltipComponent(Component helpText, @Nullable ResourceAmount configuredResource) - implements TooltipComponent { - } - - private static class ExtendedMenuProviderImpl implements ExtendedMenuProvider { - private final ResourceContainer resourceContainer; - private final double amount; - private final Consumer amountAcceptor; - private final SlotReference slotReference; - - private ExtendedMenuProviderImpl(final ResourceContainer resourceContainer, - final double amount, - final Consumer amountAcceptor, - final SlotReference slotReference) { - this.resourceContainer = resourceContainer; - this.amount = amount; - this.amountAcceptor = amountAcceptor; - this.slotReference = slotReference; - } - - @Override - public SingleAmountData getMenuData() { - return new SingleAmountData( - Optional.of(slotReference), - amount, - ResourceContainerData.of(resourceContainer) - ); - } - - @Override - public StreamEncoder getMenuCodec() { - return SingleAmountData.STREAM_CODEC; - } - - @Override - public Component getDisplayName() { - return ContentNames.REGULATOR_UPGRADE; - } - - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return new RegulatorUpgradeContainerMenu( - syncId, - player, - resourceContainer, - amountAcceptor, - slotReference - ); - } - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeScreen.java deleted file mode 100644 index 4938bebb2..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeScreen.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; - -import com.refinedmods.refinedstorage.platform.common.support.amount.AbstractSingleAmountScreen; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.Inventory; - -public class RegulatorUpgradeScreen extends AbstractSingleAmountScreen { - public RegulatorUpgradeScreen(final RegulatorUpgradeContainerMenu menu, - final Inventory playerInventory, - final Component text) { - super(menu, playerInventory, text, menu.getAmount(), 1); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/SimpleUpgradeItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/SimpleUpgradeItem.java deleted file mode 100644 index dbfb81b64..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/SimpleUpgradeItem.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.upgrade.AbstractUpgradeItem; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; -import com.refinedmods.refinedstorage.platform.common.Platform; - -import java.util.Optional; -import java.util.function.LongSupplier; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public final class SimpleUpgradeItem extends AbstractUpgradeItem { - private final LongSupplier energyUsageResolver; - private final boolean foil; - private final Component helpText; - - private SimpleUpgradeItem(final UpgradeRegistry registry, - final LongSupplier energyUsageResolver, - final boolean foil, - final Component helpText) { - super(new Item.Properties(), registry); - this.energyUsageResolver = energyUsageResolver; - this.foil = foil; - this.helpText = helpText; - } - - @Override - public long getEnergyUsage() { - return energyUsageResolver.getAsLong(); - } - - @Override - public boolean isFoil(final ItemStack stack) { - return foil; - } - - @Override - public Optional getTooltipImage(final ItemStack stack) { - return Optional.of(new HelpTooltipComponent(helpText)); - } - - public static SimpleUpgradeItem speedUpgrade() { - return new SimpleUpgradeItem( - PlatformApi.INSTANCE.getUpgradeRegistry(), - Platform.INSTANCE.getConfig().getUpgrade()::getSpeedUpgradeEnergyUsage, - false, - createTranslation("item", "speed_upgrade.help") - ); - } - - public static SimpleUpgradeItem stackUpgrade() { - return new SimpleUpgradeItem( - PlatformApi.INSTANCE.getUpgradeRegistry(), - Platform.INSTANCE.getConfig().getUpgrade()::getStackUpgradeEnergyUsage, - false, - createTranslation("item", "stack_upgrade.help") - ); - } - - public static SimpleUpgradeItem silkTouchUpgrade() { - return new SimpleUpgradeItem( - PlatformApi.INSTANCE.getUpgradeRegistry(), - Platform.INSTANCE.getConfig().getUpgrade()::getSilkTouchUpgradeEnergyUsage, - true, - createTranslation("item", "silk_touch_upgrade.help") - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinations.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinations.java deleted file mode 100644 index c33b15098..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinations.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; - -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeDestination; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.content.Items; - -import java.util.function.Supplier; -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.world.item.ItemStack; - -public enum UpgradeDestinations implements UpgradeDestination { - IMPORTER(ContentNames.IMPORTER, () -> new ItemStack(Items.INSTANCE.getImporters().get(0).get())), - EXPORTER(ContentNames.EXPORTER, () -> new ItemStack(Items.INSTANCE.getExporters().get(0).get())), - DESTRUCTOR(ContentNames.DESTRUCTOR, () -> new ItemStack(Items.INSTANCE.getDestructors().get(0).get())), - CONSTRUCTOR(ContentNames.CONSTRUCTOR, () -> new ItemStack(Items.INSTANCE.getConstructors().get(0).get())), - WIRELESS_TRANSMITTER(ContentNames.WIRELESS_TRANSMITTER, - () -> new ItemStack(Items.INSTANCE.getWirelessTransmitters().get(0).get())), - DISK_INTERFACE(ContentNames.DISK_INTERFACE, () -> new ItemStack(Items.INSTANCE.getDiskInterfaces().get(0).get())); - - private final Component name; - private final Supplier stackFactory; - @Nullable - private ItemStack cachedStack; - - UpgradeDestinations(final Component name, final Supplier stackFactory) { - this.name = name; - this.stackFactory = stackFactory; - } - - @Override - public Component getName() { - return name; - } - - @Override - public ItemStack getStackRepresentation() { - if (cachedStack == null) { - cachedStack = stackFactory.get(); - } - return cachedStack; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/package-info.java deleted file mode 100644 index 96d9a930a..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.upgrade; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/package-info.java deleted file mode 100644 index 24a9fbff9..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/util/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.util; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java deleted file mode 100644 index 2929a9f7f..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.platform.common.Platform; - -public class BaseWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { - @Override - public int modifyRange(final UpgradeState upgradeState, final int range) { - return Platform.INSTANCE.getConfig().getWirelessTransmitter().getBaseRange() + range; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java deleted file mode 100644 index baf975b88..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.platform.common.content.Items; - -public class CreativeRangeUpgradeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { - @Override - public int modifyRange(final UpgradeState upgradeState, final int range) { - if (upgradeState.has(Items.INSTANCE.getCreativeRangeUpgrade())) { - return Integer.MAX_VALUE; - } - return range; - } - - @Override - public int getPriority() { - return Integer.MAX_VALUE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java deleted file mode 100644 index 5d10ac039..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.Items; - -public class RangeUpgradeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { - @Override - public int modifyRange(final UpgradeState upgradeState, final int range) { - final int amountOfRangeUpgrades = upgradeState.getAmount(Items.INSTANCE.getRangeUpgrade()); - final int rangePerUpgrade = Platform.INSTANCE.getConfig().getUpgrade().getRangeUpgradeRange(); - return range + (amountOfRangeUpgrades * rangePerUpgrade); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java deleted file mode 100644 index 551b26f1d..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.platform.common.content.BlockColorMap; -import com.refinedmods.refinedstorage.platform.common.content.BlockConstants; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.AbstractActiveColoredDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.BlockItemProvider; -import com.refinedmods.refinedstorage.platform.common.support.NetworkNodeBlockItem; -import com.refinedmods.refinedstorage.platform.common.support.direction.DefaultDirectionType; -import com.refinedmods.refinedstorage.platform.common.support.direction.DirectionType; -import com.refinedmods.refinedstorage.platform.common.support.network.NetworkNodeBlockEntityTicker; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.shapes.CollisionContext; -import net.minecraft.world.phys.shapes.Shapes; -import net.minecraft.world.phys.shapes.VoxelShape; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class WirelessTransmitterBlock - extends AbstractActiveColoredDirectionalBlock - implements BlockItemProvider, EntityBlock { - private static final AbstractBlockEntityTicker TICKER = - new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getWirelessTransmitter, ACTIVE); - private static final Component HELP = createTranslation("item", "wireless_transmitter.help"); - - private static final VoxelShape SHAPE_DOWN = box(6.0D, 0.0D, 6.0D, 10.0D, 10.0D, 10.0D); - private static final VoxelShape SHAPE_UP = box(6.0D, 6.0D, 6.0D, 10.0D, 16.0D, 10.0D); - private static final VoxelShape SHAPE_EAST = box(6.0D, 6.0D, 6.0D, 16.0D, 10.0D, 10.0D); - private static final VoxelShape SHAPE_WEST = box(0.0D, 6.0D, 6.0D, 10.0D, 10.0D, 10.0D); - private static final VoxelShape SHAPE_NORTH = box(6.0D, 6.0D, 0.0D, 10.0D, 10.0D, 10.0D); - private static final VoxelShape SHAPE_SOUTH = box(6.0D, 6.0D, 6.0D, 10.0D, 10.0D, 16.0D); - - public WirelessTransmitterBlock(final DyeColor color, final MutableComponent name) { - super(BlockConstants.PROPERTIES, color, name); - } - - @Override - protected DirectionType getDirectionType() { - return DefaultDirectionType.FACE_CLICKED; - } - - @Override - @SuppressWarnings("deprecation") - public VoxelShape getShape(final BlockState state, - final BlockGetter world, - final BlockPos pos, - final CollisionContext context) { - final Direction direction = getDirection(state); - if (direction == null) { - return Shapes.empty(); - } - return switch (direction) { - case DOWN -> SHAPE_DOWN; - case UP -> SHAPE_UP; - case NORTH -> SHAPE_NORTH; - case SOUTH -> SHAPE_SOUTH; - case WEST -> SHAPE_WEST; - case EAST -> SHAPE_EAST; - }; - } - - @Override - public BlockColorMap getBlockColorMap() { - return Blocks.INSTANCE.getWirelessTransmitter(); - } - - @Nullable - @Override - public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new WirelessTransmitterBlockEntity(pos, state); - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); - } - - @Override - public BaseBlockItem createBlockItem() { - return new NetworkNodeBlockItem(this, HELP); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java deleted file mode 100644 index 873ff63f1..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionSink; -import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.BlockEntityWithDrops; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.NetworkNodeExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage.platform.common.util.ContainerUtil; - -import java.util.List; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.HolderLookup; -import net.minecraft.core.NonNullList; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.chat.Component; -import net.minecraft.network.codec.StreamEncoder; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.state.BlockState; - -public class WirelessTransmitterBlockEntity - extends AbstractRedstoneModeNetworkNodeContainerBlockEntity - implements NetworkNodeExtendedMenuProvider, BlockEntityWithDrops { - private static final String TAG_UPGRADES = "upgr"; - - private final UpgradeContainer upgradeContainer = new UpgradeContainer( - UpgradeDestinations.WIRELESS_TRANSMITTER, - PlatformApi.INSTANCE.getUpgradeRegistry(), - this::upgradeContainerChanged - ); - - public WirelessTransmitterBlockEntity(final BlockPos pos, final BlockState state) { - super(BlockEntities.INSTANCE.getWirelessTransmitter(), pos, state, new SimpleNetworkNode( - Platform.INSTANCE.getConfig().getWirelessTransmitter().getEnergyUsage() - )); - } - - @Override - protected InWorldNetworkNodeContainer createMainContainer(final SimpleNetworkNode node) { - return new WirelessTransmitterNetworkNodeContainer(this, node, MAIN_CONTAINER_NAME, this); - } - - @Override - public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { - super.saveAdditional(tag, provider); - tag.put(TAG_UPGRADES, ContainerUtil.write(upgradeContainer, provider)); - } - - @Override - public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { - if (tag.contains(TAG_UPGRADES)) { - ContainerUtil.read(tag.getCompound(TAG_UPGRADES), upgradeContainer, provider); - } - super.loadAdditional(tag, provider); - } - - @Override - public List getUpgradeItems() { - return upgradeContainer.getUpgradeItems(); - } - - @Override - public boolean addUpgradeItem(final Item upgradeItem) { - return upgradeContainer.addUpgradeItem(upgradeItem); - } - - @Override - public void addOutgoingConnections(final ConnectionSink sink) { - final Direction myDirection = getDirection(); - if (myDirection == null) { - return; - } - sink.tryConnectInSameDimension(worldPosition.relative(myDirection), myDirection.getOpposite()); - } - - @Override - public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { - if (!colorsAllowConnecting(connectingState)) { - return false; - } - final Direction myDirection = getDirection(); - return incomingDirection == myDirection; - } - - @Override - public Component getDisplayName() { - return ContentNames.WIRELESS_TRANSMITTER; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return new WirelessTransmitterContainerMenu(syncId, inventory, this, upgradeContainer); - } - - @Override - public WirelessTransmitterData getMenuData() { - return new WirelessTransmitterData(getRange()); - } - - @Override - public StreamEncoder getMenuCodec() { - return WirelessTransmitterData.STREAM_CODEC; - } - - int getRange() { - return PlatformApi.INSTANCE.getWirelessTransmitterRangeModifier().modifyRange(upgradeContainer, 0); - } - - private void upgradeContainerChanged() { - final long baseUsage = Platform.INSTANCE.getConfig().getWirelessTransmitter().getEnergyUsage(); - mainNode.setEnergyUsage(baseUsage + upgradeContainer.getEnergyUsage()); - setChanged(); - } - - @Override - public NonNullList getDrops() { - final NonNullList drops = NonNullList.create(); - for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { - drops.add(upgradeContainer.getItem(i)); - } - return drops; - } - - @Override - protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, - final BlockState newBlockState) { - return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java deleted file mode 100644 index e96ddf832..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.common.content.Menus; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage.platform.common.support.RedstoneMode; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ServerProperty; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.S2CPackets; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeContainer; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeSlot; - -import javax.annotation.Nullable; - -import com.google.common.util.concurrent.RateLimiter; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; - -public class WirelessTransmitterContainerMenu extends AbstractBaseContainerMenu { - private final RateLimiter rangeRateLimiter = RateLimiter.create(4); - - private int range; - @Nullable - private final WirelessTransmitterBlockEntity wirelessTransmitter; - private final Player player; - - public WirelessTransmitterContainerMenu(final int syncId, - final Inventory playerInventory, - final WirelessTransmitterData data) { - super(Menus.INSTANCE.getWirelessTransmitter(), syncId); - addSlots(playerInventory, new UpgradeContainer( - UpgradeDestinations.WIRELESS_TRANSMITTER, - PlatformApi.INSTANCE.getUpgradeRegistry() - )); - registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - this.range = data.range(); - this.wirelessTransmitter = null; - this.player = playerInventory.player; - } - - WirelessTransmitterContainerMenu(final int syncId, - final Inventory playerInventory, - final WirelessTransmitterBlockEntity wirelessTransmitter, - final UpgradeContainer upgradeContainer) { - super(Menus.INSTANCE.getWirelessTransmitter(), syncId); - addSlots(playerInventory, upgradeContainer); - registerProperty(new ServerProperty<>( - PropertyTypes.REDSTONE_MODE, - wirelessTransmitter::getRedstoneMode, - wirelessTransmitter::setRedstoneMode - )); - this.range = wirelessTransmitter.getRange(); - this.wirelessTransmitter = wirelessTransmitter; - this.player = playerInventory.player; - } - - private void addSlots(final Inventory playerInventory, final UpgradeContainer upgradeContainer) { - addPlayerInventory(playerInventory, 8, 55); - for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { - addSlot(new UpgradeSlot(upgradeContainer, i, 187, 6 + (i * 18))); - } - transferManager.addBiTransfer(playerInventory, upgradeContainer); - } - - @Override - public void broadcastChanges() { - super.broadcastChanges(); - if (wirelessTransmitter == null) { - return; - } - final int newRange = wirelessTransmitter.getRange(); - final boolean changed = range != newRange; - if (changed && rangeRateLimiter.tryAcquire()) { - this.range = newRange; - S2CPackets.sendWirelessTransmitterRange((ServerPlayer) player, range); - } - } - - int getRange() { - return range; - } - - public void setRange(final int range) { - this.range = range; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterNetworkNodeContainer.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterNetworkNodeContainer.java deleted file mode 100644 index 596d66651..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterNetworkNodeContainer.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; -import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionLogic; -import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitter; -import com.refinedmods.refinedstorage.platform.common.support.network.InWorldNetworkNodeContainerImpl; - -import net.minecraft.core.BlockPos; -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.level.Level; -import net.minecraft.world.phys.Vec3; - -class WirelessTransmitterNetworkNodeContainer extends InWorldNetworkNodeContainerImpl - implements WirelessTransmitter { - private final WirelessTransmitterBlockEntity blockEntity; - private final AbstractNetworkNode node; - - WirelessTransmitterNetworkNodeContainer(final WirelessTransmitterBlockEntity blockEntity, - final AbstractNetworkNode node, - final String name, - final ConnectionLogic connectionLogic) { - super(blockEntity, node, name, 0, connectionLogic, null); - this.blockEntity = blockEntity; - this.node = node; - } - - @Override - public boolean isInRange(final ResourceKey dimension, final Vec3 position) { - final Level level = blockEntity.getLevel(); - if (level == null || level.dimension() != dimension) { - return false; - } - if (!node.isActive()) { - return false; - } - final BlockPos pos = blockEntity.getBlockPos(); - final double distance = Math.sqrt( - Math.pow(pos.getX() - position.x(), 2) - + Math.pow(pos.getY() - position.y(), 2) - + Math.pow(pos.getZ() - position.z(), 2) - ); - return distance <= blockEntity.getRange(); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterScreen.java deleted file mode 100644 index 63fef0c3f..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterScreen.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyTypes; -import com.refinedmods.refinedstorage.platform.common.support.widget.RedstoneModeSideButtonWidget; - -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Inventory; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class WirelessTransmitterScreen extends AbstractBaseScreen { - private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/wireless_transmitter.png"); - - public WirelessTransmitterScreen(final WirelessTransmitterContainerMenu containerMenu, - final Inventory inventory, - final Component title) { - super(containerMenu, inventory, title); - this.inventoryLabelY = 43; - this.imageWidth = 211; - this.imageHeight = 137; - } - - @Override - protected void init() { - super.init(); - addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); - } - - @Override - protected ResourceLocation getTexture() { - return TEXTURE; - } - - @Override - protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { - super.renderLabels(graphics, mouseX, mouseY); - graphics.drawString( - font, - createTranslation("gui", "wireless_transmitter.distance", getMenu().getRange()), - 28, - 25, - 4210752, - false - ); - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/package-info.java deleted file mode 100644 index 6b102d3f7..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/fr_fr.json b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/fr_fr.json deleted file mode 100644 index ec151d4b7..000000000 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/fr_fr.json +++ /dev/null @@ -1,473 +0,0 @@ -{ - "mod.refinedstorage": "Refined Storage", - "block.refinedstorage.cable": "Câble", - "block.refinedstorage.quartz_enriched_iron_block": "Bloc de Fer Enrichi en Quartz", - "block.refinedstorage.quartz_enriched_copper_block": "Block of Quartz Enriched Copper", - "block.refinedstorage.disk_drive": "Lecteur de Disque", - "block.refinedstorage.machine_casing": "Boitier de Machine", - "block.refinedstorage.grid": "Grille", - "block.refinedstorage.crafting_grid": "Grille d’Artisanat", - "block.refinedstorage.controller": "Contrôleur", - "block.refinedstorage.creative_controller": "Contrôleur créatif", - "block.refinedstorage.1k_storage_block": "Bloc de Stockage 1K", - "block.refinedstorage.4k_storage_block": "Bloc de Stockage 4k", - "block.refinedstorage.16k_storage_block": "Bloc de Stockage 16k", - "block.refinedstorage.64k_storage_block": "Bloc de Stockage 64k", - "block.refinedstorage.creative_storage_block": "Bloc de Stockage Créatif", - "block.refinedstorage.64b_fluid_storage_block": "Bloc de Stockage de Fluides 64B", - "block.refinedstorage.256b_fluid_storage_block": "Bloc de Stockage de Fluides 256B", - "block.refinedstorage.1024b_fluid_storage_block": "Bloc de Stockage de Fluides 1024B", - "block.refinedstorage.4096b_fluid_storage_block": "Bloc de Stockage de Fluides 4096B", - "block.refinedstorage.creative_fluid_storage_block": "Bloc de Stockage de Fluides Créatif", - "block.refinedstorage.importer": "Importateur", - "block.refinedstorage.exporter": "Exportateur", - "block.refinedstorage.interface": "Interface", - "block.refinedstorage.external_storage": "Stockage Externe", - "block.refinedstorage.detector": "Détecteur", - "block.refinedstorage.constructor": "Constructeur", - "block.refinedstorage.destructor": "Destructeur", - "block.refinedstorage.wireless_transmitter": "Transmetteur sans fil", - "block.refinedstorage.storage_monitor": "Moniteur de Stockage", - "block.refinedstorage.network_receiver": "Récepteur Réseau", - "block.refinedstorage.network_transmitter": "Transmetteur Réseau", - "block.refinedstorage.portable_grid": "Grille portable", - "block.refinedstorage.creative_portable_grid": "Grille portable créative", - "block.refinedstorage.security_manager": "Poste de sécurité", - "block.refinedstorage.security_manager.help": "Lorsque ce périphérique est actif, il protège le réseau par défaut et bloque toutes les opérations. Commencez à ajouter des Cartes de Sécurité pour permettre ou refuser des opérations spécifiques pour un joueur.", - "block.refinedstorage.relay": "Relay", - "block.refinedstorage.disk_interface": "Disk Interface", - "gui.refinedstorage.controller.redstone_mode_help": "Lorsque ce périphérique est inactif, le réseau de stockage ne peut pas utiliser ce périphérique comme source d'énergie.", - "gui.refinedstorage.disk_drive.disks": "Disques", - "gui.refinedstorage.storage.redstone_mode_help": "Lorsque ce périphérique est inactif, le stockage contenu ne sera plus accessible depuis le réseau de stockage.", - "gui.refinedstorage.storage.filter_help": "Les ressources qui sont autorisées ou refusées dans ce stockage, en fonction du mode de filtrage du périphérique.", - "gui.refinedstorage.storage.filter_mode.empty_warning": "Sans filtre configuré, aucune ressource ne sera accepté dans ce stockage.", - "gui.refinedstorage.storage.filter_mode.allow.help": "Autorise dans ce stockage uniquement les ressources configurées dans les filtres.", - "gui.refinedstorage.storage.filter_mode.block.help": "Interdis dans ce stockage les ressources configurées dans les filtres.", - "gui.refinedstorage.grid.sorting.direction": "Direction du tri", - "gui.refinedstorage.grid.sorting.direction.ascending": "Ascendant", - "gui.refinedstorage.grid.sorting.direction.descending": "Descendant", - "gui.refinedstorage.grid.sorting.type": "Type de tri", - "gui.refinedstorage.grid.sorting.type.quantity": "Quantité", - "gui.refinedstorage.grid.sorting.type.name": "Nom", - "gui.refinedstorage.grid.sorting.type.id": "Identifiant", - "gui.refinedstorage.grid.sorting.type.last_modified": "Dernière modification", - "gui.refinedstorage.grid.auto_selected": "Sélection automatique", - "gui.refinedstorage.grid.auto_selected.help": "Si la barre de recherche doit être sélectionnée automatique à l'ouverture de la grille.", - "gui.refinedstorage.grid.synchronizer": "Mode de synchronisation", - "gui.refinedstorage.grid.synchronizer.off": "Éteint", - "gui.refinedstorage.grid.synchronizer.off.help": "Ne pas synchroniser la recherche.", - "gui.refinedstorage.grid.resource_type": "Type de ressource", - "gui.refinedstorage.grid.resource_type.all": "Toutes", - "gui.refinedstorage.grid.resource_type.help": "Filtrer un type de ressources spécifique.", - "gui.refinedstorage.crafting_grid.move.network": "Déplacer les objets dans le réseau", - "gui.refinedstorage.crafting_grid.move.inventory": "Déplacer les objets dans l'inventaire", - "gui.refinedstorage.screen_size": "Taille de l'écran", - "gui.refinedstorage.screen_size.stretch": "Etiré", - "gui.refinedstorage.screen_size.small": "Petit", - "gui.refinedstorage.screen_size.medium": "Moyen", - "gui.refinedstorage.screen_size.large": "Grand", - "gui.refinedstorage.screen_size.extra_large": "Très grand", - "gui.refinedstorage.detector.mode": "Mode", - "gui.refinedstorage.detector.mode.under": "Émet un signal de redstone si la valeur est inférieure au seuil.", - "gui.refinedstorage.detector.mode.equal": "Émet un signal de redstone si la valeur est égale au seuil.", - "gui.refinedstorage.detector.mode.above": "Émet un signal de redstone si la valeur est supérieure au seuil.", - "gui.refinedstorage.detector.filter_help": "La ressource qui doit être détectée dans le réseau de stockage.", - "gui.refinedstorage.destructor.pickup_items": "Ramasser des objets au lieu de casser des blocs.", - "gui.refinedstorage.destructor.filter_help": "Les blocs qui seront détruits ou ignorés en fonction du mode de filtrage du périphérique.", - "gui.refinedstorage.destructor.filter_mode.allow.help": "Autorise dans le réseau de stockage uniquement les blocs configurés dans les filtres.", - "gui.refinedstorage.destructor.filter_mode.block.help": "Interdit dans le réseau de stockage les blocs configurés dans les filtres.", - "gui.refinedstorage.constructor.drop_items": "Laisser tomber des objets au lieu de placer des blocs.", - "gui.refinedstorage.constructor.filter_help": "Les ressources qui doivent être placées depuis le réseau de stockage.", - "gui.refinedstorage.interface.filter_help": "Les ressources qui doivent être exportées depuis le réseau de stockage.", - "gui.refinedstorage.exporter.filter_help": "Les ressources qui doivent être exportées depuis le réseau de stockage.", - "gui.refinedstorage.importer.filter_help": "Les ressources qui doivent être importées depuis l'inventaire ciblé.", - "gui.refinedstorage.importer.filter_mode.allow.help": "Autorise dans le réseau de stockage uniquement les ressources configurées dans les filtres.", - "gui.refinedstorage.importer.filter_mode.block.help": "Interdit dans le réseau de stockage les ressources configurées dans les filtres.", - "gui.refinedstorage.wireless_transmitter.distance": "%d bloc(s)", - "gui.refinedstorage.storage_monitor.filter_help": "La ressource à afficher.", - "gui.refinedstorage.redstone_mode": "Mode redstone", - "gui.refinedstorage.redstone_mode.ignore": "Ignoré", - "gui.refinedstorage.redstone_mode.ignore.help": "Ce périphérique sera toujours actif quel que soit le signal de redstone.", - "gui.refinedstorage.redstone_mode.high": "Allumé", - "gui.refinedstorage.redstone_mode.high.help": "Ce périphérique sera actif seulement s'il reçoit un signal de redstone.", - "gui.refinedstorage.redstone_mode.low": "Éteint", - "gui.refinedstorage.redstone_mode.low.help": "Ce périphérique sera actif seulement s'il ne reçoit pas de signal de redstone.", - "gui.refinedstorage.scheduling_mode": "Mode de distribution", - "gui.refinedstorage.scheduling_mode.default": "Par défaut", - "gui.refinedstorage.scheduling_mode.default.help": "Utilise le premier filtre disponible.", - "gui.refinedstorage.scheduling_mode.round_robin": "À tour de rôle", - "gui.refinedstorage.scheduling_mode.round_robin.help": "Utiliser chaque filtre à tour de rôle.", - "gui.refinedstorage.scheduling_mode.random": "Aléatoire", - "gui.refinedstorage.scheduling_mode.random.help": "Utiliser un filtre aléatoire.", - "gui.refinedstorage.priority": "Priorité", - "gui.refinedstorage.priority.storage_help": "L'ordre dans lequel le réseau de stockage va insérer ou extraire les ressources, le plus élevé en premier.", - "gui.refinedstorage.amount": "Quantité", - "gui.refinedstorage.amount.reset": "Réinitialiser", - "gui.refinedstorage.amount.set": "Définir", - "gui.refinedstorage.filter_mode": "Mode de filtrage", - "gui.refinedstorage.filter_mode.allow": "Liste blanche", - "gui.refinedstorage.filter_mode.block": "Liste noire", - "gui.refinedstorage.fuzzy_mode": "Mode flou", - "gui.refinedstorage.fuzzy_mode.on": "Activé", - "gui.refinedstorage.fuzzy_mode.on.storage_help": "Match the filters for the allowlist or blocklist exactly.", - "gui.refinedstorage.fuzzy_mode.on.generic_help": "Match the filter exactly.", - "gui.refinedstorage.fuzzy_mode.on.extracting_storage_network_help": "Match the filters when extracting from the storage network exactly.", - "gui.refinedstorage.fuzzy_mode.on.extracting_source_help": "Match the filters when extracting from the source exactly.", - "gui.refinedstorage.fuzzy_mode.off": "Désactivé", - "gui.refinedstorage.fuzzy_mode.off.storage_help": "Match the filters for the allowlist or blocklist without comparing NBT tags.", - "gui.refinedstorage.fuzzy_mode.off.generic_help": "Match the filter without comparing NBT tags.", - "gui.refinedstorage.fuzzy_mode.off.extracting_storage_network_help": "Match the filters when extracting from the storage network without comparing NBT tags.", - "gui.refinedstorage.fuzzy_mode.off.extracting_source_help": "Match the filters when extracting from the source without comparing NBT tags.", - "gui.refinedstorage.access_mode": "Mode d'accès", - "gui.refinedstorage.access_mode.insert_extract": "Insertion et extraction", - "gui.refinedstorage.access_mode.insert_extract.help": "Le réseau de stockage pourra insérer et extraire depuis ce stockage.", - "gui.refinedstorage.access_mode.insert": "Insertion uniquement", - "gui.refinedstorage.access_mode.insert.help": "Le réseau de stockage ne pourra qu'insérer dans stockage. Les ressources seront tout de même visible dans une grille.", - "gui.refinedstorage.access_mode.extract": "Extraction uniquement", - "gui.refinedstorage.access_mode.extract.help": "Le réseau de stockage ne pourra qu'extraire depuis ce stockage.", - "gui.refinedstorage.void_excess": "Anéantir les ressources en excès", - "gui.refinedstorage.void_excess.help": "Quand le mode anéantir les ressources en excès est allumé et que le stockage est plein, il continuera d'accepter les ressources mais les détruira.", - "gui.refinedstorage.void_excess.allowlist_warning": "Le mode anéantir les ressources en excès ne fonction que lorsque le stockage est en mode liste blanche.", - "gui.refinedstorage.upgrade_slot": "Emplacement d'amélioration vide", - "gui.refinedstorage.filter_slot.empty_filter": "Filtre vide", - "gui.refinedstorage.filter_slot.left_click_for": "Left click for", - "gui.refinedstorage.filter_slot.right_click_for": "Right click for", - "gui.refinedstorage.filter_slot.click_to_clear": "Click to clear", - "gui.refinedstorage.regulator_upgrade.filter_help": "La ressource qui doit être régulée dans la cible.", - "gui.refinedstorage.network_transmitter.status.inactive": "Inactif", - "gui.refinedstorage.network_transmitter.status.missing_network_card": "Carte réseau manquante", - "gui.refinedstorage.network_transmitter.status.transmitting": "%d bloc(s)", - "gui.refinedstorage.network_transmitter.status.receiver_unreachable": "Inaccessible", - "gui.refinedstorage.security_card.permission.reset": "Réinitialiser", - "gui.refinedstorage.security_card.permission.modified": "Modifiée", - "gui.refinedstorage.security_manager.redstone_mode_help": "Lorsque ce périphérique est inactif, le réseau ne sera pas protégé.", - "gui.refinedstorage.security_manager.fallback_security_card_slot_hint": "Emplacement pour une carte de sécurité de repli.", - "gui.refinedstorage.security_manager.no_fallback_security_card_consequence": "Ajoutez une Carte de sécurité de repli à cet emplacement pour définir les permissions de tous les joueurs sans Carte de sécurité. Par défaut, toutes les actions sont interdites.", - "gui.refinedstorage.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", - "gui.refinedstorage.relay.pass_through": "Pass-through", - "gui.refinedstorage.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", - "gui.refinedstorage.relay.pass_energy": "Pass energy", - "gui.refinedstorage.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", - "gui.refinedstorage.relay.pass_storage": "Pass storage", - "gui.refinedstorage.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", - "gui.refinedstorage.relay.pass_security": "Pass security", - "gui.refinedstorage.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", - "gui.refinedstorage.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", - "gui.refinedstorage.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", - "gui.refinedstorage.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.", - "gui.refinedstorage.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.", - "gui.refinedstorage.disk_interface.in": "In", - "gui.refinedstorage.disk_interface.out": "Out", - "gui.refinedstorage.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.", - "gui.refinedstorage.disk_interface.transfer_mode": "Transfer mode", - "gui.refinedstorage.disk_interface.transfer_mode.insert_into_network": "Insert into network", - "gui.refinedstorage.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.", - "gui.refinedstorage.disk_interface.transfer_mode.extract_from_network": "Extract from network", - "gui.refinedstorage.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.", - "item.refinedstorage.controller.help": "Alimente le réseau de stockage en énergie. Plusieurs sont autorisés dans un seul réseau de stockage. ", - "item.refinedstorage.creative_controller.help": "Alimente le réseau de stockage avec une source d'énergie infinie. ", - "item.refinedstorage.disk_drive.help": "Accepte des disques de stockage pour fournir de l'espace de stockage au réseau.", - "item.refinedstorage.disk_interface.help": "Transfers resources between the storage network and provided storage disks.", - "item.refinedstorage.grid.help": "Permet d'interagir avec le réseau de stockage.", - "item.refinedstorage.crafting_grid.help": "Permet d'interagir avec le réseau de stockage, avec les capacités d'artisanat.", - "item.refinedstorage.importer.help": "Importe des ressources depuis une source externe vers le réseau de stockage.", - "item.refinedstorage.exporter.help": "Exporte les ressources du réseau de stockage vers une destination externe.", - "item.refinedstorage.interface.help": "Agit comme la combinaison d'un importateur et d'un exportateur.", - "item.refinedstorage.external_storage.help": "Fournit au réseau de stockage accès à un inventaire externe.", - "item.refinedstorage.detector.help": "Émet un signal de redstone si le réseau de stockage contient une ressource en quantité égale, supérieure ou inférieure à un seuil donné.", - "item.refinedstorage.constructor.help": "Place des blocs du réseau de stockage dans le monde.", - "item.refinedstorage.destructor.help": "Détruit les blocs du monde et les met dans le réseau de stockage.", - "item.refinedstorage.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.", - "item.refinedstorage.quartz_enriched_iron": "Fer enrichi en quartz", - "item.refinedstorage.quartz_enriched_copper": "Quartz Enriched Copper", - "item.refinedstorage.processor_binding": "Liant pour processeur", - "item.refinedstorage.silicon": "Silicone", - "item.refinedstorage.raw_basic_processor": "Processeur basique brut", - "item.refinedstorage.raw_improved_processor": "Processeur amélioré brut", - "item.refinedstorage.raw_advanced_processor": "Processeur avancé brut", - "item.refinedstorage.basic_processor": "Processeur basique", - "item.refinedstorage.improved_processor": "Processeur amélioré", - "item.refinedstorage.advanced_processor": "Processeur avancé", - "item.refinedstorage.1k_storage_part": "Pièce de stockage 1k", - "item.refinedstorage.4k_storage_part": "Pièce de stockage 4k", - "item.refinedstorage.16k_storage_part": "Pièce de stockage 16k", - "item.refinedstorage.64k_storage_part": "Pièce de stockage 64k", - "item.refinedstorage.1k_storage_disk": "Disque de stockage 1k", - "item.refinedstorage.4k_storage_disk": "Disque de stockage 4k", - "item.refinedstorage.16k_storage_disk": "Disque de stockage 16k", - "item.refinedstorage.64k_storage_disk": "Disque de stockage 64k", - "item.refinedstorage.storage_disk.help": "Stores %s items.", - "item.refinedstorage.storage_block.help": "Stores %s items.", - "item.refinedstorage.creative_storage_disk": "Disque de stockage créatif", - "item.refinedstorage.creative_storage_disk.help": "Stores an infinite amount of items.", - "item.refinedstorage.creative_storage_block.help": "Stores an infinite amount of items.", - "item.refinedstorage.64b_fluid_storage_part": "Pièce de stockage de fluides 64B", - "item.refinedstorage.256b_fluid_storage_part": "Pièce de stockage de fluides 256B", - "item.refinedstorage.1024b_fluid_storage_part": "Pièce de stockage de fluides 1024B", - "item.refinedstorage.4096b_fluid_storage_part": "Pièce de stockage de fluides 4096B", - "item.refinedstorage.64b_fluid_storage_disk": "Disque de stockage de fluides 64B", - "item.refinedstorage.256b_fluid_storage_disk": "Disque de stockage de fluides 256B", - "item.refinedstorage.1024b_fluid_storage_disk": "Disque de stockage de fluides 1024B", - "item.refinedstorage.4096b_fluid_storage_disk": "Disque de stockage de fluides 4096B", - "item.refinedstorage.fluid_storage_disk.help": "Stores %s buckets.", - "item.refinedstorage.fluid_storage_block.help": "Stores %s buckets.", - "item.refinedstorage.creative_fluid_storage_disk": "Disque de stockage de fluides créatif", - "item.refinedstorage.creative_fluid_storage_disk.help": "Stores an infinite amount of buckets.", - "item.refinedstorage.creative_fluid_storage_block.help": "Stores an infinite amount of buckets.", - "item.refinedstorage.storage_housing": "Boitier de stockage", - "item.refinedstorage.construction_core": "Cœur de construction", - "item.refinedstorage.destruction_core": "Cœur de destruction", - "item.refinedstorage.wrench": "Clé", - "item.refinedstorage.wrench.help": "Use to rotate blocks or press SHIFT and use to dismantle Refined Storage blocks.", - "item.refinedstorage.upgrade": "Amélioration", - "item.refinedstorage.speed_upgrade": "Amélioration de vitesse", - "item.refinedstorage.speed_upgrade.help": "Increases the operation speed of a storage network device.", - "item.refinedstorage.stack_upgrade": "Amélioration de stack", - "item.refinedstorage.stack_upgrade.help": "Increases the amount of resources that the storage network device handles per operation.", - "item.refinedstorage.silk_touch_upgrade": "Amélioration de toucher de soie", - "item.refinedstorage.silk_touch_upgrade.help": "Acts like the Silk Touch enchantment on a pickaxe.", - "item.refinedstorage.fortune_upgrade.1": "Amélioration de fortune I", - "item.refinedstorage.fortune_upgrade.2": "Amélioration de fortune II", - "item.refinedstorage.fortune_upgrade.3": "Amélioration de fortune III", - "item.refinedstorage.fortune_upgrade.help": "Yields more resources when breaking a block. Acts like the Fortune enchantment on a pickaxe.", - "item.refinedstorage.regulator_upgrade": "Amélioration de régulation", - "item.refinedstorage.regulator_upgrade.help": "Dans un Exportateur, n'exportera que si le montant dans la cible est inférieur à la valeur configurée dans l'amélioration. Dans un Importateur, n'importera que si le montant dans la cible est supérieur à la valeur configurée dans l'amélioration. Utilisez l'objet pour configurer.", - "item.refinedstorage.range_upgrade": "Amélioration de portée", - "item.refinedstorage.range_upgrade.help": "Increases the range of the Wireless Transmitter.", - "item.refinedstorage.creative_range_upgrade": "Amélioration de portée créative", - "item.refinedstorage.creative_range_upgrade.help": "Provides infinite range for the Wireless Transmitter. Does not work cross-dimensionally.", - "item.refinedstorage.wireless_grid": "Grille sans fil", - "item.refinedstorage.creative_wireless_grid": "Grille sans fil créative", - "item.refinedstorage.wireless_transmitter.help": "Fournit un accès au réseau sans fil pour des objets comme la grille sans fil. Plusieurs sont autorisés pour une couverture plus large.", - "item.refinedstorage.network_item.unbound": "Non liée.", - "item.refinedstorage.network_item.unbound.help": "Utiliser sur n'importe quel périphérique du réseau de stockage pour relier.", - "item.refinedstorage.network_item.bound_to": "Lié à %d, %d, %d.", - "item.refinedstorage.network_item.cannot_open_with_shortcut_due_to_duplicate": "Il y a plusieurs %s dans votre inventaire.", - "item.refinedstorage.network_item.cannot_open_because_not_found": "Il n'y a pas de %s dans votre inventaire.", - "item.refinedstorage.configuration_card": "Carte de configuration", - "item.refinedstorage.configuration_card.empty": "Vide.", - "item.refinedstorage.configuration_card.configured": "Contient une configuration pour %s.", - "item.refinedstorage.configuration_card.copied_configuration": "Configuration copiée pour %s.", - "item.refinedstorage.configuration_card.cleared_configuration": "Configuration effacée.", - "item.refinedstorage.configuration_card.cannot_apply_configuration": "Impossible d'appliquer la carte de configuration à un autre type de périphérique. Elle est configurée pour %s.", - "item.refinedstorage.configuration_card.applied_configuration": "Configuration appliquée.", - "item.refinedstorage.configuration_card.empty_help": "Utiliser sur un périphérique réseau en étant accroupi pour sauvegarder sa configuration et ses améliorations dans la carte.", - "item.refinedstorage.configuration_card.configured_help": "Utiliser sur le périphérique de destination en étant accroupi pour transférer la configuration et les améliorations. Utiliser en étant accroupi pour effacer.", - "item.refinedstorage.network_card": "Carte réseau", - "item.refinedstorage.network_card.unbound_help": "Utilisez en étant accroupi sur un Récepteur réseau.", - "item.refinedstorage.network_card.unbound": "Unbound.", - "item.refinedstorage.network_card.bound_help": "Insert into a Network Transmitter. Use while crouching to clear binding.", - "item.refinedstorage.network_card.bound": "Bound to %d, %d, %d in %s.", - "item.refinedstorage.network_transmitter.help": "Transmits a network signal wirelessly. Needs a Network Card that is paired with a Network Receiver.", - "item.refinedstorage.network_receiver.help": "Receives a network signal wirelessly. Bind a Network Card to this block.", - "item.refinedstorage.cable.help": "Connects storage network devices with each other.", - "item.refinedstorage.security_card": "Security Card", - "item.refinedstorage.security_card.cleared_configuration": "Cleared configuration.", - "item.refinedstorage.security_card.unbound": "Unbound.", - "item.refinedstorage.security_card.unbound.help": "Right click to configure and bind to the current player.", - "item.refinedstorage.security_card.bound": "Bound to %s.", - "item.refinedstorage.security_card.bound.help": "Right click to configure. Use while crouching to clear configuration and binding.", - "item.refinedstorage.fallback_security_card": "Fallback Security Card", - "item.refinedstorage.fallback_security_card.help": "Acts as a fallback if no matching Security Card for a player is found. Right click to configure. Use while crouching to clear configuration.", - "item.refinedstorage.portable_grid.help": "Allows to interact with a storage disk while not being connected to a storage network. Can be used as a block in world, or from your inventory.", - "item.refinedstorage.storage_monitor.help": "A block that displays the current amount of a certain resource in your storage network. SHIFT + right click to configure. Left click to extract a stack, SHIFT + left click to extract a single resource, right click to insert a resource, right click multiple times to insert resources in bulk.", - "misc.refinedstorage.stored": "Stocké : %s", - "misc.refinedstorage.stored_with_capacity": "Stocké : %s / %s (%d%%)", - "misc.refinedstorage.total": "%d total", - "misc.refinedstorage.last_modified.just_now": "Dernière modification à l'instant par %s", - "misc.refinedstorage.last_modified.second": "Dernière modification il y %d seconde par %s", - "misc.refinedstorage.last_modified.seconds": "Dernière modification il y %d secondes par %s", - "misc.refinedstorage.last_modified.minute": "Dernière modification il y %d minute par %s", - "misc.refinedstorage.last_modified.minutes": "Dernière modification il y %d minutes par %s", - "misc.refinedstorage.last_modified.hour": "Dernière modification il y %d heure par %s", - "misc.refinedstorage.last_modified.hours": "Dernière modification il y %d heures par %s", - "misc.refinedstorage.last_modified.day": "Dernière modification il y %d jour par %s", - "misc.refinedstorage.last_modified.days": "Dernière modification il y %d jours par %s", - "misc.refinedstorage.last_modified.week": "Dernière modification il y %d semaine par %s", - "misc.refinedstorage.last_modified.weeks": "Dernière modification il y %d semaines par %s", - "misc.refinedstorage.last_modified.year": "Dernière modification il y %d an par %s", - "misc.refinedstorage.last_modified.years": "Dernière modification il y %d ans par %s", - "misc.refinedstorage.resource_type.item": "Objet", - "misc.refinedstorage.resource_type.fluid": "Fluide", - "misc.refinedstorage.press_shift_for_help": "Appuyez sur Maj pour obtenir de l'aide", - "misc.refinedstorage.no_permission": "Permission manquante", - "misc.refinedstorage.no_permission.open": "Vous n'êtes pas autorisé à ouvrir %s.", - "misc.refinedstorage.no_permission.insert": "Vous n'êtes pas autorisé à insérer.", - "misc.refinedstorage.no_permission.extract": "Vous n'êtes pas autorisé à extraire.", - "misc.refinedstorage.no_permission.build.place": "Vous n'êtes pas autorisé à placer %s ici.", - "misc.refinedstorage.no_permission.build.break": "Vous n'êtes pas autorisé à casser %s.", - "misc.refinedstorage.no_permission.build.rotate": "Vous n'êtes pas autorisé à faire pivoter %s.", - "misc.refinedstorage.no_permission.build.dismantle": "Vous n'êtes pas autorisé à démonter %s.", - "key.refinedstorage.focus_search_bar": "Focus search bar", - "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Vider la matrice d'artisanat dans le réseau", - "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Vider la matrice d'artisanat dans l'inventaire", - "key.refinedstorage.open_wireless_grid": "Ouvrir la grille sans fil", - "refinedstorage.subtitle.wrench": "Clé utilisée", - "permission.refinedstorage.insert": "Insérer", - "permission.refinedstorage.insert.description": "Si le joueur peut insérer des ressources dans le réseau.", - "permission.refinedstorage.extract": "Extraire", - "permission.refinedstorage.extract.description": "Si le joueur peut extraire des ressources du réseau.", - "permission.refinedstorage.autocrafting": "Fabrication automatique", - "permission.refinedstorage.autocrafting.description": "Si le joueur peut démarrer, annuler ou afficher les tâches de fabrication automatique.", - "permission.refinedstorage.open": "Ouvrir", - "permission.refinedstorage.open.description": "Si le joueur peut ouvrir l'interface graphique des périphériques du réseau.", - "permission.refinedstorage.build": "Construire", - "permission.refinedstorage.build.description": "Si le joueur peut ajouter ou enlever des périphériques au réseau.", - "permission.refinedstorage.security": "Sécurité", - "permission.refinedstorage.security.description": "Si le joueur peut gérer les options de sécurité du réseau.", - "tag.item.refinedstorage.cables": "Cables", - "tag.item.refinedstorage.constructors": "Constructors", - "tag.item.refinedstorage.controllers": "Controllers", - "tag.item.refinedstorage.crafting_grids": "Crafting Grids", - "tag.item.refinedstorage.creative_controllers": "Creative Controllers", - "tag.item.refinedstorage.destructors": "Destructors", - "tag.item.refinedstorage.detectors": "Detectors", - "tag.item.refinedstorage.exporters": "Exporters", - "tag.item.refinedstorage.external_storages": "External Storages", - "tag.item.refinedstorage.fluid_storage_disks": "Fluid Storage Disks", - "tag.item.refinedstorage.grids": "Grids", - "tag.item.refinedstorage.importers": "Importers", - "tag.item.refinedstorage.network_receivers": "Network Receivers", - "tag.item.refinedstorage.network_transmitters": "Network Transmitters", - "tag.item.refinedstorage.relays": "Relays", - "tag.item.refinedstorage.security_managers": "Security Managers", - "tag.item.refinedstorage.storage_disks": "Storage Disks", - "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", - "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "text.autoconfig.refinedstorage.title": "Refined Storage", - "text.autoconfig.refinedstorage.option.smoothScrolling": "Smooth scrolling", - "text.autoconfig.refinedstorage.option.screenSize": "Screen size", - "text.autoconfig.refinedstorage.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", - "text.autoconfig.refinedstorage.option.grid": "Grille", - "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", - "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Empêcher le tri lorsque la touche Maj est enfoncée", - "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", - "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", - "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", - "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronisation", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", - "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Direction du tri", - "text.autoconfig.refinedstorage.option.grid.sortingType": "Type de tri", - "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", - "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", - "text.autoconfig.refinedstorage.option.controller": "Controller", - "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", - "text.autoconfig.refinedstorage.option.cable": "Cable", - "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", - "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", - "text.autoconfig.refinedstorage.option.diskInterface": "Disk Interface", - "text.autoconfig.refinedstorage.option.diskInterface.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.diskInterface.energyUsagePerDisk": "Energy usage per disk", - "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", - "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", - "text.autoconfig.refinedstorage.option.importer": "Importateur", - "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.exporter": "Exportateur", - "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.detector": "Détecteur", - "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.constructor": "Constructeur", - "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.destructor": "Destructeur", - "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", - "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", - "text.autoconfig.refinedstorage.option.iface": "Interface", - "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.externalStorage": "Stockage Externe", - "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.wirelessGrid": "Grille sans fil", - "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Capacité énergétique", - "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", - "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", - "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", - "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Émetteur sans fil", - "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Portée de base", - "text.autoconfig.refinedstorage.option.storageMonitor": "Moniteur de Stockage", - "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.networkReceiver": "Récepteur Réseau", - "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.networkTransmitter": "Transmetteur Réseau", - "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.portableGrid": "Grille portable", - "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", - "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", - "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", - "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", - "text.autoconfig.refinedstorage.option.securityCard": "Security Card", - "text.autoconfig.refinedstorage.option.securityCard.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.fallbackSecurityCard": "Fallback Security Card", - "text.autoconfig.refinedstorage.option.fallbackSecurityCard.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.securityManager": "Security Manager", - "text.autoconfig.refinedstorage.option.securityManager.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.relay": "Relay", - "text.autoconfig.refinedstorage.option.relay.inputNetworkEnergyUsage": "Input network energy usage", - "text.autoconfig.refinedstorage.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", - "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", - "advancements.refinedstorage.connecting": "Connecting", - "advancements.refinedstorage.connecting.description": "Utiliser un câble pour connecter pour connecter des périphériques ensembles, ou placer les périphériques l'un contre l'autre", - "advancements.refinedstorage.drives": "Drives", - "advancements.refinedstorage.drives.description": "Craft a Disk Drive to be able to store your storage disks", - "advancements.refinedstorage.interfacing_with_disks": "Interfacing with disks", - "advancements.refinedstorage.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks", - "advancements.refinedstorage.storing_items": "Storing items", - "advancements.refinedstorage.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive", - "advancements.refinedstorage.viewing_your_storage": "Viewing your storage", - "advancements.refinedstorage.viewing_your_storage.description": "Craft a Grid to interact with your storage", - "advancements.refinedstorage.upgrading_your_grid": "Upgrading your Grid", - "advancements.refinedstorage.upgrading_your_grid.description": "Upgrade your Grid to a Crafting Grid to get crafting abilities", - "advancements.refinedstorage.storing_fluids": "Storing fluids", - "advancements.refinedstorage.storing_fluids.description": "Craft a Fluid Storage Disk and put it in your Disk Drive", - "advancements.refinedstorage.importing": "Importing", - "advancements.refinedstorage.importing.description": "Get resources into the storage network with an Importer", - "advancements.refinedstorage.exporting": "Exporting", - "advancements.refinedstorage.exporting.description": "Get resources out of the storage network with an Exporter", - "advancements.refinedstorage.upgrading": "Upgrading", - "advancements.refinedstorage.upgrading.description": "Construire une amélioration pour améliorer divers périphériques", - "advancements.refinedstorage.interface_to_the_world": "Interface to the world", - "advancements.refinedstorage.interface_to_the_world.description": "Export and import items at the same time with an Interface", - "advancements.refinedstorage.storing_externally": "Storing externally", - "advancements.refinedstorage.storing_externally.description": "Use an External Storage to provide the network with storage from an external block like a chest", - "advancements.refinedstorage.detecting": "Detecting", - "advancements.refinedstorage.detecting.description": "Use redstone to check resources stored in the storage network", - "advancements.refinedstorage.construction": "Construction", - "advancements.refinedstorage.construction.description": "Get blocks from the storage network into the world with a Constructor", - "advancements.refinedstorage.destruction": "Destruction", - "advancements.refinedstorage.destruction.description": "Get blocks from in the world into the storage network with a Destructor", - "advancements.refinedstorage.wireless": "Sans fil", - "advancements.refinedstorage.wireless.description": "Accédez à vos ressources à distance avec une grille sans fil", - "advancements.refinedstorage.better_than_a_barrel": "Better than a barrel", - "advancements.refinedstorage.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network", - "advancements.refinedstorage.no_cables_required": "No cables required", - "advancements.refinedstorage.no_cables_required.description": "Add extra components to your storage network without using cables by using a Network Transmitter, Network Receiver and Network Card", - "advancements.refinedstorage.portable_storage": "Portable storage", - "advancements.refinedstorage.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", - "advancements.refinedstorage.security": "Security", - "advancements.refinedstorage.security.description": "Secure your storage network with a Security Manager and a Security Card", - "advancements.refinedstorage.conditional_connecting": "Conditional connecting", - "advancements.refinedstorage.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" -} diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/nl_nl.json b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/nl_nl.json deleted file mode 100644 index 547960d11..000000000 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/nl_nl.json +++ /dev/null @@ -1,365 +0,0 @@ -{ - "itemGroup.refinedstorage.general": "Refined Storage", - "block.refinedstorage.cable": "Cable", - "block.refinedstorage.quartz_enriched_iron_block": "Block of Quartz Enriched Iron", - "block.refinedstorage.disk_drive": "Disk Drive", - "block.refinedstorage.machine_casing": "Machine Casing", - "block.refinedstorage.grid": "Grid", - "block.refinedstorage.crafting_grid": "Crafting Grid", - "block.refinedstorage.controller": "Controller", - "block.refinedstorage.controller.rei_fully_charged": "Fully charged Controller", - "block.refinedstorage.creative_controller": "Creative Controller", - "block.refinedstorage.1k_storage_block": "1K Storage Block", - "block.refinedstorage.4k_storage_block": "4K Storage Block", - "block.refinedstorage.16k_storage_block": "16K Storage Block", - "block.refinedstorage.64k_storage_block": "64K Storage Block", - "block.refinedstorage.creative_storage_block": "Creative Storage Block", - "block.refinedstorage.64b_fluid_storage_block": "64B Fluid Storage Block", - "block.refinedstorage.256b_fluid_storage_block": "256B Fluid Storage Block", - "block.refinedstorage.1024b_fluid_storage_block": "1024B Fluid Storage Block", - "block.refinedstorage.4096b_fluid_storage_block": "4096B Fluid Storage Block", - "block.refinedstorage.creative_fluid_storage_block": "Creative Fluid Storage Block", - "block.refinedstorage.importer": "Importer", - "block.refinedstorage.exporter": "Exporter", - "block.refinedstorage.interface": "Interface", - "block.refinedstorage.external_storage": "External Storage", - "block.refinedstorage.detector": "Detector", - "block.refinedstorage.constructor": "Constructor", - "block.refinedstorage.destructor": "Destructor", - "block.refinedstorage.wireless_transmitter": "Wireless Transmitter", - "block.refinedstorage.storage_monitor": "Storage Monitor", - "block.refinedstorage.network_receiver": "Network Receiver", - "block.refinedstorage.network_transmitter": "Network Transmitter", - "block.refinedstorage.portable_grid": "Portable Grid", - "block.refinedstorage.creative_portable_grid": "Creative Portable Grid", - "gui.refinedstorage.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", - "gui.refinedstorage.disk_drive.disks": "Disks", - "gui.refinedstorage.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", - "gui.refinedstorage.storage.filter_help": "The resources that may or may not be allowed in this storage, depending if the device is in allowlist or blocklist mode.", - "gui.refinedstorage.storage.filter_mode.empty_warning": "Without any configured filters, no resources will be accepted in this storage.", - "gui.refinedstorage.storage.filter_mode.allow.help": "Only allow resources into this storage that are configured in the filters.", - "gui.refinedstorage.storage.filter_mode.block.help": "Disallow resources into this storage that are configured in the filters.", - "gui.refinedstorage.grid.sorting.direction": "Sorting direction", - "gui.refinedstorage.grid.sorting.direction.ascending": "Ascending", - "gui.refinedstorage.grid.sorting.direction.descending": "Descending", - "gui.refinedstorage.grid.sorting.type": "Sorting type", - "gui.refinedstorage.grid.sorting.type.quantity": "Quantity", - "gui.refinedstorage.grid.sorting.type.name": "Name", - "gui.refinedstorage.grid.sorting.type.id": "ID", - "gui.refinedstorage.grid.sorting.type.last_modified": "Last modified", - "gui.refinedstorage.grid.size": "Size", - "gui.refinedstorage.grid.size.stretch": "Stretch", - "gui.refinedstorage.grid.size.small": "Small", - "gui.refinedstorage.grid.size.medium": "Medium", - "gui.refinedstorage.grid.size.large": "Large", - "gui.refinedstorage.grid.size.extra_large": "Extra large", - "gui.refinedstorage.grid.auto_selected": "Auto-selected", - "gui.refinedstorage.grid.auto_selected.help": "Whether to auto-select the search box when opening the Grid.", - "gui.refinedstorage.grid.synchronizer": "Synchronization mode", - "gui.refinedstorage.grid.synchronizer.off": "Off", - "gui.refinedstorage.grid.synchronizer.off.help": "Don't sync the search box text.", - "gui.refinedstorage.grid.synchronizer.jei": "JEI", - "gui.refinedstorage.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.", - "gui.refinedstorage.grid.synchronizer.jei.two_way": "JEI two-way", - "gui.refinedstorage.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.", - "gui.refinedstorage.grid.synchronizer.rei": "REI", - "gui.refinedstorage.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.", - "gui.refinedstorage.grid.synchronizer.rei.two_way": "REI two-way", - "gui.refinedstorage.grid.synchronizer.rei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.", - "gui.refinedstorage.grid.resource_type": "Resource type", - "gui.refinedstorage.grid.resource_type.all": "All", - "gui.refinedstorage.grid.resource_type.help": "Filter specific resource types.", - "gui.refinedstorage.crafting_grid.move.network": "Move items to network", - "gui.refinedstorage.crafting_grid.move.inventory": "Move items to inventory", - "gui.refinedstorage.detector.mode": "Mode", - "gui.refinedstorage.detector.mode.under": "Emit redstone signal when under the amount", - "gui.refinedstorage.detector.mode.equal": "Emit redstone signal when on the amount", - "gui.refinedstorage.detector.mode.above": "Emit redstone signal when above the amount", - "gui.refinedstorage.detector.filter_help": "The resource that should be detected in the storage network.", - "gui.refinedstorage.destructor.pickup_items": "Pickup items instead of breaking", - "gui.refinedstorage.destructor.filter_help": "The blocks that may or may not be destroyed, depending if the device is in allowlist or blocklist mode.", - "gui.refinedstorage.destructor.filter_mode.allow.help": "Only allow blocks into the storage network that are configured in the filters.", - "gui.refinedstorage.destructor.filter_mode.block.help": "Disallow blocks into the storage network that are configured in the filters.", - "gui.refinedstorage.constructor.drop_items": "Drop items instead of placing blocks", - "gui.refinedstorage.constructor.filter_help": "The resources that should be placed from the storage network.", - "gui.refinedstorage.interface.filter_help": "The resources that should be exported from the storage network.", - "gui.refinedstorage.exporter.filter_help": "The resources that should be exported from the storage network.", - "gui.refinedstorage.importer.filter_help": "The resources that may be imported from the target inventory.", - "gui.refinedstorage.importer.filter_mode.allow.help": "Only allow resources into the storage network that are configured in the filters.", - "gui.refinedstorage.importer.filter_mode.block.help": "Disallow resources into the storage network that are configured in the filters.", - "gui.refinedstorage.wireless_transmitter.distance": "%d block(s)", - "gui.refinedstorage.storage_monitor.filter_help": "The resource to display.", - "gui.refinedstorage.redstone_mode": "Redstone mode", - "gui.refinedstorage.redstone_mode.ignore": "Ignore", - "gui.refinedstorage.redstone_mode.ignore.help": "This device will always be active, regardless of redstone signal.", - "gui.refinedstorage.redstone_mode.high": "High", - "gui.refinedstorage.redstone_mode.high.help": "This device will only be active with a redstone signal.", - "gui.refinedstorage.redstone_mode.low": "Low", - "gui.refinedstorage.redstone_mode.low.help": "This device will only be active without a redstone signal.", - "gui.refinedstorage.scheduling_mode": "Scheduling mode", - "gui.refinedstorage.scheduling_mode.default": "Default", - "gui.refinedstorage.scheduling_mode.default.help": "Use the first available filter.", - "gui.refinedstorage.scheduling_mode.round_robin": "Round robin", - "gui.refinedstorage.scheduling_mode.round_robin.help": "Use each filter in turn.", - "gui.refinedstorage.scheduling_mode.random": "Random", - "gui.refinedstorage.scheduling_mode.random.help": "Use a random filter.", - "gui.refinedstorage.priority": "Priority", - "gui.refinedstorage.priority.storage_help": "The order in which the storage network will insert or extract resources, highest-first.", - "gui.refinedstorage.amount": "Amount", - "gui.refinedstorage.amount.reset": "Reset", - "gui.refinedstorage.amount.set": "Set", - "gui.refinedstorage.filter_mode": "Filter mode", - "gui.refinedstorage.filter_mode.allow": "Allowlist", - "gui.refinedstorage.filter_mode.block": "Blocklist", - "gui.refinedstorage.fuzzy_mode": "Fuzzy mode", - "gui.refinedstorage.fuzzy_mode.on": "On", - "gui.refinedstorage.fuzzy_mode.on.storage_help": "Match the filters for the allowlist or blocklist exactly.", - "gui.refinedstorage.fuzzy_mode.on.generic_help": "Match the filter exactly.", - "gui.refinedstorage.fuzzy_mode.on.extracting_storage_network_help": "Match the filters when extracting from the storage network exactly.", - "gui.refinedstorage.fuzzy_mode.on.extracting_source_help": "Match the filters when extracting from the source exactly.", - "gui.refinedstorage.fuzzy_mode.off": "Off", - "gui.refinedstorage.fuzzy_mode.off.storage_help": "Match the filters for the allowlist or blocklist without comparing NBT tags.", - "gui.refinedstorage.fuzzy_mode.off.generic_help": "Match the filter without comparing NBT tags.", - "gui.refinedstorage.fuzzy_mode.off.extracting_storage_network_help": "Match the filters when extracting from the storage network without comparing NBT tags.", - "gui.refinedstorage.fuzzy_mode.off.extracting_source_help": "Match the filters when extracting from the source without comparing NBT tags.", - "gui.refinedstorage.access_mode": "Access mode", - "gui.refinedstorage.access_mode.insert_extract": "Insert and extract", - "gui.refinedstorage.access_mode.insert_extract.help": "The storage network will be able to insert or extract from this storage.", - "gui.refinedstorage.access_mode.insert": "Insert only", - "gui.refinedstorage.access_mode.insert.help": "The storage network will only be able to insert into this storage. Contained resources will still be visible in a Grid.", - "gui.refinedstorage.access_mode.extract": "Extract only", - "gui.refinedstorage.access_mode.extract.help": "The storage network will only be able to extract from this storage.", - "gui.refinedstorage.void_excess": "Void excess resources", - "gui.refinedstorage.void_excess.help": "When void excess mode is turned on and the storage is full, it will keep accepting resources but void them.", - "gui.refinedstorage.void_excess.allowlist_warning": "Void excess will only work when the storage is in allowlist mode.", - "gui.refinedstorage.upgrade_slot": "Empty upgrade slot", - "gui.refinedstorage.filter_slot.empty_filter": "Empty filter", - "gui.refinedstorage.filter_slot.left_click_for": "Left click for", - "gui.refinedstorage.filter_slot.right_click_for": "Right click for", - "gui.refinedstorage.filter_slot.click_to_clear": "Click to clear", - "gui.refinedstorage.regulator_upgrade.filter_help": "The resource that should be regulated in the target.", - "gui.refinedstorage.network_transmitter.status.inactive": "Inactive", - "gui.refinedstorage.network_transmitter.status.missing_network_card": "Missing Network Card", - "gui.refinedstorage.network_transmitter.status.transmitting": "%d block(s)", - "gui.refinedstorage.network_transmitter.status.receiver_unreachable": "Unreachable", - "item.refinedstorage.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", - "item.refinedstorage.creative_controller.help": "Provides the storage network with an infinite source of energy.", - "item.refinedstorage.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", - "item.refinedstorage.grid.help": "Allows for interacting with the storage network.", - "item.refinedstorage.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.", - "item.refinedstorage.importer.help": "Imports resources from an external source to the storage network.", - "item.refinedstorage.exporter.help": "Exports resources from the storage network to an external destination.", - "item.refinedstorage.interface.help": "Acts as the combination of an Importer and Exporter.", - "item.refinedstorage.external_storage.help": "Provides the storage network with storage from an external source.", - "item.refinedstorage.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.", - "item.refinedstorage.constructor.help": "Places blocks from the storage network in the world.", - "item.refinedstorage.destructor.help": "Destroys blocks from the world and puts them in the storage network.", - "item.refinedstorage.quartz_enriched_iron": "Quartz Enriched Iron", - "item.refinedstorage.processor_binding": "Processor Binding", - "item.refinedstorage.silicon": "Silicon", - "item.refinedstorage.raw_basic_processor": "Raw Basic Processor", - "item.refinedstorage.raw_improved_processor": "Raw Improved Processor", - "item.refinedstorage.raw_advanced_processor": "Raw Advanced Processor", - "item.refinedstorage.basic_processor": "Basic Processor", - "item.refinedstorage.improved_processor": "Improved Processor", - "item.refinedstorage.advanced_processor": "Advanced Processor", - "item.refinedstorage.1k_storage_part": "1K Storage Part", - "item.refinedstorage.4k_storage_part": "4K Storage Part", - "item.refinedstorage.16k_storage_part": "16K Storage Part", - "item.refinedstorage.64k_storage_part": "64K Storage Part", - "item.refinedstorage.1k_storage_disk": "1K Storage Disk", - "item.refinedstorage.4k_storage_disk": "4K Storage Disk", - "item.refinedstorage.16k_storage_disk": "16K Storage Disk", - "item.refinedstorage.64k_storage_disk": "64K Storage Disk", - "item.refinedstorage.creative_storage_disk": "Creative Storage Disk", - "item.refinedstorage.64b_fluid_storage_part": "64B Fluid Storage Part", - "item.refinedstorage.256b_fluid_storage_part": "256B Fluid Storage Part", - "item.refinedstorage.1024b_fluid_storage_part": "1024B Fluid Storage Part", - "item.refinedstorage.4096b_fluid_storage_part": "4096B Fluid Storage Part", - "item.refinedstorage.64b_fluid_storage_disk": "64B Fluid Storage Disk", - "item.refinedstorage.256b_fluid_storage_disk": "256B Fluid Storage Disk", - "item.refinedstorage.1024b_fluid_storage_disk": "1024B Fluid Storage Disk", - "item.refinedstorage.4096b_fluid_storage_disk": "4096B Fluid Storage Disk", - "item.refinedstorage.creative_fluid_storage_disk": "Creative Fluid Storage Disk", - "item.refinedstorage.storage_housing": "Storage Housing", - "item.refinedstorage.construction_core": "Construction Core", - "item.refinedstorage.destruction_core": "Destruction Core", - "item.refinedstorage.wrench": "Wrench", - "item.refinedstorage.wrench.helper": "Use to rotate blocks or press SHIFT and use to dismantle Refined Storage blocks.", - "item.refinedstorage.upgrade": "Upgrade", - "item.refinedstorage.speed_upgrade": "Speed Upgrade", - "item.refinedstorage.stack_upgrade": "Stack Upgrade", - "item.refinedstorage.silk_touch_upgrade": "Silk Touch Upgrade", - "item.refinedstorage.fortune_upgrade.1": "Fortune I Upgrade", - "item.refinedstorage.fortune_upgrade.2": "Fortune II Upgrade", - "item.refinedstorage.fortune_upgrade.3": "Fortune III Upgrade", - "item.refinedstorage.regulator_upgrade": "Regulator Upgrade", - "item.refinedstorage.regulator_upgrade.help": "In an Exporter, will only export if the amount in the target is less than configured in the upgrade. In an Importer, will only import if the amount in the target is more than configured in the upgrade. Use item to configure.", - "item.refinedstorage.range_upgrade": "Range Upgrade", - "item.refinedstorage.creative_range_upgrade": "Creative Range Upgrade", - "item.refinedstorage.wireless_grid": "Wireless Grid", - "item.refinedstorage.creative_wireless_grid": "Creative Wireless Grid", - "item.refinedstorage.wireless_transmitter.help": "Provides wireless network access for items like the Wireless Grid. Multiple are allowed in an area for wider coverage.", - "item.refinedstorage.network_item.unbound": "Unbound.", - "item.refinedstorage.network_item.unbound.help": "Use on any storage network device to bind.", - "item.refinedstorage.network_item.bound_to": "Bound to %d, %d, %d.", - "item.refinedstorage.network_item.cannot_open_with_shortcut_due_to_duplicate": "There is more than one %s in your inventory.", - "item.refinedstorage.network_item.cannot_open_because_not_found": "There isn't any %s in your inventory.", - "item.refinedstorage.configuration_card": "Configuration Card", - "item.refinedstorage.configuration_card.empty": "Empty.", - "item.refinedstorage.configuration_card.configured": "Contains configuration for %s.", - "item.refinedstorage.configuration_card.copied_configuration": "Copied configuration for %s.", - "item.refinedstorage.configuration_card.cleared_configuration": "Cleared configuration.", - "item.refinedstorage.configuration_card.cannot_apply_configuration": "Cannot apply configuration card to different type of device. It is configured for %s.", - "item.refinedstorage.configuration_card.applied_configuration": "Applied configuration.", - "item.refinedstorage.configuration_card.empty_help": "Use on a storage network device while crouching to copy its configuration and upgrades to the card.", - "item.refinedstorage.configuration_card.configured_help": "Use on the destination storage network device while crouching to transfer the configuration and upgrades. Use while crouching to clear.", - "item.refinedstorage.network_card": "Network Card", - "item.refinedstorage.network_card.unbound_help": "Use while crouching on a Network Receiver.", - "item.refinedstorage.network_card.unbound": "Unbound.", - "item.refinedstorage.network_card.bound_help": "Insert into a Network Transmitter. Use while crouching to clear binding.", - "item.refinedstorage.network_card.bound": "Bound to %d, %d, %d in %s.", - "misc.refinedstorage.stored": "Stored: %s", - "misc.refinedstorage.stored_with_capacity": "Stored: %s / %s (%d%%)", - "misc.refinedstorage.total": "%d total", - "misc.refinedstorage.last_modified.just_now": "Last modified just now by %s", - "misc.refinedstorage.last_modified.second": "Last modified %d second ago by %s", - "misc.refinedstorage.last_modified.seconds": "Last modified %d seconds ago by %s", - "misc.refinedstorage.last_modified.minute": "Last modified %d minute ago by %s", - "misc.refinedstorage.last_modified.minutes": "Last modified %d minutes ago by %s", - "misc.refinedstorage.last_modified.hour": "Last modified %d hour ago by %s", - "misc.refinedstorage.last_modified.hours": "Last modified %d hours ago by %s", - "misc.refinedstorage.last_modified.day": "Last modified %d day ago by %s", - "misc.refinedstorage.last_modified.days": "Last modified %d days ago by %s", - "misc.refinedstorage.last_modified.week": "Last modified %d week ago by %s", - "misc.refinedstorage.last_modified.weeks": "Last modified %d weeks ago by %s", - "misc.refinedstorage.last_modified.year": "Last modified %d year ago by %s", - "misc.refinedstorage.last_modified.years": "Last modified %d years ago by %s", - "misc.refinedstorage.resource_type.item": "Item", - "misc.refinedstorage.resource_type.fluid": "Fluid", - "misc.refinedstorage.press_shift_for_help": "Press SHIFT for help", - "key.refinedstorage.focus_search_bar": "Focus search bar", - "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", - "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", - "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", - "refinedstorage.subtitle.wrench": "Wrench used", - "category.refinedstorage.key_bindings": "Refined Storage", - "text.autoconfig.refinedstorage.title": "Refined Storage", - "text.autoconfig.refinedstorage.option.grid": "Grid", - "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", - "text.autoconfig.refinedstorage.option.grid.maxRowsStretch": "Maximum amount of rows when stretched", - "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", - "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", - "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", - "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.grid.smoothScrolling": "Smooth scrolling", - "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", - "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", - "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", - "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", - "text.autoconfig.refinedstorage.option.grid.size": "Size", - "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", - "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", - "text.autoconfig.refinedstorage.option.controller": "Controller", - "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", - "text.autoconfig.refinedstorage.option.cable": "Cable", - "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", - "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", - "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", - "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", - "text.autoconfig.refinedstorage.option.importer": "Importer", - "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.exporter": "Exporter", - "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.detector": "Detector", - "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.constructor": "Constructor", - "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.destructor": "Destructor", - "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", - "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", - "text.autoconfig.refinedstorage.option.iface": "Interface", - "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", - "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", - "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", - "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", - "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", - "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", - "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", - "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", - "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", - "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", - "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", - "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", - "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", - "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", - "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", - "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", - "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a network to provide your network with energy", - "advancements.refinedstorage.connecting": "Connecting", - "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", - "advancements.refinedstorage.drives": "Drives", - "advancements.refinedstorage.drives.description": "Craft a Disk Drive to be able to store your storage disks", - "advancements.refinedstorage.storing_items": "Storing items", - "advancements.refinedstorage.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive", - "advancements.refinedstorage.viewing_your_storage": "Viewing your storage", - "advancements.refinedstorage.viewing_your_storage.description": "Craft a Grid to interact with your storage", - "advancements.refinedstorage.upgrading_your_grid": "Upgrading your Grid", - "advancements.refinedstorage.upgrading_your_grid.description": "Upgrade your Grid to a Crafting Grid to get crafting abilities", - "advancements.refinedstorage.storing_fluids": "Storing fluids", - "advancements.refinedstorage.storing_fluids.description": "Craft a Fluid Storage Disk and put it in your Disk Drive", - "advancements.refinedstorage.importing": "Importing", - "advancements.refinedstorage.importing.description": "Get resources into the storage network with an Importer", - "advancements.refinedstorage.exporting": "Exporting", - "advancements.refinedstorage.exporting.description": "Get resources out of the storage network with an Exporter", - "advancements.refinedstorage.upgrading": "Upgrading", - "advancements.refinedstorage.upgrading.description": "Craft an Upgrade to improve various devices", - "advancements.refinedstorage.interface_to_the_world": "Interface to the world", - "advancements.refinedstorage.interface_to_the_world.description": "Export and import items at the same time with an Interface", - "advancements.refinedstorage.storing_externally": "Storing externally", - "advancements.refinedstorage.storing_externally.description": "Use an External Storage to provide the network with storage from an external block like a chest", - "advancements.refinedstorage.detecting": "Detecting", - "advancements.refinedstorage.detecting.description": "Use redstone to check resources stored in the network", - "advancements.refinedstorage.construction": "Construction", - "advancements.refinedstorage.construction.description": "Get blocks from the storage network into the world with a Constructor", - "advancements.refinedstorage.destruction": "Destruction", - "advancements.refinedstorage.destruction.description": "Get blocks from in the world into the storage network with a Destructor", - "advancements.refinedstorage.wireless": "Wireless", - "advancements.refinedstorage.wireless.description": "Access your resources wirelessly with a Wireless Grid.", - "advancements.refinedstorage.better_than_a_barrel": "Better than a barrel", - "advancements.refinedstorage.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network", - "advancements.refinedstorage.no_cables_required": "No cables required", - "advancements.refinedstorage.no_cables_required.description": "Add extra components to your network without using cables by using a Network Transmitter, Network Receiver and Network Card", - "advancements.refinedstorage.portable_storage": "Portable storage", - "advancements.refinedstorage.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network" -} diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/icons.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/icons.png deleted file mode 100644 index 39ec1ea00..000000000 Binary files a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/icons.png and /dev/null differ diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/storage/LimitedPlatformStorageTest.java b/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/storage/LimitedPlatformStorageTest.java deleted file mode 100644 index a37e37fba..000000000 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/storage/LimitedPlatformStorageTest.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.storage; - -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; -import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorage; -import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -class LimitedPlatformStorageTest { - LimitedPlatformStorage sut; - - @BeforeEach - @SuppressWarnings("ConstantConditions") - void setUp() { - final LimitedStorageImpl delegate = new LimitedStorageImpl(new InMemoryStorageImpl(), 100); - sut = new LimitedPlatformStorage(delegate, StorageTypes.ITEM, null, null); - } - - @Test - void testSetup() { - // Assert - assertThat(sut.getType()).isEqualTo(StorageTypes.ITEM); - assertThat(sut).isInstanceOf(LimitedStorage.class); - assertThat(sut.getCapacity()).isEqualTo(100); - } -} diff --git a/refinedstorage-platform-fabric/build.gradle.kts b/refinedstorage-platform-fabric/build.gradle.kts deleted file mode 100644 index 9b36e7251..000000000 --- a/refinedstorage-platform-fabric/build.gradle.kts +++ /dev/null @@ -1,49 +0,0 @@ -plugins { - id("refinedarchitect.fabric") -} - -repositories { - maven { - name = "ModMenu" - url = uri("https://maven.terraformersmc.com/") - } - maven { - name = "Cloth Config" - url = uri("https://maven.shedaniel.me/") - } -} - -refinedarchitect { - modId = "refinedstorage" - fabric() - compileWithProject(project(":refinedstorage-platform-common")) - compileWithProject(project(":refinedstorage-platform-api")) - addProject(project(":refinedstorage-core-api")) - addProject(project(":refinedstorage-resource-api")) - addProject(project(":refinedstorage-storage-api")) - addProject(project(":refinedstorage-network-api")) - addProject(project(":refinedstorage-network")) - addProject(project(":refinedstorage-grid-api")) - addProject(project(":refinedstorage-query-parser")) - publishing { - maven = true - // curseForge = "243076" - // modrinth = "refined-storage" - } -} - -base { - archivesName.set("refinedstorage-platform-fabric") -} - -dependencies { - modApi(libs.cloth.config) { - exclude(group = "net.fabricmc.fabric-api") - } - modApi(libs.teamreborn.energy) { - exclude(group = "net.fabricmc.fabric-api") - } - modApi(libs.modmenu) - include(libs.cloth.config) - include(libs.teamreborn.energy) -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ConfigImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ConfigImpl.java deleted file mode 100644 index 92ea07790..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ConfigImpl.java +++ /dev/null @@ -1,695 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric; - -import com.refinedmods.refinedstorage.api.grid.view.GridSortingDirection; -import com.refinedmods.refinedstorage.platform.common.content.DefaultEnergyUsage; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridMatrixCloseBehavior; -import com.refinedmods.refinedstorage.platform.common.grid.GridSortingTypes; -import com.refinedmods.refinedstorage.platform.common.support.stretching.ScreenSize; -import com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil; - -import java.util.Optional; - -import me.shedaniel.autoconfig.AutoConfig; -import me.shedaniel.autoconfig.ConfigData; -import me.shedaniel.autoconfig.annotation.Config; -import me.shedaniel.autoconfig.annotation.ConfigEntry; -import net.minecraft.resources.ResourceLocation; - -@Config(name = IdentifierUtil.MOD_ID) -public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage.platform.common.Config { - private ScreenSize screenSize = ScreenSize.STRETCH; - - private boolean smoothScrolling = true; - - @ConfigEntry.BoundedDiscrete(min = 3L, max = 256) - private int maxRowsStretch = 256; - - @ConfigEntry.Gui.CollapsibleObject - private GridEntryImpl grid = new GridEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private CraftingGridEntryImpl craftingGrid = new CraftingGridEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private ControllerEntryImpl controller = new ControllerEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private DiskDriveEntryImpl diskDrive = new DiskDriveEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private DiskInterfaceEntryImpl diskInterface = new DiskInterfaceEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl cable = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.CABLE); - - @ConfigEntry.Gui.CollapsibleObject - private StorageBlockEntryImpl storageBlock = new StorageBlockEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private FluidStorageBlockEntryImpl fluidStorageBlock = new FluidStorageBlockEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl importer = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.IMPORTER); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl exporter = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.EXPORTER); - - @ConfigEntry.Gui.CollapsibleObject - private UpgradeEntryImpl upgrade = new UpgradeEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl iface = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.INTERFACE); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl externalStorage = new SimpleEnergyUsageEntryImpl( - DefaultEnergyUsage.EXTERNAL_STORAGE - ); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl detector = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.DETECTOR); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl destructor = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.DESTRUCTOR); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl constructor = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.CONSTRUCTOR); - - @ConfigEntry.Gui.CollapsibleObject - private WirelessGridEntryImpl wirelessGrid = new WirelessGridEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private WirelessTransmitterEntryImpl wirelessTransmitter = new WirelessTransmitterEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl storageMonitor = new SimpleEnergyUsageEntryImpl( - DefaultEnergyUsage.STORAGE_MONITOR - ); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl networkReceiver = new SimpleEnergyUsageEntryImpl( - DefaultEnergyUsage.NETWORK_RECEIVER - ); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl networkTransmitter = new SimpleEnergyUsageEntryImpl( - DefaultEnergyUsage.NETWORK_TRANSMITTER - ); - - @ConfigEntry.Gui.CollapsibleObject - private PortableGridEntryImpl portableGrid = new PortableGridEntryImpl(); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl securityCard = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.SECURITY_CARD); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl fallbackSecurityCard = new SimpleEnergyUsageEntryImpl( - DefaultEnergyUsage.FALLBACK_SECURITY_CARD - ); - - @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl securityManager = new SimpleEnergyUsageEntryImpl( - DefaultEnergyUsage.SECURITY_MANAGER - ); - - @ConfigEntry.Gui.CollapsibleObject - private RelayEntryImpl relay = new RelayEntryImpl(); - - public static ConfigImpl get() { - return AutoConfig.getConfigHolder(ConfigImpl.class).getConfig(); - } - - @Override - public ScreenSize getScreenSize() { - return screenSize; - } - - @Override - public void setScreenSize(final ScreenSize screenSize) { - this.screenSize = screenSize; - AutoConfig.getConfigHolder(ConfigImpl.class).save(); - } - - @Override - public boolean isSmoothScrolling() { - return smoothScrolling; - } - - @Override - public int getMaxRowsStretch() { - return maxRowsStretch; - } - - @Override - public GridEntry getGrid() { - return grid; - } - - @Override - public CraftingGridEntry getCraftingGrid() { - return craftingGrid; - } - - @Override - public ControllerEntry getController() { - return controller; - } - - @Override - public DiskDriveEntry getDiskDrive() { - return diskDrive; - } - - @Override - public DiskInterfaceEntry getDiskInterface() { - return diskInterface; - } - - @Override - public SimpleEnergyUsageEntry getCable() { - return cable; - } - - @Override - public StorageBlockEntry getStorageBlock() { - return storageBlock; - } - - @Override - public FluidStorageBlockEntry getFluidStorageBlock() { - return fluidStorageBlock; - } - - @Override - public SimpleEnergyUsageEntry getImporter() { - return importer; - } - - @Override - public SimpleEnergyUsageEntry getExporter() { - return exporter; - } - - @Override - public UpgradeEntry getUpgrade() { - return upgrade; - } - - @Override - public SimpleEnergyUsageEntry getInterface() { - return iface; - } - - @Override - public SimpleEnergyUsageEntry getExternalStorage() { - return externalStorage; - } - - @Override - public SimpleEnergyUsageEntry getDetector() { - return detector; - } - - @Override - public SimpleEnergyUsageEntry getDestructor() { - return destructor; - } - - @Override - public SimpleEnergyUsageEntry getConstructor() { - return constructor; - } - - @Override - public WirelessGridEntry getWirelessGrid() { - return wirelessGrid; - } - - @Override - public WirelessTransmitterEntry getWirelessTransmitter() { - return wirelessTransmitter; - } - - @Override - public SimpleEnergyUsageEntry getStorageMonitor() { - return storageMonitor; - } - - @Override - public SimpleEnergyUsageEntry getNetworkReceiver() { - return networkReceiver; - } - - @Override - public SimpleEnergyUsageEntry getNetworkTransmitter() { - return networkTransmitter; - } - - @Override - public PortableGridEntry getPortableGrid() { - return portableGrid; - } - - @Override - public SimpleEnergyUsageEntry getSecurityCard() { - return securityCard; - } - - @Override - public SimpleEnergyUsageEntry getFallbackSecurityCard() { - return fallbackSecurityCard; - } - - @Override - public SimpleEnergyUsageEntry getSecurityManager() { - return securityManager; - } - - @Override - public RelayEntry getRelay() { - return relay; - } - - private static class GridEntryImpl implements GridEntry { - private boolean largeFont = false; - - private long energyUsage = DefaultEnergyUsage.GRID; - - private boolean preventSortingWhileShiftIsDown = true; - - private boolean detailedTooltip = true; - - private boolean rememberSearchQuery = false; - - private boolean autoSelected = false; - - private String synchronizer = ""; - - private String resourceTypeId = ""; - - private GridSortingDirection sortingDirection = GridSortingDirection.ASCENDING; - - private GridSortingTypes sortingType = GridSortingTypes.QUANTITY; - - @Override - public boolean isLargeFont() { - return largeFont; - } - - @Override - public boolean isPreventSortingWhileShiftIsDown() { - return preventSortingWhileShiftIsDown; - } - - @Override - public boolean isDetailedTooltip() { - return detailedTooltip; - } - - @Override - public boolean isRememberSearchQuery() { - return rememberSearchQuery; - } - - @Override - public long getEnergyUsage() { - return energyUsage; - } - - @Override - public boolean isAutoSelected() { - return autoSelected; - } - - @Override - public void setAutoSelected(final boolean autoSelected) { - this.autoSelected = autoSelected; - save(); - } - - @Override - public Optional getSynchronizer() { - if (synchronizer == null || synchronizer.trim().isBlank()) { - return Optional.empty(); - } - return Optional.of(synchronizer).map(ResourceLocation::tryParse); - } - - @Override - public void setSynchronizer(final ResourceLocation synchronizerId) { - this.synchronizer = synchronizerId.toString(); - save(); - } - - @Override - public void clearSynchronizer() { - this.synchronizer = ""; - save(); - } - - @Override - public GridSortingDirection getSortingDirection() { - return sortingDirection; - } - - @Override - public void setSortingDirection(final GridSortingDirection sortingDirection) { - this.sortingDirection = sortingDirection; - save(); - } - - @Override - public GridSortingTypes getSortingType() { - return sortingType; - } - - @Override - public void setSortingType(final GridSortingTypes sortingType) { - this.sortingType = sortingType; - save(); - } - - @Override - public Optional getResourceTypeId() { - if (resourceTypeId == null || resourceTypeId.trim().isBlank()) { - return Optional.empty(); - } - return Optional.of(resourceTypeId).map(ResourceLocation::tryParse); - } - - @Override - public void setResourceTypeId(final ResourceLocation resourceTypeId) { - this.resourceTypeId = resourceTypeId.toString(); - save(); - } - - @Override - public void clearResourceType() { - this.resourceTypeId = ""; - save(); - } - - private static void save() { - AutoConfig.getConfigHolder(ConfigImpl.class).save(); - } - } - - private static class CraftingGridEntryImpl implements CraftingGridEntry { - private long energyUsage = DefaultEnergyUsage.CRAFTING_GRID; - - private CraftingGridMatrixCloseBehavior craftingMatrixCloseBehavior = CraftingGridMatrixCloseBehavior.NONE; - - @Override - public long getEnergyUsage() { - return energyUsage; - } - - @Override - public CraftingGridMatrixCloseBehavior getCraftingMatrixCloseBehavior() { - return craftingMatrixCloseBehavior; - } - } - - private static class DiskDriveEntryImpl implements DiskDriveEntry { - private long energyUsage = DefaultEnergyUsage.DISK_DRIVE; - - private long energyUsagePerDisk = DefaultEnergyUsage.DISK_DRIVE_PER_DISK; - - @Override - public long getEnergyUsage() { - return energyUsage; - } - - @Override - public long getEnergyUsagePerDisk() { - return energyUsagePerDisk; - } - } - - private static class DiskInterfaceEntryImpl implements DiskInterfaceEntry { - private long energyUsage = DefaultEnergyUsage.DISK_INTERFACE; - - private long energyUsagePerDisk = DefaultEnergyUsage.DISK_INTERFACE_PER_DISK; - - @Override - public long getEnergyUsage() { - return energyUsage; - } - - @Override - public long getEnergyUsagePerDisk() { - return energyUsagePerDisk; - } - } - - private static class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry { - private long energyUsage; - - SimpleEnergyUsageEntryImpl(final long energyUsage) { - this.energyUsage = energyUsage; - } - - @Override - public long getEnergyUsage() { - return energyUsage; - } - } - - private static class ControllerEntryImpl implements ControllerEntry { - private long energyCapacity = DefaultEnergyUsage.CONTROLLER_CAPACITY; - - public long getEnergyCapacity() { - return energyCapacity; - } - } - - private static class StorageBlockEntryImpl implements StorageBlockEntry { - private long oneKEnergyUsage = DefaultEnergyUsage.ONE_K_STORAGE_BLOCK; - private long fourKEnergyUsage = DefaultEnergyUsage.FOUR_K_STORAGE_BLOCK; - private long sixteenKEnergyUsage = DefaultEnergyUsage.SIXTEEN_K_STORAGE_BLOCK; - private long sixtyFourKEnergyUsage = DefaultEnergyUsage.SIXTY_FOUR_K_STORAGE_BLOCK; - private long creativeEnergyUsage = DefaultEnergyUsage.CREATIVE_STORAGE_BLOCK; - - @Override - public long get1kEnergyUsage() { - return oneKEnergyUsage; - } - - @Override - public long get4kEnergyUsage() { - return fourKEnergyUsage; - } - - @Override - public long get16kEnergyUsage() { - return sixteenKEnergyUsage; - } - - @Override - public long get64kEnergyUsage() { - return sixtyFourKEnergyUsage; - } - - @Override - public long getCreativeEnergyUsage() { - return creativeEnergyUsage; - } - } - - private static class FluidStorageBlockEntryImpl implements FluidStorageBlockEntry { - private long sixtyFourBEnergyUsage = DefaultEnergyUsage.SIXTY_FOUR_B_FLUID_STORAGE_BLOCK; - private long twoHundredFiftySixBEnergyUsage = DefaultEnergyUsage.TWO_HUNDRED_FIFTY_SIX_B_FLUID_STORAGE_BLOCK; - private long thousandTwentyFourBEnergyUsage = DefaultEnergyUsage.THOUSAND_TWENTY_FOUR_B_FLUID_STORAGE_BLOCK; - private long fourThousandNinetySixBEnergyUsage = - DefaultEnergyUsage.FOUR_THOUSAND_NINETY_SIX_B_FLUID_STORAGE_BLOCK; - private long creativeEnergyUsage = DefaultEnergyUsage.CREATIVE_FLUID_STORAGE_BLOCK; - - @Override - public long get64bEnergyUsage() { - return sixtyFourBEnergyUsage; - } - - @Override - public long get256bEnergyUsage() { - return twoHundredFiftySixBEnergyUsage; - } - - @Override - public long get1024bEnergyUsage() { - return thousandTwentyFourBEnergyUsage; - } - - @Override - public long get4096bEnergyUsage() { - return fourThousandNinetySixBEnergyUsage; - } - - @Override - public long getCreativeEnergyUsage() { - return creativeEnergyUsage; - } - } - - private static class UpgradeEntryImpl implements UpgradeEntry { - private long speedUpgradeEnergyUsage = DefaultEnergyUsage.SPEED_UPGRADE; - - private long stackUpgradeEnergyUsage = DefaultEnergyUsage.STACK_UPGRADE; - - private long fortune1UpgradeEnergyUsage = DefaultEnergyUsage.FORTUNE_1_UPGRADE; - - private long fortune2UpgradeEnergyUsage = DefaultEnergyUsage.FORTUNE_2_UPGRADE; - - private long fortune3UpgradeEnergyUsage = DefaultEnergyUsage.FORTUNE_3_UPGRADE; - - private long silkTouchUpgradeEnergyUsage = DefaultEnergyUsage.SILK_TOUCH_UPGRADE; - - private long regulatorUpgradeEnergyUsage = DefaultEnergyUsage.REGULATOR_UPGRADE; - - private long rangeUpgradeEnergyUsage = DefaultEnergyUsage.RANGE_UPGRADE; - - private long creativeRangeUpgradeEnergyUsage = DefaultEnergyUsage.CREATIVE_RANGE_UPGRADE; - - private int rangeUpgradeRange = DefaultEnergyUsage.RANGE_UPGRADE_RANGE; - - @Override - public long getSpeedUpgradeEnergyUsage() { - return speedUpgradeEnergyUsage; - } - - @Override - public long getStackUpgradeEnergyUsage() { - return stackUpgradeEnergyUsage; - } - - @Override - public long getFortune1UpgradeEnergyUsage() { - return fortune1UpgradeEnergyUsage; - } - - @Override - public long getFortune2UpgradeEnergyUsage() { - return fortune2UpgradeEnergyUsage; - } - - @Override - public long getFortune3UpgradeEnergyUsage() { - return fortune3UpgradeEnergyUsage; - } - - @Override - public long getSilkTouchUpgradeEnergyUsage() { - return silkTouchUpgradeEnergyUsage; - } - - @Override - public long getRegulatorUpgradeEnergyUsage() { - return regulatorUpgradeEnergyUsage; - } - - @Override - public long getRangeUpgradeEnergyUsage() { - return rangeUpgradeEnergyUsage; - } - - @Override - public long getCreativeRangeUpgradeEnergyUsage() { - return creativeRangeUpgradeEnergyUsage; - } - - @Override - public int getRangeUpgradeRange() { - return rangeUpgradeRange; - } - } - - private static class WirelessGridEntryImpl implements WirelessGridEntry { - private long energyCapacity = DefaultEnergyUsage.WIRELESS_GRID_CAPACITY; - - private long openEnergyUsage = DefaultEnergyUsage.WIRELESS_GRID_OPEN; - - private long insertEnergyUsage = DefaultEnergyUsage.WIRELESS_GRID_INSERT; - - private long extractEnergyUsage = DefaultEnergyUsage.WIRELESS_GRID_EXTRACT; - - @Override - public long getEnergyCapacity() { - return energyCapacity; - } - - @Override - public long getOpenEnergyUsage() { - return openEnergyUsage; - } - - @Override - public long getInsertEnergyUsage() { - return insertEnergyUsage; - } - - @Override - public long getExtractEnergyUsage() { - return extractEnergyUsage; - } - } - - private static class WirelessTransmitterEntryImpl implements WirelessTransmitterEntry { - private long energyUsage = DefaultEnergyUsage.WIRELESS_TRANSMITTER; - - private int baseRange = DefaultEnergyUsage.WIRELESS_TRANSMITTER_BASE_RANGE; - - @Override - public long getEnergyUsage() { - return energyUsage; - } - - @Override - public int getBaseRange() { - return baseRange; - } - } - - private static class PortableGridEntryImpl implements PortableGridEntry { - private long energyCapacity = DefaultEnergyUsage.PORTABLE_GRID_CAPACITY; - - private long openEnergyUsage = DefaultEnergyUsage.PORTABLE_GRID_OPEN; - - private long insertEnergyUsage = DefaultEnergyUsage.PORTABLE_GRID_INSERT; - - private long extractEnergyUsage = DefaultEnergyUsage.PORTABLE_GRID_EXTRACT; - - @Override - public long getEnergyCapacity() { - return energyCapacity; - } - - @Override - public long getOpenEnergyUsage() { - return openEnergyUsage; - } - - @Override - public long getInsertEnergyUsage() { - return insertEnergyUsage; - } - - @Override - public long getExtractEnergyUsage() { - return extractEnergyUsage; - } - } - - private static class RelayEntryImpl implements RelayEntry { - private long inputNetworkEnergyUsage = DefaultEnergyUsage.RELAY_INPUT_NETWORK; - - private long outputNetworkEnergyUsage = DefaultEnergyUsage.RELAY_OUTPUT_NETWORK; - - @Override - public long getInputNetworkEnergyUsage() { - return inputNetworkEnergyUsage; - } - - @Override - public long getOutputNetworkEnergyUsage() { - return outputNetworkEnergyUsage; - } - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java deleted file mode 100644 index fb864b9a3..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java +++ /dev/null @@ -1,612 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.RefinedStoragePlugin; -import com.refinedmods.refinedstorage.platform.common.AbstractModInitializer; -import com.refinedmods.refinedstorage.platform.common.PlatformProxy; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntityTypeFactory; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.content.CreativeModeTabItems; -import com.refinedmods.refinedstorage.platform.common.content.DirectRegistryCallback; -import com.refinedmods.refinedstorage.platform.common.content.ExtendedMenuTypeFactory; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.content.MenuTypeFactory; -import com.refinedmods.refinedstorage.platform.common.content.RegistryCallback; -import com.refinedmods.refinedstorage.platform.common.grid.WirelessGridItem; -import com.refinedmods.refinedstorage.platform.common.iface.InterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.iface.InterfacePlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.common.security.FallbackSecurityCardItem; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardItem; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlockItem; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridType; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseBlock; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketHandler; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.CraftingGridClearPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.CraftingGridRecipeTransferPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.GridExtractPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.GridInsertPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.GridScrollPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.PropertyChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.ResourceFilterSlotChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.ResourceSlotAmountChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.ResourceSlotChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SecurityCardBoundPlayerPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SecurityCardPermissionPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SecurityCardResetPermissionPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SingleAmountChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.StorageInfoRequestPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.UseSlotReferencedItemPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.EnergyInfoPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridActivePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridClearPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridUpdatePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.NetworkTransmitterStatusPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.NoPermissionPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.ResourceSlotUpdatePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.StorageInfoResponsePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.WirelessTransmitterRangePacket; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.util.ServerEventQueue; -import com.refinedmods.refinedstorage.platform.fabric.exporter.FabricStorageExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.fabric.grid.strategy.FluidGridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.fabric.grid.strategy.FluidGridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.fabric.grid.strategy.ItemGridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.fabric.grid.strategy.ItemGridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.fabric.importer.FabricStorageImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.fabric.security.NetworkNodeBreakSecurityEventListener; -import com.refinedmods.refinedstorage.platform.fabric.storage.diskdrive.FabricDiskDriveBlockEntity; -import com.refinedmods.refinedstorage.platform.fabric.storage.diskinterface.FabricDiskInterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.fabric.storage.externalstorage.FabricStoragePlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.fabric.storage.portablegrid.FabricPortableGridBlockEntity; -import com.refinedmods.refinedstorage.platform.fabric.support.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage.platform.fabric.support.resource.ResourceContainerFluidStorageAdapter; -import com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.function.Function; -import java.util.function.Predicate; - -import me.shedaniel.autoconfig.AutoConfig; -import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer; -import net.fabricmc.api.ModInitializer; -import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; -import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; -import net.fabricmc.fabric.api.event.player.UseBlockCallback; -import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; -import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; -import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; -import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.item.ItemStorage; -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; -import net.fabricmc.fabric.api.transfer.v1.storage.Storage; -import net.fabricmc.fabric.api.transfer.v1.storage.base.CombinedStorage; -import net.fabricmc.fabric.api.transfer.v1.storage.base.FilteringStorage; -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.core.Registry; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.world.Container; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.flag.FeatureFlags; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import team.reborn.energy.api.EnergyStorage; - -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CREATIVE_PORTABLE_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CREATIVE_WIRELESS_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.FALLBACK_SECURITY_CARD; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.PORTABLE_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.REGULATOR_UPGRADE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.SECURITY_CARD; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.WIRELESS_GRID; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public class ModInitializerImpl extends AbstractModInitializer implements ModInitializer { - private static final Logger LOGGER = LoggerFactory.getLogger(ModInitializerImpl.class); - private static final String PLUGIN_ENTRYPOINT_KEY = "refinedstorage_plugin"; - - @Override - public void onInitialize() { - AutoConfig.register(ConfigImpl.class, Toml4jConfigSerializer::new); - - PlatformProxy.loadPlatform(new PlatformImpl()); - initializePlatformApi(); - registerAdditionalGridInsertionStrategyFactories(); - registerGridExtractionStrategyFactories(); - registerGridScrollingStrategyFactories(); - registerImporterTransferStrategyFactories(); - registerExporterTransferStrategyFactories(); - registerExternalStorageProviderFactories(); - registerContent(); - registerPackets(); - registerPacketHandlers(); - registerSounds(new DirectRegistryCallback<>(BuiltInRegistries.SOUND_EVENT)); - registerRecipeSerializers(new DirectRegistryCallback<>(BuiltInRegistries.RECIPE_SERIALIZER)); - registerSidedHandlers(); - registerTickHandler(); - registerWrenchingEvent(); - registerSecurityBlockBreakEvent(); - - final List pluginEntrypoints = FabricLoader.getInstance() - .getEntrypoints(PLUGIN_ENTRYPOINT_KEY, RefinedStoragePlugin.class); - LOGGER.debug("Loading {} Refined Storage plugin entrypoints.", pluginEntrypoints.size()); - pluginEntrypoints.forEach(plugin -> plugin.onPlatformApiAvailable(PlatformApi.INSTANCE)); - - LOGGER.debug("Refined Storage has loaded."); - } - - private void registerAdditionalGridInsertionStrategyFactories() { - PlatformApi.INSTANCE.addGridInsertionStrategyFactory(FluidGridInsertionStrategy::new); - } - - private void registerGridExtractionStrategyFactories() { - PlatformApi.INSTANCE.addGridExtractionStrategyFactory(ItemGridExtractionStrategy::new); - PlatformApi.INSTANCE.addGridExtractionStrategyFactory(FluidGridExtractionStrategy::new); - } - - private void registerGridScrollingStrategyFactories() { - PlatformApi.INSTANCE.addGridScrollingStrategyFactory(ItemGridScrollingStrategy::new); - } - - private void registerImporterTransferStrategyFactories() { - PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().register( - createIdentifier("item"), - new FabricStorageImporterTransferStrategyFactory<>( - ItemStorage.SIDED, - VariantUtil::ofItemVariant, - resource -> resource instanceof ItemResource itemResource - ? VariantUtil.toItemVariant(itemResource) : null, - 1 - ) - ); - PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().register( - createIdentifier("fluid"), - new FabricStorageImporterTransferStrategyFactory<>( - FluidStorage.SIDED, - VariantUtil::ofFluidVariant, - resource -> resource instanceof FluidResource fluidResource - ? VariantUtil.toFluidVariant(fluidResource) : null, - FluidConstants.BUCKET - ) - ); - } - - private void registerExporterTransferStrategyFactories() { - PlatformApi.INSTANCE.getExporterTransferStrategyRegistry().register( - createIdentifier("item"), - new FabricStorageExporterTransferStrategyFactory<>( - ItemStorage.SIDED, - resource -> resource instanceof ItemResource itemResource - ? VariantUtil.toItemVariant(itemResource) : null, - 1 - ) - ); - PlatformApi.INSTANCE.getExporterTransferStrategyRegistry().register( - createIdentifier("fluid"), - new FabricStorageExporterTransferStrategyFactory<>( - FluidStorage.SIDED, - resource -> resource instanceof FluidResource fluidResource - ? VariantUtil.toFluidVariant(fluidResource) : null, - FluidConstants.BUCKET - ) - ); - } - - private void registerExternalStorageProviderFactories() { - PlatformApi.INSTANCE.addExternalStorageProviderFactory(new InterfacePlatformExternalStorageProviderFactory()); - PlatformApi.INSTANCE.addExternalStorageProviderFactory( - new FabricStoragePlatformExternalStorageProviderFactory<>( - ItemStorage.SIDED, - VariantUtil::ofItemVariant, - resource -> resource instanceof ItemResource itemResource - ? VariantUtil.toItemVariant(itemResource) : null - )); - PlatformApi.INSTANCE.addExternalStorageProviderFactory( - new FabricStoragePlatformExternalStorageProviderFactory<>( - FluidStorage.SIDED, - VariantUtil::ofFluidVariant, - resource -> resource instanceof FluidResource fluidResource - ? VariantUtil.toFluidVariant(fluidResource) : null - )); - } - - private void registerContent() { - registerBlocks( - new DirectRegistryCallback<>(BuiltInRegistries.BLOCK), - FabricDiskDriveBlockEntity::new, - (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.NORMAL, pos, state), - (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.CREATIVE, pos, state), - FabricDiskInterfaceBlockEntity::new - ); - final DirectRegistryCallback itemRegistryCallback = new DirectRegistryCallback<>(BuiltInRegistries.ITEM); - registerItems(itemRegistryCallback); - registerCustomItems(itemRegistryCallback); - registerUpgradeMappings(); - registerCreativeModeTab(); - registerBlockEntities( - new DirectRegistryCallback<>(BuiltInRegistries.BLOCK_ENTITY_TYPE), - new BlockEntityTypeFactory() { - @Override - public BlockEntityType create(final BlockEntitySupplier factory, - final Block... allowedBlocks) { - return new BlockEntityType<>(factory::create, new HashSet<>(Arrays.asList(allowedBlocks)), null); - } - }, - FabricDiskDriveBlockEntity::new, - (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.NORMAL, pos, state), - (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.CREATIVE, pos, state), - FabricDiskInterfaceBlockEntity::new - ); - registerMenus(new DirectRegistryCallback<>(BuiltInRegistries.MENU), new MenuTypeFactory() { - @Override - public MenuType create(final MenuSupplier supplier) { - return new MenuType<>(supplier::create, FeatureFlags.DEFAULT_FLAGS); - } - }, new ExtendedMenuTypeFactory() { - @Override - public MenuType create(final MenuSupplier supplier, - final StreamCodec - streamCodec) { - return new ExtendedScreenHandlerType<>(supplier::create, streamCodec); - } - }); - registerLootFunctions(new DirectRegistryCallback<>(BuiltInRegistries.LOOT_FUNCTION_TYPE)); - registerDataComponents(new DirectRegistryCallback<>(BuiltInRegistries.DATA_COMPONENT_TYPE)); - } - - private void registerCustomItems(final RegistryCallback callback) { - Items.INSTANCE.setRegulatorUpgrade(callback.register(REGULATOR_UPGRADE, () -> new RegulatorUpgradeItem( - PlatformApi.INSTANCE.getUpgradeRegistry() - ) { - @Override - public boolean allowComponentsUpdateAnimation(final Player player, - final InteractionHand hand, - final ItemStack oldStack, - final ItemStack newStack) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - })); - Items.INSTANCE.setWirelessGrid(callback.register(WIRELESS_GRID, () -> new WirelessGridItem() { - @Override - public boolean allowComponentsUpdateAnimation(final Player player, - final InteractionHand hand, - final ItemStack oldStack, - final ItemStack newStack) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - })); - Items.INSTANCE.setCreativeWirelessGrid(callback.register( - CREATIVE_WIRELESS_GRID, - () -> new WirelessGridItem() { - @Override - public boolean allowComponentsUpdateAnimation(final Player player, - final InteractionHand hand, - final ItemStack oldStack, - final ItemStack newStack) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - } - )); - Items.INSTANCE.setPortableGrid(callback.register(PORTABLE_GRID, () -> new PortableGridBlockItem( - Blocks.INSTANCE.getPortableGrid(), PortableGridType.NORMAL - ) { - @Override - public boolean allowComponentsUpdateAnimation(final Player player, - final InteractionHand hand, - final ItemStack oldStack, - final ItemStack newStack) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - })); - Items.INSTANCE.setCreativePortableGrid(callback.register( - CREATIVE_PORTABLE_GRID, - () -> new PortableGridBlockItem(Blocks.INSTANCE.getCreativePortableGrid(), PortableGridType.CREATIVE) { - @Override - public boolean allowComponentsUpdateAnimation(final Player player, - final InteractionHand hand, - final ItemStack oldStack, - final ItemStack newStack) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - } - )); - Items.INSTANCE.setSecurityCard(callback.register(SECURITY_CARD, () -> new SecurityCardItem() { - @Override - public boolean allowComponentsUpdateAnimation(final Player player, - final InteractionHand hand, - final ItemStack oldStack, - final ItemStack newStack) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - })); - Items.INSTANCE.setFallbackSecurityCard(callback.register( - FALLBACK_SECURITY_CARD, - () -> new FallbackSecurityCardItem() { - @Override - public boolean allowComponentsUpdateAnimation(final Player player, - final InteractionHand hand, - final ItemStack oldStack, - final ItemStack newStack) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - } - )); - } - - private void registerCreativeModeTab() { - Registry.register( - BuiltInRegistries.CREATIVE_MODE_TAB, - createIdentifier("general"), - CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0) - .title(ContentNames.MOD) - .icon(() -> new ItemStack(Blocks.INSTANCE.getCreativeController().getDefault())) - .displayItems((params, output) -> CreativeModeTabItems.append(output::accept)) - .build() - ); - } - - private void registerPackets() { - registerServerToClientPackets(); - registerClientToServerPackets(); - } - - private void registerServerToClientPackets() { - PayloadTypeRegistry.playS2C().register(EnergyInfoPacket.PACKET_TYPE, EnergyInfoPacket.STREAM_CODEC); - PayloadTypeRegistry.playS2C().register( - WirelessTransmitterRangePacket.PACKET_TYPE, - WirelessTransmitterRangePacket.STREAM_CODEC - ); - PayloadTypeRegistry.playS2C().register(GridActivePacket.PACKET_TYPE, GridActivePacket.STREAM_CODEC); - PayloadTypeRegistry.playS2C().register(GridClearPacket.PACKET_TYPE, GridClearPacket.STREAM_CODEC); - PayloadTypeRegistry.playS2C().register(GridUpdatePacket.PACKET_TYPE, GridUpdatePacket.STREAM_CODEC); - PayloadTypeRegistry.playS2C().register( - NetworkTransmitterStatusPacket.PACKET_TYPE, - NetworkTransmitterStatusPacket.STREAM_CODEC - ); - PayloadTypeRegistry.playS2C().register( - NoPermissionPacket.PACKET_TYPE, - NoPermissionPacket.STREAM_CODEC - ); - PayloadTypeRegistry.playS2C().register( - ResourceSlotUpdatePacket.PACKET_TYPE, - ResourceSlotUpdatePacket.STREAM_CODEC - ); - PayloadTypeRegistry.playS2C().register( - StorageInfoResponsePacket.PACKET_TYPE, - StorageInfoResponsePacket.STREAM_CODEC - ); - } - - private void registerClientToServerPackets() { - PayloadTypeRegistry.playC2S().register( - CraftingGridClearPacket.PACKET_TYPE, - CraftingGridClearPacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register( - CraftingGridRecipeTransferPacket.PACKET_TYPE, - CraftingGridRecipeTransferPacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register(GridExtractPacket.PACKET_TYPE, GridExtractPacket.STREAM_CODEC); - PayloadTypeRegistry.playC2S().register(GridInsertPacket.PACKET_TYPE, GridInsertPacket.STREAM_CODEC); - PayloadTypeRegistry.playC2S().register(GridScrollPacket.PACKET_TYPE, GridScrollPacket.STREAM_CODEC); - PayloadTypeRegistry.playC2S().register(PropertyChangePacket.PACKET_TYPE, PropertyChangePacket.STREAM_CODEC); - PayloadTypeRegistry.playC2S().register( - ResourceFilterSlotChangePacket.PACKET_TYPE, - ResourceFilterSlotChangePacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register( - ResourceSlotAmountChangePacket.PACKET_TYPE, - ResourceSlotAmountChangePacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register( - ResourceSlotChangePacket.PACKET_TYPE, - ResourceSlotChangePacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register( - SecurityCardBoundPlayerPacket.PACKET_TYPE, - SecurityCardBoundPlayerPacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register( - SecurityCardPermissionPacket.PACKET_TYPE, - SecurityCardPermissionPacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register( - SecurityCardResetPermissionPacket.PACKET_TYPE, - SecurityCardResetPermissionPacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register( - SingleAmountChangePacket.PACKET_TYPE, - SingleAmountChangePacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register( - StorageInfoRequestPacket.PACKET_TYPE, - StorageInfoRequestPacket.STREAM_CODEC - ); - PayloadTypeRegistry.playC2S().register( - UseSlotReferencedItemPacket.PACKET_TYPE, - UseSlotReferencedItemPacket.STREAM_CODEC - ); - } - - private void registerPacketHandlers() { - ServerPlayNetworking.registerGlobalReceiver( - StorageInfoRequestPacket.PACKET_TYPE, - wrapHandler(StorageInfoRequestPacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - GridInsertPacket.PACKET_TYPE, - wrapHandler(GridInsertPacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - GridExtractPacket.PACKET_TYPE, - wrapHandler(GridExtractPacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - GridScrollPacket.PACKET_TYPE, - wrapHandler(GridScrollPacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - CraftingGridClearPacket.PACKET_TYPE, - wrapHandler(CraftingGridClearPacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - CraftingGridRecipeTransferPacket.PACKET_TYPE, - wrapHandler(CraftingGridRecipeTransferPacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - PropertyChangePacket.PACKET_TYPE, - wrapHandler(PropertyChangePacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - ResourceSlotAmountChangePacket.PACKET_TYPE, - wrapHandler(ResourceSlotAmountChangePacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - ResourceFilterSlotChangePacket.PACKET_TYPE, - wrapHandler(ResourceFilterSlotChangePacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - ResourceSlotChangePacket.PACKET_TYPE, - wrapHandler(ResourceSlotChangePacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - SingleAmountChangePacket.PACKET_TYPE, - wrapHandler(SingleAmountChangePacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - UseSlotReferencedItemPacket.PACKET_TYPE, - wrapHandler(UseSlotReferencedItemPacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - SecurityCardPermissionPacket.PACKET_TYPE, - wrapHandler(SecurityCardPermissionPacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - SecurityCardResetPermissionPacket.PACKET_TYPE, - wrapHandler(SecurityCardResetPermissionPacket::handle) - ); - ServerPlayNetworking.registerGlobalReceiver( - SecurityCardBoundPlayerPacket.PACKET_TYPE, - wrapHandler(SecurityCardBoundPlayerPacket::handle) - ); - } - - private static ServerPlayNetworking.PlayPayloadHandler wrapHandler( - final PacketHandler handler - ) { - return (packet, ctx) -> handler.handle(packet, ctx::player); - } - - private void registerSidedHandlers() { - registerItemStorage( - AbstractDiskDriveBlockEntity.class::isInstance, - AbstractDiskDriveBlockEntity.class::cast, - AbstractDiskDriveBlockEntity::getDiskInventory, - BlockEntities.INSTANCE.getDiskDrive() - ); - registerItemStorage( - InterfaceBlockEntity.class::isInstance, - InterfaceBlockEntity.class::cast, - InterfaceBlockEntity::getExportedResourcesAsContainer, - BlockEntities.INSTANCE.getInterface() - ); - ItemStorage.SIDED.registerForBlockEntity((blockEntity, context) -> { - final InventoryStorage storage = InventoryStorage.of(blockEntity.getDiskInventory(), context); - final List> parts = new ArrayList<>(); - for (int i = 0; i < AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS; ++i) { - final var slot = storage.getSlot(i); - parts.add(i < 3 ? FilteringStorage.insertOnlyOf(slot) : FilteringStorage.extractOnlyOf(slot)); - } - return new CombinedStorage<>(parts); - }, BlockEntities.INSTANCE.getDiskInterface()); - FluidStorage.SIDED.registerForBlockEntity( - (blockEntity, context) -> new ResourceContainerFluidStorageAdapter(blockEntity.getExportedResources()), - BlockEntities.INSTANCE.getInterface() - ); - registerEnergyBlockEntityProviders(); - registerEnergyItemProviders(); - } - - private void registerItemStorage(final Predicate test, - final Function caster, - final Function containerSupplier, - final BlockEntityType type) { - ItemStorage.SIDED.registerForBlockEntities((blockEntity, context) -> { - if (test.test(blockEntity)) { - final T casted = caster.apply(blockEntity); - return InventoryStorage.of(containerSupplier.apply(casted), context); - } - return null; - }, type); - } - - private void registerEnergyBlockEntityProviders() { - EnergyStorage.SIDED.registerForBlockEntity( - (blockEntity, context) -> new EnergyStorageAdapter(blockEntity.getEnergyStorage()), - BlockEntities.INSTANCE.getController() - ); - EnergyStorage.SIDED.registerForBlockEntity( - (blockEntity, context) -> new EnergyStorageAdapter(blockEntity.getEnergyStorage()), - BlockEntities.INSTANCE.getPortableGrid() - ); - } - - private void registerEnergyItemProviders() { - EnergyStorage.ITEM.registerForItems( - (stack, context) -> new EnergyStorageAdapter(Items.INSTANCE.getWirelessGrid().createEnergyStorage(stack)), - Items.INSTANCE.getWirelessGrid() - ); - Items.INSTANCE.getControllers().forEach(controller -> EnergyStorage.ITEM.registerForItems( - (stack, context) -> new EnergyStorageAdapter(controller.get().createEnergyStorage(stack)), - controller.get() - )); - EnergyStorage.ITEM.registerForItems( - (stack, context) -> new EnergyStorageAdapter(PortableGridBlockItem.createEnergyStorage(stack)), - Items.INSTANCE.getPortableGrid() - ); - } - - private void registerTickHandler() { - ServerTickEvents.START_SERVER_TICK.register(server -> ServerEventQueue.runQueuedActions()); - } - - private void registerWrenchingEvent() { - UseBlockCallback.EVENT.register((player, level, hand, hitResult) -> { - final BlockState state = level.getBlockState(hitResult.getBlockPos()); - if (!(state.getBlock() instanceof AbstractBaseBlock block)) { - return InteractionResult.PASS; - } - return block.tryUseWrench(state, level, hitResult, player, hand) - .or(() -> block.tryUpdateColor(state, level, hitResult.getBlockPos(), player, hand)) - .orElse(InteractionResult.PASS); - }); - } - - private void registerSecurityBlockBreakEvent() { - PlayerBlockBreakEvents.BEFORE.register(new NetworkNodeBreakSecurityEventListener()); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/PlatformImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/PlatformImpl.java deleted file mode 100644 index a867c2e0a..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/PlatformImpl.java +++ /dev/null @@ -1,369 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.platform.common.AbstractPlatform; -import com.refinedmods.refinedstorage.platform.common.Config; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.TransferManager; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.util.CustomBlockPlaceContext; -import com.refinedmods.refinedstorage.platform.fabric.grid.strategy.ItemGridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.fabric.grid.view.FabricFluidGridResourceFactory; -import com.refinedmods.refinedstorage.platform.fabric.grid.view.FabricItemGridResourceFactory; -import com.refinedmods.refinedstorage.platform.fabric.mixin.EditBoxAccessor; -import com.refinedmods.refinedstorage.platform.fabric.mixin.KeyMappingAccessor; -import com.refinedmods.refinedstorage.platform.fabric.support.containermenu.ContainerTransferDestination; -import com.refinedmods.refinedstorage.platform.fabric.support.containermenu.MenuOpenerImpl; -import com.refinedmods.refinedstorage.platform.fabric.support.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage.platform.fabric.support.render.FluidVariantFluidRenderer; -import com.refinedmods.refinedstorage.platform.fabric.util.SimpleSingleStackStorage; - -import java.util.List; -import java.util.Optional; -import java.util.UUID; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -import com.mojang.blaze3d.platform.InputConstants; -import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; -import net.fabricmc.fabric.api.entity.FakePlayer; -import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; -import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; -import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; -import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; -import net.fabricmc.fabric.api.transfer.v1.storage.Storage; -import net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil; -import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; -import net.fabricmc.fabric.impl.transfer.context.ConstantContainerItemContext; -import net.minecraft.client.KeyMapping; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.components.EditBox; -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.client.gui.screens.inventory.tooltip.DefaultTooltipPositioner; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.NonNullList; -import net.minecraft.network.chat.Component; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.sounds.SoundEvent; -import net.minecraft.sounds.SoundEvents; -import net.minecraft.sounds.SoundSource; -import net.minecraft.tags.FluidTags; -import net.minecraft.world.Container; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.CraftingContainer; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.context.BlockPlaceContext; -import net.minecraft.world.item.crafting.CraftingInput; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.LevelReader; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.LiquidBlock; -import net.minecraft.world.level.block.LiquidBlockContainer; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.gameevent.GameEvent; -import net.minecraft.world.level.material.FlowingFluid; -import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.level.material.Fluids; -import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.Vec3; - -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.ofFluidVariant; -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.toFluidVariant; -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.toItemVariant; - -public final class PlatformImpl extends AbstractPlatform { - public PlatformImpl() { - super(new MenuOpenerImpl(), new FluidVariantFluidRenderer(), ItemGridInsertionStrategy::new); - } - - @Override - public long getBucketAmount() { - return FluidConstants.BUCKET; - } - - @Override - public Config getConfig() { - return ConfigImpl.get(); - } - - @Override - public boolean canEditBoxLoseFocus(final EditBox editBox) { - return ((EditBoxAccessor) editBox).getCanLoseFocus(); - } - - @Override - public boolean isKeyDown(final KeyMapping keyMapping) { - return !keyMapping.isUnbound() && InputConstants.isKeyDown( - Minecraft.getInstance().getWindow().getWindow(), - ((KeyMappingAccessor) keyMapping).getKey().getValue() - ); - } - - @Override - public GridResourceFactory getItemGridResourceFactory() { - return new FabricItemGridResourceFactory(); - } - - @Override - public GridResourceFactory getFluidGridResourceFactory() { - return new FabricFluidGridResourceFactory(); - } - - @Override - public Optional getContainedFluid(final ItemStack stack) { - if (stack.isEmpty()) { - return Optional.empty(); - } - final SimpleSingleStackStorage interceptingStorage = new SimpleSingleStackStorage(stack); - final Storage storage = FluidStorage.ITEM.find(stack, ContainerItemContext.ofSingleSlot( - interceptingStorage - )); - try (Transaction tx = Transaction.openOuter()) { - final var extracted = StorageUtil.extractAny(storage, Long.MAX_VALUE, tx); - if (extracted == null) { - return Optional.empty(); - } - return Optional.of(new ContainedFluid( - interceptingStorage.getStack(), - ofFluidVariant(extracted.resource()), - extracted.amount() - )); - } - } - - @Override - public Optional convertToBucket(final FluidResource fluidResource) { - final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); - final Storage destination = FluidStorage.ITEM.find( - interceptingStorage.getStack(), - ContainerItemContext.ofSingleSlot(interceptingStorage) - ); - if (destination == null) { - return Optional.empty(); - } - try (Transaction tx = Transaction.openOuter()) { - destination.insert(toFluidVariant(fluidResource), FluidConstants.BUCKET, tx); - return Optional.of(interceptingStorage.getStack()); - } - } - - @Override - public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) { - return new TransferManager(containerMenu, ContainerTransferDestination::new); - } - - @Override - public long insertIntoContainer(final Container container, - final ItemResource itemResource, - final long amount, - final Action action) { - try (Transaction tx = Transaction.openOuter()) { - final long inserted = InventoryStorage - .of(container, null) - .insert(toItemVariant(itemResource), amount, tx); - if (action == Action.EXECUTE) { - tx.commit(); - } - return inserted; - } - } - - @Override - public ItemStack getCloneItemStack(final BlockState state, - final Level level, - final BlockHitResult hitResult, - final Player player) { - return state.getBlock().getCloneItemStack(level, hitResult.getBlockPos(), state); - } - - - @Override - public NonNullList getRemainingCraftingItems(final Player player, - final CraftingRecipe craftingRecipe, - final CraftingInput input) { - return craftingRecipe.getRemainingItems(input); - } - - @Override - public void onItemCrafted(final Player player, final ItemStack craftedStack, final CraftingContainer container) { - // no op - } - - @Override - public Player getFakePlayer(final ServerLevel level, @Nullable final UUID playerId) { - return Optional.ofNullable(playerId) - .flatMap(id -> level.getServer().getProfileCache().get(id)) - .map(profile -> FakePlayer.get(level, profile)) - .orElseGet(() -> FakePlayer.get(level)); - } - - @Override - public boolean canBreakBlock(final Level level, final BlockPos pos, final BlockState state, final Player player) { - return PlayerBlockBreakEvents.BEFORE.invoker().beforeBlockBreak( - level, - player, - pos, - state, - level.getBlockEntity(pos) - ); - } - - @Override - public boolean placeBlock( - final Level level, - final BlockPos pos, - final Direction direction, - final Player player, - final ItemStack stack - ) { - final BlockPlaceContext ctx = new CustomBlockPlaceContext( - level, - player, - InteractionHand.MAIN_HAND, - stack, - new BlockHitResult(Vec3.ZERO, direction, pos, false) - ); - final InteractionResult result = stack.useOn(ctx); - return result.consumesAction(); - } - - @Override - public boolean placeFluid( - final Level level, - final BlockPos pos, - final Direction direction, - final Player player, - final FluidResource fluidResource - ) { - // Stolen from BucketItem#emptyContents - final Fluid content = fluidResource.fluid(); - if (!(content instanceof FlowingFluid)) { - return false; - } - final BlockState blockState = level.getBlockState(pos); - final Block block = blockState.getBlock(); - final boolean replaceable = blockState.canBeReplaced(content); - final boolean canPlace = blockState.isAir() - || replaceable - || (block instanceof LiquidBlockContainer lbc - && lbc.canPlaceLiquid(player, level, pos, blockState, content)); - if (!canPlace || blockState.getFluidState().isSource()) { - return false; - } else if (block instanceof LiquidBlockContainer lbc && content == Fluids.WATER) { - lbc.placeLiquid(level, pos, blockState, ((FlowingFluid) content).getSource(false)); - playEmptySound(content, player, level, pos); - return true; - } - return doPlaceFluid(level, pos, player, content, blockState, replaceable); - } - - @SuppressWarnings("deprecation") - private boolean doPlaceFluid(final Level level, - final BlockPos pos, - final Player player, - final Fluid content, - final BlockState blockState, - final boolean replaceable) { - if (replaceable && !blockState.liquid()) { - level.destroyBlock(pos, true); - } - if (!level.setBlock(pos, content.defaultFluidState().createLegacyBlock(), 11) - && !blockState.getFluidState().isSource()) { - return false; - } - playEmptySound(content, player, level, pos); - return true; - } - - @SuppressWarnings("deprecation") - private void playEmptySound(final Fluid content, final Player player, final LevelAccessor level, - final BlockPos pos) { - final SoundEvent soundEvent = content.is(FluidTags.LAVA) - ? SoundEvents.BUCKET_EMPTY_LAVA - : SoundEvents.BUCKET_EMPTY; - level.playSound(player, pos, soundEvent, SoundSource.BLOCKS, 1.0F, 1.0F); - level.gameEvent(player, GameEvent.FLUID_PLACE, pos); - } - - @Override - public ItemStack getBlockAsItemStack(final Block block, - final BlockState state, - final Direction direction, - final LevelReader level, - final BlockPos position, - final Player player) { - return block.getCloneItemStack(level, position, state); - } - - @Override - public Optional getBucketPickupSound(final LiquidBlock liquidBlock, final BlockState state) { - return liquidBlock.getPickupSound(); - } - - @Override - public List processTooltipComponents(final ItemStack stack, - final GuiGraphics graphics, - final int mouseX, - final Optional imageComponent, - final List components) { - final List processedComponents = components - .stream() - .map(Component::getVisualOrderText) - .map(ClientTooltipComponent::create) - .collect(Collectors.toList()); - imageComponent.ifPresent(image -> processedComponents.add(1, ClientTooltipComponent.create(image))); - return processedComponents; - } - - @Override - public void renderTooltip(final GuiGraphics graphics, - final List components, - final int x, - final int y) { - graphics.renderTooltipInternal( - Minecraft.getInstance().font, - components, - x, - y, - DefaultTooltipPositioner.INSTANCE - ); - } - - @Override - public Optional getEnergyStorage(final ItemStack stack) { - final ConstantContainerItemContext ctx = new ConstantContainerItemContext( - ItemVariant.of(stack), - stack.getCount() - ); - return Optional.ofNullable(team.reborn.energy.api.EnergyStorage.ITEM.find(stack, ctx)) - .filter(EnergyStorageAdapter.class::isInstance) - .map(EnergyStorageAdapter.class::cast) - .map(EnergyStorageAdapter::getEnergyStorage); - } - - @Override - public void sendPacketToServer(final T packet) { - ClientPlayNetworking.send(packet); - } - - @Override - public void sendPacketToClient(final ServerPlayer player, final T packet) { - ServerPlayNetworking.send(player, packet); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/exporter/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/exporter/package-info.java deleted file mode 100644 index 4c99249a9..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/exporter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.exporter; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/FluidGridExtractionStrategy.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/FluidGridExtractionStrategy.java deleted file mode 100644 index 4bc97ff42..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/FluidGridExtractionStrategy.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; -import com.refinedmods.refinedstorage.platform.fabric.util.SimpleSingleStackStorage; - -import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; -import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.Items; - -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.toFluidVariant; - -public class FluidGridExtractionStrategy implements GridExtractionStrategy { - private static final ItemVariant BUCKET_ITEM_VARIANT = ItemVariant.of(Items.BUCKET); - private static final ItemResource BUCKET_ITEM_RESOURCE = new ItemResource(Items.BUCKET); - - private final GridOperations gridOperations; - private final PlayerInventoryStorage playerInventoryStorage; - private final net.fabricmc.fabric.api.transfer.v1.storage.Storage playerCursorStorage; - private final Storage itemStorage; - - public FluidGridExtractionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - this.gridOperations = grid.createOperations(ResourceTypes.FLUID, player); - this.playerInventoryStorage = PlayerInventoryStorage.of(player.getInventory()); - this.playerCursorStorage = PlayerInventoryStorage.getCursorStorage(containerMenu); - this.itemStorage = grid.getItemStorage(); - } - - @Override - public boolean onExtract(final PlatformResourceKey resource, - final GridExtractMode extractMode, - final boolean cursor) { - if (resource instanceof FluidResource fluidResource) { - final boolean bucketInInventory = hasBucketInInventory(); - final boolean bucketInStorageChannel = hasBucketInStorage(); - if (bucketInInventory) { - extractWithBucketInInventory(fluidResource, extractMode, cursor); - } else if (bucketInStorageChannel) { - extractWithBucketInStorage(fluidResource, extractMode, cursor); - } - return true; - } - return false; - } - - private void extractWithBucketInStorage(final FluidResource fluidResource, - final GridExtractMode mode, - final boolean cursor) { - final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); - final net.fabricmc.fabric.api.transfer.v1.storage.Storage destination = FluidStorage.ITEM.find( - interceptingStorage.getStack(), - ContainerItemContext.ofSingleSlot(interceptingStorage) - ); - if (destination == null) { - return; - } - gridOperations.extract(fluidResource, mode, (resource, amount, action, source) -> { - if (!(resource instanceof FluidResource fluidResource2)) { - return 0; - } - try (Transaction tx = Transaction.openOuter()) { - final long inserted = destination.insert(toFluidVariant(fluidResource2), amount, tx); - final boolean couldInsertBucket = insertResultingBucketIntoInventory(interceptingStorage, cursor, tx); - if (!couldInsertBucket) { - return 0; - } - if (action == Action.EXECUTE) { - itemStorage.extract(BUCKET_ITEM_RESOURCE, 1, Action.EXECUTE, source); - tx.commit(); - } - return inserted; - } - }); - } - - private void extractWithBucketInInventory(final FluidResource fluidResource, - final GridExtractMode mode, - final boolean cursor) { - try (Transaction tx = Transaction.openOuter()) { - playerInventoryStorage.extract(BUCKET_ITEM_VARIANT, 1, tx); - final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); - final net.fabricmc.fabric.api.transfer.v1.storage.Storage dest = FluidStorage.ITEM.find( - interceptingStorage.getStack(), - ContainerItemContext.ofSingleSlot(interceptingStorage) - ); - if (dest == null) { - return; - } - gridOperations.extract(fluidResource, mode, (resource, amount, action, source) -> { - if (!(resource instanceof FluidResource fluidResource2)) { - return 0; - } - try (Transaction innerTx = tx.openNested()) { - final long inserted = dest.insert(toFluidVariant(fluidResource2), amount, innerTx); - final boolean couldInsertBucket = insertResultingBucketIntoInventory( - interceptingStorage, - cursor, - innerTx - ); - if (!couldInsertBucket) { - return 0; - } - if (action == Action.EXECUTE) { - innerTx.commit(); - tx.commit(); - } - return inserted; - } - }); - } - } - - private boolean insertResultingBucketIntoInventory(final SimpleSingleStackStorage interceptingStorage, - final boolean cursor, - final Transaction innerTx) { - final net.fabricmc.fabric.api.transfer.v1.storage.Storage relevantStorage = cursor - ? playerCursorStorage - : playerInventoryStorage; - final ItemVariant itemVariant = ItemVariant.of(interceptingStorage.getStack()); - return relevantStorage.insert(itemVariant, 1, innerTx) != 0; - } - - private boolean hasBucketInInventory() { - try (Transaction tx = Transaction.openOuter()) { - return playerInventoryStorage.extract(BUCKET_ITEM_VARIANT, 1, tx) == 1; - } - } - - private boolean hasBucketInStorage() { - return itemStorage.extract(BUCKET_ITEM_RESOURCE, 1, Action.SIMULATE, EmptyActor.INSTANCE) == 1; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/FluidGridInsertionStrategy.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/FluidGridInsertionStrategy.java deleted file mode 100644 index bdf9c18b4..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/FluidGridInsertionStrategy.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; - -import javax.annotation.Nullable; - -import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; -import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.storage.Storage; -import net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil; -import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; -import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; - -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.ofFluidVariant; -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.toFluidVariant; - -public class FluidGridInsertionStrategy implements GridInsertionStrategy { - private final AbstractContainerMenu containerMenu; - private final GridOperations gridOperations; - private final Player player; - private final PlayerInventoryStorage playerInventoryStorage; - - public FluidGridInsertionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - this.containerMenu = containerMenu; - this.gridOperations = grid.createOperations(ResourceTypes.FLUID, player); - this.player = player; - this.playerInventoryStorage = PlayerInventoryStorage.of(player.getInventory()); - } - - @Override - public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { - final Storage cursorStorage = getFluidCursorStorage(); - if (cursorStorage == null) { - return false; - } - final FluidVariant extractableResource = StorageUtil.findExtractableResource(cursorStorage, null); - if (extractableResource == null) { - return false; - } - final FluidResource fluidResource = ofFluidVariant(extractableResource); - gridOperations.insert(fluidResource, insertMode, (resource, amount, action, source) -> { - if (!(resource instanceof FluidResource fluidResource2)) { - return 0; - } - final FluidVariant fluidVariant = toFluidVariant(fluidResource2); - try (Transaction tx = Transaction.openOuter()) { - final long extracted = cursorStorage.extract(fluidVariant, amount, tx); - if (action == Action.EXECUTE) { - tx.commit(); - } - return extracted; - } - }); - return true; - } - - @Nullable - private Storage getFluidCursorStorage() { - return FluidStorage.ITEM.find( - containerMenu.getCarried(), - ContainerItemContext.ofPlayerCursor(player, containerMenu) - ); - } - - @Override - public boolean onTransfer(final int slotIndex) { - final SingleSlotStorage itemSlotStorage = playerInventoryStorage.getSlot(slotIndex); - if (itemSlotStorage == null) { - return false; - } - final Storage fluidSlotStorage = FluidStorage.ITEM.find( - itemSlotStorage.getResource().toStack(), - ContainerItemContext.ofPlayerSlot(player, itemSlotStorage) - ); - if (fluidSlotStorage == null) { - return false; - } - final FluidVariant extractableResource = StorageUtil.findExtractableResource(fluidSlotStorage, null); - if (extractableResource == null) { - return false; - } - final FluidResource fluidResource = ofFluidVariant(extractableResource); - gridOperations.insert(fluidResource, GridInsertMode.ENTIRE_RESOURCE, (resource, amount, action, source) -> { - if (!(resource instanceof FluidResource fluidResource2)) { - return 0; - } - final FluidVariant fluidVariant = toFluidVariant(fluidResource2); - try (Transaction tx = Transaction.openOuter()) { - final long extracted = fluidSlotStorage.extract(fluidVariant, amount, tx); - if (action == Action.EXECUTE) { - tx.commit(); - } - return extracted; - } - }); - return true; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/ItemGridExtractionStrategy.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/ItemGridExtractionStrategy.java deleted file mode 100644 index 68e4d19e2..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/ItemGridExtractionStrategy.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; - -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; -import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.storage.Storage; -import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; -import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; - -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.toItemVariant; - -public class ItemGridExtractionStrategy implements GridExtractionStrategy { - private final GridOperations gridOperations; - private final PlayerInventoryStorage playerInventoryStorage; - private final SingleSlotStorage playerCursorStorage; - - public ItemGridExtractionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); - this.playerInventoryStorage = PlayerInventoryStorage.of(player.getInventory()); - this.playerCursorStorage = PlayerInventoryStorage.getCursorStorage(containerMenu); - } - - @Override - public boolean onExtract(final PlatformResourceKey resource, - final GridExtractMode extractMode, - final boolean cursor) { - if (resource instanceof ItemResource itemResource) { - gridOperations.extract(itemResource, extractMode, (r, amount, action, source) -> { - if (!(r instanceof ItemResource itemResource2)) { - return 0; - } - final ItemVariant itemVariant = toItemVariant(itemResource2); - try (Transaction tx = Transaction.openOuter()) { - final long inserted = insert(itemVariant, amount, tx, cursor); - if (action == Action.EXECUTE) { - tx.commit(); - } - return inserted; - } - }); - return true; - } - return false; - } - - private long insert(final ItemVariant itemVariant, final long amount, final Transaction tx, final boolean cursor) { - final Storage relevantStorage = cursor ? playerCursorStorage : playerInventoryStorage; - return relevantStorage.insert(itemVariant, amount, tx); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/ItemGridInsertionStrategy.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/ItemGridInsertionStrategy.java deleted file mode 100644 index 27e130588..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/ItemGridInsertionStrategy.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; - -import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; -import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil; -import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; -import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; - -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.ofItemVariant; -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.toItemVariant; - -public class ItemGridInsertionStrategy implements GridInsertionStrategy { - private final AbstractContainerMenu containerMenu; - private final GridOperations gridOperations; - private final SingleSlotStorage playerCursorStorage; - - public ItemGridInsertionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - this.containerMenu = containerMenu; - this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); - this.playerCursorStorage = PlayerInventoryStorage.getCursorStorage(containerMenu); - } - - @Override - public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { - final ItemStack carried = containerMenu.getCarried(); - if (carried.isEmpty()) { - return false; - } - final ItemResource itemResource = ItemResource.ofItemStack(carried); - gridOperations.insert(itemResource, insertMode, (resource, amount, action, source) -> { - if (!(resource instanceof ItemResource itemResource2)) { - return 0; - } - try (Transaction tx = Transaction.openOuter()) { - final ItemVariant itemVariant = toItemVariant(itemResource2); - final long extracted = playerCursorStorage.extract(itemVariant, amount, tx); - if (action == Action.EXECUTE) { - tx.commit(); - } - return extracted; - } - }); - return true; - } - - @Override - public boolean onTransfer(final int slotIndex) { - final Slot slot = containerMenu.getSlot(slotIndex); - final InventoryStorage inventoryStorage = InventoryStorage.of(slot.container, null); - final SingleSlotStorage storage = inventoryStorage.getSlot(slot.getContainerSlot()); - final ItemVariant itemVariantInSlot = StorageUtil.findExtractableResource(storage, null); - if (itemVariantInSlot == null) { - return false; - } - final ItemResource itemResource = ofItemVariant(itemVariantInSlot); - gridOperations.insert(itemResource, GridInsertMode.ENTIRE_RESOURCE, (resource, amount, action, source) -> { - if (!(resource instanceof ItemResource itemResource2)) { - return 0; - } - try (Transaction tx = Transaction.openOuter()) { - final ItemVariant itemVariant = toItemVariant(itemResource2); - final long extracted = storage.extract(itemVariant, amount, tx); - if (action == Action.EXECUTE) { - tx.commit(); - } - return extracted; - } - }); - return true; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/ItemGridScrollingStrategy.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/ItemGridScrollingStrategy.java deleted file mode 100644 index f59b5c80e..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/ItemGridScrollingStrategy.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; - -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; -import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.storage.Storage; -import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; -import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; - -import static com.refinedmods.refinedstorage.platform.fabric.support.resource.VariantUtil.toItemVariant; - -public class ItemGridScrollingStrategy implements GridScrollingStrategy { - private final GridOperations gridOperations; - private final PlayerInventoryStorage playerInventoryStorage; - private final SingleSlotStorage playerCursorStorage; - - public ItemGridScrollingStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); - this.playerInventoryStorage = PlayerInventoryStorage.of(player.getInventory()); - this.playerCursorStorage = PlayerInventoryStorage.getCursorStorage(containerMenu); - } - - @Override - public boolean onScroll(final PlatformResourceKey resource, final GridScrollMode scrollMode, final int slotIndex) { - if (resource instanceof ItemResource itemResource) { - final Storage playerStorage = slotIndex >= 0 - ? playerInventoryStorage.getSlot(slotIndex) - : playerInventoryStorage; - switch (scrollMode) { - case GRID_TO_INVENTORY -> handleGridToInventoryScroll(itemResource, playerStorage); - case INVENTORY_TO_GRID -> handleInventoryToGridScroll(itemResource, playerStorage); - case GRID_TO_CURSOR -> handleGridToInventoryScroll(itemResource, playerCursorStorage); - } - return true; - } - return false; - } - - private void handleInventoryToGridScroll(final ItemResource itemResource, - final Storage sourceStorage) { - gridOperations.insert(itemResource, GridInsertMode.SINGLE_RESOURCE, (resource, amount, action, source) -> { - if (!(resource instanceof ItemResource itemResource2)) { - return 0; - } - try (Transaction tx = Transaction.openOuter()) { - final ItemVariant itemVariant = toItemVariant(itemResource2); - final long extracted = sourceStorage.extract(itemVariant, amount, tx); - if (action == Action.EXECUTE) { - tx.commit(); - } - return extracted; - } - }); - } - - private void handleGridToInventoryScroll(final ItemResource itemResource, - final Storage destinationStorage) { - gridOperations.extract(itemResource, GridExtractMode.SINGLE_RESOURCE, (resource, amount, action, source) -> { - if (!(resource instanceof ItemResource itemResource2)) { - return 0; - } - final ItemVariant itemVariant = toItemVariant(itemResource2); - try (Transaction tx = Transaction.openOuter()) { - final long inserted = destinationStorage.insert(itemVariant, amount, tx); - if (action == Action.EXECUTE) { - tx.commit(); - } - return inserted; - } - }); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/package-info.java deleted file mode 100644 index a9269ac18..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/strategy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/view/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/view/package-info.java deleted file mode 100644 index 7f1778746..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/grid/view/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.grid.view; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/importer/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/importer/package-info.java deleted file mode 100644 index a38cc6870..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/importer/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.importer; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/package-info.java deleted file mode 100644 index 515cc2dd4..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/mixin/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.mixin; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/modmenu/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/modmenu/package-info.java deleted file mode 100644 index 6f7aff03b..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/modmenu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.modmenu; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/package-info.java deleted file mode 100644 index f9ffc5d33..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/security/NetworkNodeBreakSecurityEventListener.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/security/NetworkNodeBreakSecurityEventListener.java deleted file mode 100644 index 3b51cdff8..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/security/NetworkNodeBreakSecurityEventListener.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.security; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.network.NetworkNodeContainerBlockEntity; - -import javax.annotation.Nullable; - -import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; -import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -public class NetworkNodeBreakSecurityEventListener implements PlayerBlockBreakEvents.Before { - @Override - public boolean beforeBlockBreak(final Level world, - final Player player, - final BlockPos pos, - final BlockState state, - @Nullable final BlockEntity blockEntity) { - if (blockEntity instanceof NetworkNodeContainerBlockEntity networkNodeContainerBlockEntity - && player instanceof ServerPlayer serverPlayer - && !networkNodeContainerBlockEntity.canBuild(serverPlayer)) { - PlatformApi.INSTANCE.sendNoPermissionMessage( - serverPlayer, - createTranslation("misc", "no_permission.build.break", state.getBlock().getName()) - ); - return false; - } - return true; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/security/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/security/package-info.java deleted file mode 100644 index 3cd0fc46c..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/security/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.security; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java deleted file mode 100644 index 27d1dfa92..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.diskdrive; - -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.DiskDriveBlock; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.fabric.storage.AbstractDiskContainerBakedModel; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadRotators; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadTranslator; - -import java.util.Map; -import java.util.function.Supplier; - -import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; -import net.minecraft.client.resources.model.BakedModel; -import net.minecraft.core.BlockPos; -import net.minecraft.util.RandomSource; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.BlockAndTintGetter; -import net.minecraft.world.level.block.state.BlockState; - -class DiskDriveBakedModel extends AbstractDiskContainerBakedModel { - private final QuadRotators quadRotators; - - DiskDriveBakedModel(final BakedModel baseModel, - final Map diskModels, - final BakedModel inactiveLedModel, - final QuadRotators quadRotators) { - super(diskModels, inactiveLedModel, getDiskTranslations()); - this.wrapped = baseModel; - this.quadRotators = quadRotators; - } - - private static QuadTranslator[] getDiskTranslations() { - final QuadTranslator[] translations = new QuadTranslator[8]; - int i = 0; - for (int y = 0; y < 4; ++y) { - for (int x = 0; x < 2; ++x) { - translations[i++] = new QuadTranslator( - x == 0 ? -(2F / 16F) : -(9F / 16F), - -((y * 3F) / 16F) - (2F / 16F), - 0 - ); - } - } - return translations; - } - - @Override - public void emitItemQuads(final ItemStack stack, - final Supplier randomSupplier, - final RenderContext context) { - wrapped.emitItemQuads(stack, randomSupplier, context); - super.emitItemQuads(stack, randomSupplier, context); - } - - @Override - public void emitBlockQuads(final BlockAndTintGetter blockView, - final BlockState state, - final BlockPos pos, - final Supplier randomSupplier, - final RenderContext context) { - if (!(state.getBlock() instanceof DiskDriveBlock diskDriveBlock)) { - return; - } - final BiDirection direction = diskDriveBlock.getDirection(state); - if (direction == null) { - return; - } - context.pushTransform(quadRotators.forDirection(direction)); - wrapped.emitBlockQuads(blockView, state, pos, randomSupplier, context); - super.emitBlockQuads(blockView, state, pos, randomSupplier, context); - context.popTransform(); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java deleted file mode 100644 index 299cf29d7..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.diskdrive; - -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntityRenderer; -import com.refinedmods.refinedstorage.platform.fabric.support.render.RenderTypes; - -public class DiskDriveBlockEntityRendererImpl - extends AbstractDiskDriveBlockEntityRenderer { - public DiskDriveBlockEntityRendererImpl() { - super(RenderTypes.DISK_LED); - } - - @Override - protected Disk[] getDisks(final AbstractDiskDriveBlockEntity blockEntity) { - if (!(blockEntity instanceof FabricDiskDriveBlockEntity fabricBlockEntity)) { - return null; - } - if (fabricBlockEntity.getRenderData() instanceof Disk[] disks) { - return disks; - } - return null; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/FabricDiskDriveBlockEntity.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/FabricDiskDriveBlockEntity.java deleted file mode 100644 index a47217bad..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/FabricDiskDriveBlockEntity.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.diskdrive; - -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.state.BlockState; - -public class FabricDiskDriveBlockEntity extends AbstractDiskDriveBlockEntity { - public FabricDiskDriveBlockEntity(final BlockPos pos, final BlockState state) { - super(pos, state); - } - - @Override - @Nullable - public Object getRenderData() { - return disks; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/package-info.java deleted file mode 100644 index 0563688e5..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskdrive/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.storage.diskdrive; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/DiskInterfaceBakedModel.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/DiskInterfaceBakedModel.java deleted file mode 100644 index 2d00a3bf3..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/DiskInterfaceBakedModel.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.diskinterface; - -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.DiskInterfaceBlock; -import com.refinedmods.refinedstorage.platform.common.support.AbstractActiveColoredDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.fabric.storage.AbstractDiskContainerBakedModel; -import com.refinedmods.refinedstorage.platform.fabric.support.render.EmissiveTransform; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadRotators; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadTranslator; - -import java.util.Map; -import java.util.Set; -import java.util.function.Supplier; - -import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; -import net.minecraft.client.resources.model.BakedModel; -import net.minecraft.core.BlockPos; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.RandomSource; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.BlockAndTintGetter; -import net.minecraft.world.level.block.state.BlockState; - -class DiskInterfaceBakedModel extends AbstractDiskContainerBakedModel { - private final BakedModel inactiveModel; - private final QuadRotators quadRotators; - private final EmissiveTransform emissiveTransform; - - DiskInterfaceBakedModel(final BakedModel baseModel, - final BakedModel inactiveModel, - final Map diskModels, - final BakedModel inactiveLedModel, - final QuadRotators quadRotators, - final ResourceLocation emissiveSprite) { - super(diskModels, inactiveLedModel, getDiskTranslations()); - this.wrapped = baseModel; - this.inactiveModel = inactiveModel; - this.quadRotators = quadRotators; - this.emissiveTransform = new EmissiveTransform(Set.of(emissiveSprite)); - } - - private static QuadTranslator[] getDiskTranslations() { - final QuadTranslator[] translations = new QuadTranslator[6]; - for (int i = 0; i < translations.length; ++i) { - final int x = i < 3 ? 0 : 1; - final int y = i % 3; - translations[i] = new QuadTranslator( - x == 0 ? -(2F / 16F) : -(9F / 16F), - -((y * 3F) / 16F) - (6F / 16F), - 0 - ); - } - return translations; - } - - @Override - public void emitItemQuads(final ItemStack stack, - final Supplier randomSupplier, - final RenderContext context) { - context.pushTransform(emissiveTransform); - wrapped.emitItemQuads(stack, randomSupplier, context); - context.popTransform(); - super.emitItemQuads(stack, randomSupplier, context); - } - - @Override - public void emitBlockQuads(final BlockAndTintGetter blockView, - final BlockState state, - final BlockPos pos, - final Supplier randomSupplier, - final RenderContext context) { - if (!(state.getBlock() instanceof DiskInterfaceBlock diskInterfaceBlock)) { - return; - } - final BiDirection direction = diskInterfaceBlock.getDirection(state); - if (direction == null) { - return; - } - context.pushTransform(quadRotators.forDirection(direction)); - final boolean active = state.getValue(AbstractActiveColoredDirectionalBlock.ACTIVE); - if (active) { - context.pushTransform(emissiveTransform); - } - (active ? wrapped : inactiveModel).emitBlockQuads(blockView, state, pos, randomSupplier, context); - super.emitBlockQuads(blockView, state, pos, randomSupplier, context); - if (active) { - context.popTransform(); - } - context.popTransform(); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java deleted file mode 100644 index 1ad24843d..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.diskinterface; - -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntityRenderer; -import com.refinedmods.refinedstorage.platform.fabric.support.render.RenderTypes; - -public class DiskInterfaceBlockEntityRendererImpl - extends AbstractDiskInterfaceBlockEntityRenderer { - public DiskInterfaceBlockEntityRendererImpl() { - super(RenderTypes.DISK_LED); - } - - @Override - protected Disk[] getDisks(final AbstractDiskInterfaceBlockEntity blockEntity) { - if (!(blockEntity instanceof FabricDiskInterfaceBlockEntity fabricBlockEntity)) { - return null; - } - if (fabricBlockEntity.getRenderData() instanceof Disk[] disks) { - return disks; - } - return null; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/FabricDiskInterfaceBlockEntity.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/FabricDiskInterfaceBlockEntity.java deleted file mode 100644 index 2be7b792b..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/FabricDiskInterfaceBlockEntity.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.diskinterface; - -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.state.BlockState; - -public class FabricDiskInterfaceBlockEntity extends AbstractDiskInterfaceBlockEntity { - public FabricDiskInterfaceBlockEntity(final BlockPos pos, final BlockState state) { - super(pos, state); - } - - @Override - @Nullable - public Object getRenderData() { - return disks; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/package-info.java deleted file mode 100644 index f8d38dad1..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/diskinterface/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.storage.diskinterface; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/externalstorage/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/externalstorage/package-info.java deleted file mode 100644 index fa307419d..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/externalstorage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.storage.externalstorage; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/package-info.java deleted file mode 100644 index 92c7b2d5c..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.storage; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/FabricPortableGridBlockEntity.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/FabricPortableGridBlockEntity.java deleted file mode 100644 index 747cad571..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/FabricPortableGridBlockEntity.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.portablegrid; - -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.AbstractPortableGridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridType; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.state.BlockState; - -public class FabricPortableGridBlockEntity extends AbstractPortableGridBlockEntity { - public FabricPortableGridBlockEntity(final PortableGridType type, final BlockPos pos, final BlockState state) { - super(type, pos, state); - } - - @Override - @Nullable - public Object getRenderData() { - return disk; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/PortableGridBakedModel.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/PortableGridBakedModel.java deleted file mode 100644 index a7ee4c67e..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/PortableGridBakedModel.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.portablegrid; - -import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlock; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlockItem; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlockItemRenderInfo; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadRotators; -import com.refinedmods.refinedstorage.platform.fabric.support.render.QuadTranslator; - -import java.util.Map; -import java.util.function.Supplier; - -import net.fabricmc.fabric.api.renderer.v1.model.ForwardingBakedModel; -import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.resources.model.BakedModel; -import net.minecraft.core.BlockPos; -import net.minecraft.util.RandomSource; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.BlockAndTintGetter; -import net.minecraft.world.level.block.state.BlockState; - -public class PortableGridBakedModel extends ForwardingBakedModel { - private static final QuadTranslator MOVE_TO_DISK_LOCATION = new QuadTranslator(0, -12 / 16F, 9 / 16F); - private static final QuadTranslator MOVE_TO_DISK_LED_LOCATION = new QuadTranslator(0, -12 / 16F, 9 / 16F); - - private final BakedModel activeModel; - private final BakedModel inactiveModel; - private final Map diskModels; - private final QuadRotators quadRotators; - private final DiskLeds diskLeds; - - PortableGridBakedModel(final BakedModel activeModel, - final BakedModel inactiveModel, - final Map diskModels, - final QuadRotators quadRotators, - final DiskLeds diskLeds) { - this.wrapped = inactiveModel; - this.activeModel = activeModel; - this.inactiveModel = inactiveModel; - this.diskModels = diskModels; - this.quadRotators = quadRotators; - this.diskLeds = diskLeds; - } - - @Override - public boolean isVanillaAdapter() { - return false; - } - - @Override - public void emitItemQuads(final ItemStack stack, - final Supplier randomSupplier, - final RenderContext context) { - final ClientLevel level = Minecraft.getInstance().level; - if (level == null) { - return; - } - final PortableGridBlockItemRenderInfo renderInfo = PortableGridBlockItem.getRenderInfo(stack, level); - (renderInfo.active() ? activeModel : inactiveModel).emitItemQuads(stack, randomSupplier, context); - if (renderInfo.disk().state() != StorageState.NONE) { - final BakedModel diskModel = diskModels.get(renderInfo.disk().item()); - if (diskModel == null) { - return; - } - context.pushTransform(MOVE_TO_DISK_LOCATION); - context.pushTransform(quadRotators.forDirection(BiDirection.WEST)); - diskModel.emitItemQuads(stack, randomSupplier, context); - context.popTransform(); - context.popTransform(); - - context.pushTransform(MOVE_TO_DISK_LED_LOCATION); - context.pushTransform(quadRotators.forDirection(BiDirection.WEST)); - diskLeds.forState(renderInfo.disk().state()).emitItemQuads(stack, randomSupplier, context); - context.popTransform(); - context.popTransform(); - } - } - - @Override - public void emitBlockQuads(final BlockAndTintGetter blockView, - final BlockState state, - final BlockPos pos, - final Supplier randomSupplier, - final RenderContext context) { - if (!(state.getBlock() instanceof PortableGridBlock portableGridBlock)) { - return; - } - final BiDirection direction = portableGridBlock.getDirection(state); - if (direction == null) { - return; - } - context.pushTransform(quadRotators.forDirection(direction)); - final Object renderAttachment = blockView.getBlockEntityRenderData(pos); - if (renderAttachment instanceof Disk disk) { - emitDiskQuads(blockView, state, pos, randomSupplier, context, disk); - } - final boolean active = state.getValue(PortableGridBlock.ACTIVE); - (active ? activeModel : inactiveModel).emitBlockQuads(blockView, state, pos, randomSupplier, context); - context.popTransform(); - } - - private void emitDiskQuads( - final BlockAndTintGetter blockView, - final BlockState state, - final BlockPos pos, - final Supplier randomSupplier, - final RenderContext context, - final Disk disk - ) { - final BakedModel diskModel = diskModels.get(disk.item()); - if (diskModel == null) { - return; - } - context.pushTransform(MOVE_TO_DISK_LOCATION); - context.pushTransform(quadRotators.forDirection(BiDirection.WEST)); - diskModel.emitBlockQuads(blockView, state, pos, randomSupplier, context); - context.popTransform(); - context.popTransform(); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/PortableGridBlockEntityRendererImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/PortableGridBlockEntityRendererImpl.java deleted file mode 100644 index 474759349..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/PortableGridBlockEntityRendererImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.storage.portablegrid; - -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.AbstractPortableGridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.AbstractPortableGridBlockEntityRenderer; -import com.refinedmods.refinedstorage.platform.fabric.support.render.RenderTypes; - -import javax.annotation.Nullable; - -public class PortableGridBlockEntityRendererImpl - extends AbstractPortableGridBlockEntityRenderer { - public PortableGridBlockEntityRendererImpl() { - super(RenderTypes.DISK_LED); - } - - @Override - @Nullable - protected Disk getDisk(final T blockEntity) { - if (!(blockEntity instanceof FabricPortableGridBlockEntity fabricDiskDriveBlockEntity)) { - return null; - } - if (fabricDiskDriveBlockEntity.getRenderData() instanceof Disk disk) { - return disk; - } - return null; - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/package-info.java deleted file mode 100644 index 72a06528a..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/storage/portablegrid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.storage.portablegrid; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/containermenu/ContainerTransferDestination.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/containermenu/ContainerTransferDestination.java deleted file mode 100644 index 3ff564cc6..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/containermenu/ContainerTransferDestination.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.containermenu; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.TransferDestination; - -import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; -import net.fabricmc.fabric.api.transfer.v1.storage.Storage; -import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; -import net.minecraft.world.Container; -import net.minecraft.world.item.ItemStack; - -public record ContainerTransferDestination(Container destination) implements TransferDestination { - @Override - public ItemStack transfer(final ItemStack stack) { - final Storage storage = InventoryStorage.of(destination, null); - try (Transaction tx = Transaction.openOuter()) { - final long inserted = storage.insert( - ItemVariant.of(stack), - stack.getCount(), - tx - ); - tx.commit(); - final long remainder = stack.getCount() - inserted; - final ItemStack remainderStack = stack.copy(); - remainderStack.setCount((int) remainder); - return remainderStack; - } - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/containermenu/MenuOpenerImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/containermenu/MenuOpenerImpl.java deleted file mode 100644 index f5c409c30..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/containermenu/MenuOpenerImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.containermenu; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.MenuOpener; - -import javax.annotation.Nullable; - -import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory; -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.MenuProvider; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; - -public class MenuOpenerImpl implements MenuOpener { - @Override - public void openMenu(final ServerPlayer player, final MenuProvider menuProvider) { - if (menuProvider instanceof ExtendedMenuProvider extendedMenuProvider) { - openExtendedMenu(player, extendedMenuProvider); - } else { - player.openMenu(menuProvider); - } - } - - private void openExtendedMenu(final ServerPlayer player, final ExtendedMenuProvider extendedMenuProvider) { - player.openMenu(new ExtendedScreenHandlerFactory() { - @Nullable - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return extendedMenuProvider.createMenu(syncId, inventory, player); - } - - @Override - public Component getDisplayName() { - return extendedMenuProvider.getDisplayName(); - } - - @Override - public T getScreenOpeningData(final ServerPlayer player) { - return extendedMenuProvider.getMenuData(); - } - }); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/containermenu/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/containermenu/package-info.java deleted file mode 100644 index 8f6acc4f8..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/containermenu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.support.containermenu; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/energy/EnergyStorageAdapter.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/energy/EnergyStorageAdapter.java deleted file mode 100644 index 94d34567f..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/energy/EnergyStorageAdapter.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.energy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; - -import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext; -import net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant; - -public class EnergyStorageAdapter extends SnapshotParticipant implements team.reborn.energy.api.EnergyStorage { - private final EnergyStorage energyStorage; - - public EnergyStorageAdapter(final EnergyStorage energyStorage) { - this.energyStorage = energyStorage; - } - - public EnergyStorage getEnergyStorage() { - return energyStorage; - } - - @Override - public long insert(final long maxAmount, final TransactionContext transaction) { - final long insertedSimulated = energyStorage.receive(maxAmount, Action.SIMULATE); - if (insertedSimulated > 0) { - updateSnapshots(transaction); - } - return energyStorage.receive(maxAmount, Action.EXECUTE); - } - - @Override - public long extract(final long maxAmount, final TransactionContext transaction) { - final long extractedSimulated = energyStorage.extract(maxAmount, Action.SIMULATE); - if (extractedSimulated > 0) { - updateSnapshots(transaction); - } - return energyStorage.extract(maxAmount, Action.EXECUTE); - } - - @Override - public long getAmount() { - return energyStorage.getStored(); - } - - @Override - public long getCapacity() { - return energyStorage.getCapacity(); - } - - @Override - protected Long createSnapshot() { - return energyStorage.getStored(); - } - - @Override - protected void readSnapshot(final Long snapshot) { - energyStorage.extract(Long.MAX_VALUE, Action.EXECUTE); - energyStorage.receive(snapshot, Action.EXECUTE); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/energy/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/energy/package-info.java deleted file mode 100644 index d7b563bc1..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/energy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.support.energy; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotators.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotators.java deleted file mode 100644 index 45bc35d83..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotators.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.render; - -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; - -import java.util.EnumMap; -import java.util.Map; - -public class QuadRotators { - private final Map rotators = new EnumMap<>(BiDirection.class); - - public QuadRotators() { - for (final BiDirection direction : BiDirection.values()) { - rotators.put(direction, new QuadRotator(direction)); - } - } - - public QuadRotator forDirection(final BiDirection direction) { - return rotators.get(direction); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/RenderTypes.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/RenderTypes.java deleted file mode 100644 index f022cd712..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/RenderTypes.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.render; - -import com.mojang.blaze3d.vertex.DefaultVertexFormat; -import com.mojang.blaze3d.vertex.VertexFormat; -import net.minecraft.client.renderer.GameRenderer; -import net.minecraft.client.renderer.RenderStateShard; -import net.minecraft.client.renderer.RenderType; - -public final class RenderTypes { - public static final RenderType DISK_LED = RenderType.create( - "disk_led", - DefaultVertexFormat.POSITION_COLOR, - VertexFormat.Mode.QUADS, - 32565, - false, - true, - RenderType.CompositeState.builder() - .setShaderState(new RenderStateShard.ShaderStateShard(GameRenderer::getPositionColorShader)) - .createCompositeState(false) - ); - - private RenderTypes() { - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/package-info.java deleted file mode 100644 index f8f7bbe5f..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.support.render; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/resource/VariantUtil.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/resource/VariantUtil.java deleted file mode 100644 index 3b08f6428..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/resource/VariantUtil.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.refinedmods.refinedstorage.platform.fabric.support.resource; - -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; - -public final class VariantUtil { - private VariantUtil() { - } - - public static ItemVariant toItemVariant(final ItemResource itemResource) { - return ItemVariant.of(itemResource.item(), itemResource.components()); - } - - public static ItemResource ofItemVariant(final ItemVariant itemVariant) { - return new ItemResource(itemVariant.getItem(), itemVariant.getComponents()); - } - - public static FluidVariant toFluidVariant(final FluidResource fluidResource) { - return FluidVariant.of(fluidResource.fluid(), fluidResource.components()); - } - - public static FluidResource ofFluidVariant(final FluidVariant fluidVariant) { - return new FluidResource(fluidVariant.getFluid(), fluidVariant.getComponents()); - } -} diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/resource/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/resource/package-info.java deleted file mode 100644 index 4aecb33f9..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/resource/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.support.resource; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/util/package-info.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/util/package-info.java deleted file mode 100644 index 3a3f8bc11..000000000 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/util/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.fabric.util; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/build.gradle.kts b/refinedstorage-platform-neoforge/build.gradle.kts deleted file mode 100644 index 6d66e6a37..000000000 --- a/refinedstorage-platform-neoforge/build.gradle.kts +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id("refinedarchitect.neoforge") -} - -refinedarchitect { - modId = "refinedstorage" - neoForge() - gameTests() - dataGeneration(project(":refinedstorage-platform-common")) - compileWithProject(project(":refinedstorage-platform-common")) - compileWithProject(project(":refinedstorage-platform-api")) - compileWithProject(project(":refinedstorage-core-api")) - compileWithProject(project(":refinedstorage-resource-api")) - compileWithProject(project(":refinedstorage-storage-api")) - compileWithProject(project(":refinedstorage-network-api")) - compileWithProject(project(":refinedstorage-network")) - compileWithProject(project(":refinedstorage-grid-api")) - compileWithProject(project(":refinedstorage-query-parser")) - publishing { - maven = true - // curseForge = "243076" - // modrinth = "refined-storage" - } -} - -base { - archivesName.set("refinedstorage-platform-neoforge") -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ClientModInitializer.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ClientModInitializer.java deleted file mode 100644 index 8ddc97359..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ClientModInitializer.java +++ /dev/null @@ -1,238 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge; - -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.upgrade.AbstractUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.AbstractClientModInitializer; -import com.refinedmods.refinedstorage.platform.common.configurationcard.ConfigurationCardItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.content.KeyMappings; -import com.refinedmods.refinedstorage.platform.common.controller.ControllerItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.networking.NetworkCardItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.storagemonitor.StorageMonitorBlockEntityRenderer; -import com.refinedmods.refinedstorage.platform.common.support.network.bounditem.NetworkBoundItemItemPropertyFunction; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.CompositeClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.HelpClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.support.tooltip.ResourceClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeDestinationClientTooltipComponent; -import com.refinedmods.refinedstorage.platform.neoforge.storage.diskdrive.DiskDriveBlockEntityRendererImpl; -import com.refinedmods.refinedstorage.platform.neoforge.storage.diskdrive.DiskDriveGeometryLoader; -import com.refinedmods.refinedstorage.platform.neoforge.storage.diskinterface.DiskInterfaceBlockEntityRendererImpl; -import com.refinedmods.refinedstorage.platform.neoforge.storage.diskinterface.DiskInterfaceGeometryLoader; -import com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid.PortableGridBlockEntityRendererImpl; -import com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid.PortableGridGeometryLoader; - -import java.util.List; - -import com.mojang.blaze3d.platform.InputConstants; -import net.minecraft.client.KeyMapping; -import net.minecraft.client.gui.screens.Screen; -import net.minecraft.client.gui.screens.inventory.MenuAccess; -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; -import net.minecraft.client.renderer.item.ItemProperties; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.MenuType; -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; -import net.neoforged.neoforge.client.event.InputEvent; -import net.neoforged.neoforge.client.event.ModelEvent; -import net.neoforged.neoforge.client.event.RegisterClientTooltipComponentFactoriesEvent; -import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; -import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; -import net.neoforged.neoforge.client.settings.KeyConflictContext; -import net.neoforged.neoforge.client.settings.KeyModifier; -import net.neoforged.neoforge.common.NeoForge; -import org.lwjgl.glfw.GLFW; - -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.DISK_DRIVE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.PORTABLE_GRID; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public final class ClientModInitializer extends AbstractClientModInitializer { - private ClientModInitializer() { - } - - @SubscribeEvent - public static void onClientSetup(final FMLClientSetupEvent e) { - NeoForge.EVENT_BUS.addListener(ClientModInitializer::onKeyInput); - e.enqueueWork(ClientModInitializer::registerModelPredicates); - e.enqueueWork(ClientModInitializer::registerItemProperties); - registerBlockEntityRenderer(); - registerResourceRendering(); - registerAlternativeGridHints(); - registerDiskModels(); - } - - @SubscribeEvent - public static void onKeyInput(final InputEvent.Key e) { - handleInputEvents(); - } - - private static void registerModelPredicates() { - Items.INSTANCE.getControllers().forEach(controllerBlockItem -> ItemProperties.register( - controllerBlockItem.get(), - createIdentifier("stored_in_controller"), - new ControllerItemPropertyFunction() - )); - } - - @SubscribeEvent - public static void onRegisterModelGeometry(final ModelEvent.RegisterGeometryLoaders e) { - registerDiskModels(); - e.register(DISK_DRIVE, new DiskDriveGeometryLoader()); - e.register(PORTABLE_GRID, new PortableGridGeometryLoader()); - Blocks.INSTANCE.getDiskInterface().forEach( - (color, id, supplier) -> e.register(id, new DiskInterfaceGeometryLoader(color)) - ); - } - - @SubscribeEvent - public static void onRegisterMenuScreens(final RegisterMenuScreensEvent e) { - registerScreens(new ScreenRegistration() { - @Override - public > void register( - final MenuType type, - final ScreenConstructor factory - ) { - e.register(type, factory::create); - } - }); - } - - @SubscribeEvent - public static void onRegisterKeyMappings(final RegisterKeyMappingsEvent e) { - final KeyMapping focusSearchBarKeyBinding = new KeyMapping( - ContentNames.FOCUS_SEARCH_BAR_TRANSLATION_KEY, - InputConstants.Type.KEYSYM, - GLFW.GLFW_KEY_TAB, - ContentNames.MOD_TRANSLATION_KEY - ); - e.register(focusSearchBarKeyBinding); - KeyMappings.INSTANCE.setFocusSearchBar(focusSearchBarKeyBinding); - - final KeyMapping clearCraftingGridMatrixToNetwork = new KeyMapping( - ContentNames.CLEAR_CRAFTING_MATRIX_TO_NETWORK_TRANSLATION_KEY, - KeyConflictContext.GUI, - KeyModifier.CONTROL, - InputConstants.Type.KEYSYM, - GLFW.GLFW_KEY_X, - ContentNames.MOD_TRANSLATION_KEY - ); - e.register(clearCraftingGridMatrixToNetwork); - KeyMappings.INSTANCE.setClearCraftingGridMatrixToNetwork(clearCraftingGridMatrixToNetwork); - - final KeyMapping clearCraftingGridMatrixToInventory = new KeyMapping( - ContentNames.CLEAR_CRAFTING_MATRIX_TO_INVENTORY_TRANSLATION_KEY, - InputConstants.UNKNOWN.getValue(), - ContentNames.MOD_TRANSLATION_KEY - ); - e.register(clearCraftingGridMatrixToInventory); - KeyMappings.INSTANCE.setClearCraftingGridMatrixToInventory(clearCraftingGridMatrixToInventory); - - final KeyMapping openWirelessGrid = new KeyMapping( - ContentNames.OPEN_WIRELESS_GRID_TRANSLATION_KEY, - KeyConflictContext.IN_GAME, - InputConstants.UNKNOWN, - ContentNames.MOD_TRANSLATION_KEY - ); - e.register(openWirelessGrid); - KeyMappings.INSTANCE.setOpenWirelessGrid(openWirelessGrid); - - final KeyMapping openPortableGrid = new KeyMapping( - ContentNames.OPEN_PORTABLE_GRID_TRANSLATION_KEY, - KeyConflictContext.IN_GAME, - InputConstants.UNKNOWN, - ContentNames.MOD_TRANSLATION_KEY - ); - e.register(openPortableGrid); - KeyMappings.INSTANCE.setOpenPortableGrid(openPortableGrid); - } - - private static void registerBlockEntityRenderer() { - BlockEntityRenderers.register( - BlockEntities.INSTANCE.getDiskDrive(), - ctx -> new DiskDriveBlockEntityRendererImpl<>() - ); - BlockEntityRenderers.register( - BlockEntities.INSTANCE.getStorageMonitor(), - ctx -> new StorageMonitorBlockEntityRenderer() - ); - BlockEntityRenderers.register( - BlockEntities.INSTANCE.getPortableGrid(), - ctx -> new PortableGridBlockEntityRendererImpl<>() - ); - BlockEntityRenderers.register( - BlockEntities.INSTANCE.getCreativePortableGrid(), - ctx -> new PortableGridBlockEntityRendererImpl<>() - ); - BlockEntityRenderers.register( - BlockEntities.INSTANCE.getDiskInterface(), - ctx -> new DiskInterfaceBlockEntityRendererImpl<>() - ); - } - - @SubscribeEvent - public static void onRegisterTooltipFactories(final RegisterClientTooltipComponentFactoriesEvent e) { - e.register( - AbstractUpgradeItem.UpgradeDestinationTooltipComponent.class, - component -> new UpgradeDestinationClientTooltipComponent(component.destinations()) - ); - e.register( - HelpTooltipComponent.class, - component -> HelpClientTooltipComponent.create(component.text()) - ); - e.register( - RegulatorUpgradeItem.RegulatorTooltipComponent.class, - component -> { - final ClientTooltipComponent help = HelpClientTooltipComponent.create(component.helpText()); - return component.configuredResource() == null - ? help - : createRegulatorUpgradeClientTooltipComponent(component.configuredResource(), help); - } - ); - } - - private static CompositeClientTooltipComponent createRegulatorUpgradeClientTooltipComponent( - final ResourceAmount configuredResource, - final ClientTooltipComponent help - ) { - return new CompositeClientTooltipComponent(List.of( - new ResourceClientTooltipComponent(configuredResource), - help - )); - } - - private static void registerItemProperties() { - ItemProperties.register( - Items.INSTANCE.getWirelessGrid(), - NetworkBoundItemItemPropertyFunction.NAME, - new NetworkBoundItemItemPropertyFunction() - ); - ItemProperties.register( - Items.INSTANCE.getCreativeWirelessGrid(), - NetworkBoundItemItemPropertyFunction.NAME, - new NetworkBoundItemItemPropertyFunction() - ); - ItemProperties.register( - Items.INSTANCE.getConfigurationCard(), - ConfigurationCardItemPropertyFunction.NAME, - new ConfigurationCardItemPropertyFunction() - ); - ItemProperties.register( - Items.INSTANCE.getNetworkCard(), - NetworkCardItemPropertyFunction.NAME, - new NetworkCardItemPropertyFunction() - ); - ItemProperties.register( - Items.INSTANCE.getSecurityCard(), - SecurityCardItemPropertyFunction.NAME, - new SecurityCardItemPropertyFunction() - ); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ConfigImpl.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ConfigImpl.java deleted file mode 100644 index e8f4bbe5a..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ConfigImpl.java +++ /dev/null @@ -1,873 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge; - -import com.refinedmods.refinedstorage.api.grid.view.GridSortingDirection; -import com.refinedmods.refinedstorage.platform.common.Config; -import com.refinedmods.refinedstorage.platform.common.content.DefaultEnergyUsage; -import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridMatrixCloseBehavior; -import com.refinedmods.refinedstorage.platform.common.grid.GridSortingTypes; -import com.refinedmods.refinedstorage.platform.common.support.stretching.ScreenSize; - -import java.util.Optional; - -import net.minecraft.resources.ResourceLocation; -import net.neoforged.neoforge.common.ModConfigSpec; - -public class ConfigImpl implements Config { - private static final String ENERGY_USAGE = "energyUsage"; - private static final String ENERGY_CAPACITY = "energyCapacity"; - - private final ModConfigSpec.Builder builder = new ModConfigSpec.Builder(); - private final ModConfigSpec spec; - - private final ModConfigSpec.EnumValue screenSize; - private final ModConfigSpec.BooleanValue smoothScrolling; - private final ModConfigSpec.IntValue maxRowsStretch; - private final SimpleEnergyUsageEntry cable; - private final ControllerEntry controller; - private final DiskDriveEntry diskDrive; - private final DiskInterfaceEntry diskInterface; - private final GridEntry grid; - private final CraftingGridEntry craftingGrid; - private final StorageBlockEntry storageBlock; - private final FluidStorageBlockEntry fluidStorageBlock; - private final SimpleEnergyUsageEntry importer; - private final SimpleEnergyUsageEntry exporter; - private final UpgradeEntry upgrade; - private final SimpleEnergyUsageEntry iface; - private final SimpleEnergyUsageEntry externalStorage; - private final SimpleEnergyUsageEntry detector; - private final SimpleEnergyUsageEntry destructor; - private final SimpleEnergyUsageEntry constructor; - private final WirelessGridEntry wirelessGrid; - private final WirelessTransmitterEntry wirelessTransmitter; - private final SimpleEnergyUsageEntry storageMonitor; - private final SimpleEnergyUsageEntry networkReceiver; - private final SimpleEnergyUsageEntry networkTransmitter; - private final PortableGridEntry portableGrid; - private final SimpleEnergyUsageEntry securityCard; - private final SimpleEnergyUsageEntry fallbackSecurityCard; - private final SimpleEnergyUsageEntry securityManager; - private final RelayEntry relay; - - public ConfigImpl() { - screenSize = builder - .comment("The screen size") - .defineEnum("screenSize", ScreenSize.STRETCH); - smoothScrolling = builder - .comment("Whether scrollbars should use smooth scrolling") - .define("smoothScrolling", true); - maxRowsStretch = builder - .comment("The maximum amount of rows that can be displayed when the screen size is stretched") - .defineInRange("maxRowsStretch", 256, 3, 256); - cable = new SimpleEnergyUsageEntryImpl("cable", "Cable", DefaultEnergyUsage.CABLE); - controller = new ControllerEntryImpl(); - diskDrive = new DiskDriveEntryImpl(); - diskInterface = new DiskInterfaceEntryImpl(); - grid = new GridEntryImpl(); - craftingGrid = new CraftingGridEntryImpl(); - storageBlock = new StorageBlockEntryImpl(); - fluidStorageBlock = new FluidStorageBlockEntryImpl(); - importer = new SimpleEnergyUsageEntryImpl("importer", "Importer", DefaultEnergyUsage.IMPORTER); - exporter = new SimpleEnergyUsageEntryImpl("exporter", "Exporter", DefaultEnergyUsage.EXPORTER); - upgrade = new UpgradeEntryImpl(); - iface = new SimpleEnergyUsageEntryImpl("interface", "Interface", DefaultEnergyUsage.INTERFACE); - externalStorage = new SimpleEnergyUsageEntryImpl( - "externalStorage", - "External Storage", - DefaultEnergyUsage.EXTERNAL_STORAGE - ); - detector = new SimpleEnergyUsageEntryImpl("detector", "Detector", DefaultEnergyUsage.DETECTOR); - destructor = new SimpleEnergyUsageEntryImpl("destructor", "Destructor", DefaultEnergyUsage.DESTRUCTOR); - constructor = new SimpleEnergyUsageEntryImpl("constructor", "Constructor", DefaultEnergyUsage.CONSTRUCTOR); - wirelessGrid = new WirelessGridEntryImpl(); - wirelessTransmitter = new WirelessTransmitterEntryImpl(); - storageMonitor = new SimpleEnergyUsageEntryImpl( - "storageMonitor", - "Storage Monitor", - DefaultEnergyUsage.STORAGE_MONITOR - ); - networkReceiver = new SimpleEnergyUsageEntryImpl( - "networkReceiver", - "Network Receiver", - DefaultEnergyUsage.NETWORK_RECEIVER - ); - networkTransmitter = new SimpleEnergyUsageEntryImpl( - "networkTransmitter", - "Network Transmitter", - DefaultEnergyUsage.NETWORK_TRANSMITTER - ); - portableGrid = new PortableGridEntryImpl(); - securityCard = new SimpleEnergyUsageEntryImpl( - "securityCard", - "Security Card", - DefaultEnergyUsage.SECURITY_CARD - ); - fallbackSecurityCard = new SimpleEnergyUsageEntryImpl( - "fallbackSecurityCard", - "Fallback Security Card", - DefaultEnergyUsage.FALLBACK_SECURITY_CARD - ); - securityManager = new SimpleEnergyUsageEntryImpl( - "securityManager", - "Security Manager", - DefaultEnergyUsage.SECURITY_MANAGER - ); - relay = new RelayEntryImpl(); - spec = builder.build(); - } - - public ModConfigSpec getSpec() { - return spec; - } - - @Override - public ScreenSize getScreenSize() { - return screenSize.get(); - } - - @Override - public boolean isSmoothScrolling() { - return smoothScrolling.get(); - } - - @Override - public int getMaxRowsStretch() { - return maxRowsStretch.get(); - } - - @Override - public void setScreenSize(final ScreenSize screenSize) { - this.screenSize.set(screenSize); - } - - @Override - public GridEntry getGrid() { - return grid; - } - - @Override - public CraftingGridEntry getCraftingGrid() { - return craftingGrid; - } - - @Override - public ControllerEntry getController() { - return controller; - } - - @Override - public DiskDriveEntry getDiskDrive() { - return diskDrive; - } - - @Override - public DiskInterfaceEntry getDiskInterface() { - return diskInterface; - } - - @Override - public SimpleEnergyUsageEntry getCable() { - return cable; - } - - @Override - public StorageBlockEntry getStorageBlock() { - return storageBlock; - } - - @Override - public FluidStorageBlockEntry getFluidStorageBlock() { - return fluidStorageBlock; - } - - @Override - public SimpleEnergyUsageEntry getImporter() { - return importer; - } - - @Override - public SimpleEnergyUsageEntry getExporter() { - return exporter; - } - - @Override - public UpgradeEntry getUpgrade() { - return upgrade; - } - - @Override - public SimpleEnergyUsageEntry getInterface() { - return iface; - } - - @Override - public SimpleEnergyUsageEntry getExternalStorage() { - return externalStorage; - } - - @Override - public SimpleEnergyUsageEntry getDetector() { - return detector; - } - - @Override - public SimpleEnergyUsageEntry getDestructor() { - return destructor; - } - - @Override - public SimpleEnergyUsageEntry getConstructor() { - return constructor; - } - - @Override - public WirelessGridEntry getWirelessGrid() { - return wirelessGrid; - } - - @Override - public WirelessTransmitterEntry getWirelessTransmitter() { - return wirelessTransmitter; - } - - @Override - public SimpleEnergyUsageEntry getStorageMonitor() { - return storageMonitor; - } - - @Override - public SimpleEnergyUsageEntry getNetworkReceiver() { - return networkReceiver; - } - - @Override - public SimpleEnergyUsageEntry getNetworkTransmitter() { - return networkTransmitter; - } - - @Override - public PortableGridEntry getPortableGrid() { - return portableGrid; - } - - @Override - public SimpleEnergyUsageEntry getSecurityCard() { - return securityCard; - } - - @Override - public SimpleEnergyUsageEntry getFallbackSecurityCard() { - return fallbackSecurityCard; - } - - @Override - public SimpleEnergyUsageEntry getSecurityManager() { - return securityManager; - } - - @Override - public RelayEntry getRelay() { - return relay; - } - - private class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry { - private final ModConfigSpec.LongValue energyUsage; - - SimpleEnergyUsageEntryImpl(final String path, final String readableName, final long defaultValue) { - builder.push(path); - energyUsage = builder - .comment("The energy used by the " + readableName) - .defineInRange(ENERGY_USAGE, defaultValue, 0, Long.MAX_VALUE); - builder.pop(); - } - - @Override - public long getEnergyUsage() { - return energyUsage.get(); - } - } - - private class ControllerEntryImpl implements ControllerEntry { - private final ModConfigSpec.LongValue energyCapacity; - - private ControllerEntryImpl() { - builder.push("controller"); - energyCapacity = builder.comment("The energy capacity of the Controller") - .defineInRange(ENERGY_CAPACITY, DefaultEnergyUsage.CONTROLLER_CAPACITY, 0, Long.MAX_VALUE); - builder.pop(); - } - - @Override - public long getEnergyCapacity() { - return energyCapacity.get(); - } - } - - private class DiskDriveEntryImpl implements DiskDriveEntry { - private final ModConfigSpec.LongValue energyUsage; - private final ModConfigSpec.LongValue energyUsagePerDisk; - - private DiskDriveEntryImpl() { - builder.push("diskDrive"); - energyUsage = builder.comment("The energy used by the Disk Drive") - .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.DISK_DRIVE, 0, Long.MAX_VALUE); - energyUsagePerDisk = builder.comment("The energy used per disk") - .defineInRange("energyUsagePerDisk", DefaultEnergyUsage.DISK_DRIVE_PER_DISK, 0, Long.MAX_VALUE); - builder.pop(); - } - - @Override - public long getEnergyUsage() { - return energyUsage.get(); - } - - @Override - public long getEnergyUsagePerDisk() { - return energyUsagePerDisk.get(); - } - } - - private class DiskInterfaceEntryImpl implements DiskInterfaceEntry { - private final ModConfigSpec.LongValue energyUsage; - private final ModConfigSpec.LongValue energyUsagePerDisk; - - private DiskInterfaceEntryImpl() { - builder.push("diskInterface"); - energyUsage = builder.comment("The energy used by the Disk Interface") - .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.DISK_INTERFACE, 0, Long.MAX_VALUE); - energyUsagePerDisk = builder.comment("The energy used per disk") - .defineInRange("energyUsagePerDisk", DefaultEnergyUsage.DISK_INTERFACE_PER_DISK, 0, Long.MAX_VALUE); - builder.pop(); - } - - @Override - public long getEnergyUsage() { - return energyUsage.get(); - } - - @Override - public long getEnergyUsagePerDisk() { - return energyUsagePerDisk.get(); - } - } - - private class GridEntryImpl implements GridEntry { - private final ModConfigSpec.BooleanValue largeFont; - private final ModConfigSpec.BooleanValue preventSortingWhileShiftIsDown; - private final ModConfigSpec.BooleanValue detailedTooltip; - private final ModConfigSpec.BooleanValue rememberSearchQuery; - private final ModConfigSpec.LongValue energyUsage; - private final ModConfigSpec.BooleanValue autoSelected; - private final ModConfigSpec.ConfigValue synchronizer; - private final ModConfigSpec.ConfigValue resourceType; - private final ModConfigSpec.EnumValue sortingDirection; - private final ModConfigSpec.EnumValue sortingType; - - GridEntryImpl() { - builder.push("grid"); - largeFont = builder - .comment("Whether the Grid should use a large font for quantities") - .define("largeFont", false); - preventSortingWhileShiftIsDown = builder - .comment("Whether the Grid should avoid sorting when shift is held down") - .define("preventSortingWhileShiftIsDown", true); - detailedTooltip = builder - .comment("Whether the Grid should show a detailed tooltip") - .define("detailedTooltip", true); - rememberSearchQuery = builder - .comment("Whether the search query should persist when closing and re-opening the Grid") - .define("rememberSearchQuery", false); - energyUsage = builder - .comment("The energy used by the Grid") - .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.GRID, 0, Long.MAX_VALUE); - autoSelected = builder - .comment("Whether the Grid search box is auto selected") - .define("autoSelected", false); - synchronizer = builder - .comment("The synchronization type of the Grid search box") - .define("synchronizer", ""); - resourceType = builder - .comment("The resource type to be shown") - .define("resourceType", ""); - sortingDirection = builder - .comment("The sorting direction") - .defineEnum("sortingDirection", GridSortingDirection.ASCENDING); - sortingType = builder - .comment("The sorting type") - .defineEnum("sortingType", GridSortingTypes.QUANTITY); - builder.pop(); - } - - @Override - public boolean isLargeFont() { - return largeFont.get(); - } - - @Override - public boolean isPreventSortingWhileShiftIsDown() { - return preventSortingWhileShiftIsDown.get(); - } - - @Override - public boolean isDetailedTooltip() { - return detailedTooltip.get(); - } - - @Override - public boolean isRememberSearchQuery() { - return rememberSearchQuery.get(); - } - - @Override - public long getEnergyUsage() { - return energyUsage.get(); - } - - @Override - public boolean isAutoSelected() { - return autoSelected.get(); - } - - @Override - public void setAutoSelected(final boolean autoSelected) { - this.autoSelected.set(autoSelected); - } - - @Override - public Optional getSynchronizer() { - if (synchronizer == null || synchronizer.get().trim().isBlank()) { - return Optional.empty(); - } - return Optional.of(synchronizer.get()).map(ResourceLocation::tryParse); - } - - @Override - public void setSynchronizer(final ResourceLocation synchronizerId) { - this.synchronizer.set(synchronizerId.toString()); - } - - @Override - public void clearSynchronizer() { - this.synchronizer.set(""); - } - - @Override - public GridSortingDirection getSortingDirection() { - return sortingDirection.get(); - } - - @Override - public void setSortingDirection(final GridSortingDirection sortingDirection) { - this.sortingDirection.set(sortingDirection); - } - - @Override - public GridSortingTypes getSortingType() { - return sortingType.get(); - } - - @Override - public void setSortingType(final GridSortingTypes sortingType) { - this.sortingType.set(sortingType); - } - - @Override - public Optional getResourceTypeId() { - if (resourceType == null || resourceType.get().trim().isBlank()) { - return Optional.empty(); - } - return Optional.of(resourceType.get()).map(ResourceLocation::tryParse); - } - - @Override - public void setResourceTypeId(final ResourceLocation resourceTypeId) { - this.resourceType.set(resourceTypeId.toString()); - } - - @Override - public void clearResourceType() { - this.resourceType.set(""); - } - } - - private class CraftingGridEntryImpl implements CraftingGridEntry { - private final ModConfigSpec.LongValue energyUsage; - private final ModConfigSpec.EnumValue craftingMatrixCloseBehavior; - - CraftingGridEntryImpl() { - builder.push("craftingGrid"); - energyUsage = builder - .comment("The energy used by the Crafting Grid") - .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.CRAFTING_GRID, 0, Long.MAX_VALUE); - craftingMatrixCloseBehavior = builder - .comment("What should happen to the crafting matrix slots when closing the Crafting Grid") - .defineEnum("craftingMatrixCloseBehavior", CraftingGridMatrixCloseBehavior.NONE); - builder.pop(); - } - - @Override - public long getEnergyUsage() { - return energyUsage.get(); - } - - @Override - public CraftingGridMatrixCloseBehavior getCraftingMatrixCloseBehavior() { - return craftingMatrixCloseBehavior.get(); - } - } - - private class StorageBlockEntryImpl implements StorageBlockEntry { - private final ModConfigSpec.LongValue oneKEnergyUsage; - private final ModConfigSpec.LongValue fourKEnergyUsage; - private final ModConfigSpec.LongValue sixteenKEnergyUsage; - private final ModConfigSpec.LongValue sixtyFourKEnergyUsage; - private final ModConfigSpec.LongValue creativeUsage; - - StorageBlockEntryImpl() { - builder.push("storageBlock"); - oneKEnergyUsage = builder - .comment("The energy used by the 1K Storage Block") - .defineInRange("1kEnergyUsage", DefaultEnergyUsage.ONE_K_STORAGE_BLOCK, 0, Long.MAX_VALUE); - fourKEnergyUsage = builder - .comment("The energy used by the 4K Storage Block") - .defineInRange("4kEnergyUsage", DefaultEnergyUsage.FOUR_K_STORAGE_BLOCK, 0, Long.MAX_VALUE); - sixteenKEnergyUsage = builder - .comment("The energy used by the 16K Storage Block") - .defineInRange("16kEnergyUsage", DefaultEnergyUsage.SIXTEEN_K_STORAGE_BLOCK, 0, Long.MAX_VALUE); - sixtyFourKEnergyUsage = builder - .comment("The energy used by the 64K Storage Block") - .defineInRange("64kEnergyUsage", DefaultEnergyUsage.SIXTY_FOUR_K_STORAGE_BLOCK, 0, Long.MAX_VALUE); - creativeUsage = builder - .comment("The energy used by the Creative Storage Block") - .defineInRange("creativeEnergyUsage", DefaultEnergyUsage.CREATIVE_STORAGE_BLOCK, 0, Long.MAX_VALUE); - builder.pop(); - } - - @Override - public long get1kEnergyUsage() { - return oneKEnergyUsage.get(); - } - - @Override - public long get4kEnergyUsage() { - return fourKEnergyUsage.get(); - } - - @Override - public long get16kEnergyUsage() { - return sixteenKEnergyUsage.get(); - } - - @Override - public long get64kEnergyUsage() { - return sixtyFourKEnergyUsage.get(); - } - - @Override - public long getCreativeEnergyUsage() { - return creativeUsage.get(); - } - } - - private class FluidStorageBlockEntryImpl implements FluidStorageBlockEntry { - private final ModConfigSpec.LongValue sixtyFourBEnergyUsage; - private final ModConfigSpec.LongValue twoHundredFiftySixBEnergyUsage; - private final ModConfigSpec.LongValue thousandTwentyFourBEnergyUsage; - private final ModConfigSpec.LongValue fourThousandNinetySixBEnergyUsage; - private final ModConfigSpec.LongValue creativeUsage; - - FluidStorageBlockEntryImpl() { - builder.push("fluidStorageBlock"); - sixtyFourBEnergyUsage = builder - .comment("The energy used by the 64B Fluid Storage Block") - .defineInRange( - "64bEnergyUsage", - DefaultEnergyUsage.SIXTY_FOUR_B_FLUID_STORAGE_BLOCK, - 0, - Long.MAX_VALUE - ); - twoHundredFiftySixBEnergyUsage = builder - .comment("The energy used by the 256B Fluid Storage Block") - .defineInRange( - "256bEnergyUsage", - DefaultEnergyUsage.TWO_HUNDRED_FIFTY_SIX_B_FLUID_STORAGE_BLOCK, - 0, - Long.MAX_VALUE - ); - thousandTwentyFourBEnergyUsage = builder - .comment("The energy used by the 1024B Fluid Storage Block") - .defineInRange( - "1024bEnergyUsage", - DefaultEnergyUsage.THOUSAND_TWENTY_FOUR_B_FLUID_STORAGE_BLOCK, - 0, - Long.MAX_VALUE - ); - fourThousandNinetySixBEnergyUsage = builder - .comment("The energy used by the 4096B Fluid Storage Block") - .defineInRange( - "4096bEnergyUsage", - DefaultEnergyUsage.FOUR_THOUSAND_NINETY_SIX_B_FLUID_STORAGE_BLOCK, - 0, - Long.MAX_VALUE - ); - creativeUsage = builder - .comment("The energy used by the Creative Fluid Storage Block") - .defineInRange( - "creativeEnergyUsage", - DefaultEnergyUsage.CREATIVE_FLUID_STORAGE_BLOCK, - 0, - Long.MAX_VALUE - ); - builder.pop(); - } - - @Override - public long get64bEnergyUsage() { - return sixtyFourBEnergyUsage.get(); - } - - @Override - public long get256bEnergyUsage() { - return twoHundredFiftySixBEnergyUsage.get(); - } - - @Override - public long get1024bEnergyUsage() { - return thousandTwentyFourBEnergyUsage.get(); - } - - @Override - public long get4096bEnergyUsage() { - return fourThousandNinetySixBEnergyUsage.get(); - } - - @Override - public long getCreativeEnergyUsage() { - return creativeUsage.get(); - } - } - - private class UpgradeEntryImpl implements UpgradeEntry { - private final ModConfigSpec.LongValue speedUpgradeEnergyUsage; - private final ModConfigSpec.LongValue stackUpgradeEnergyUsage; - private final ModConfigSpec.LongValue fortune1UpgradeEnergyUsage; - private final ModConfigSpec.LongValue fortune2UpgradeEnergyUsage; - private final ModConfigSpec.LongValue fortune3UpgradeEnergyUsage; - private final ModConfigSpec.LongValue silkTouchUpgradeEnergyUsage; - private final ModConfigSpec.LongValue regulatorUpgradeEnergyUsage; - private final ModConfigSpec.LongValue rangeUpgradeEnergyUsage; - private final ModConfigSpec.LongValue creativeRangeUpgradeEnergyUsage; - private final ModConfigSpec.IntValue rangeUpgradeRange; - - UpgradeEntryImpl() { - builder.push("upgrade"); - speedUpgradeEnergyUsage = builder - .comment("The additional energy used per Speed Upgrade") - .defineInRange("speedUpgradeEnergyUsage", DefaultEnergyUsage.SPEED_UPGRADE, 0, Long.MAX_VALUE); - stackUpgradeEnergyUsage = builder - .comment("The additional energy used by the Stack Upgrade") - .defineInRange("stackUpgradeEnergyUsage", DefaultEnergyUsage.STACK_UPGRADE, 0, Long.MAX_VALUE); - fortune1UpgradeEnergyUsage = builder - .comment("The additional energy used by the Fortune 1 Upgrade") - .defineInRange("fortune1UpgradeEnergyUsage", DefaultEnergyUsage.FORTUNE_1_UPGRADE, 0, Long.MAX_VALUE); - fortune2UpgradeEnergyUsage = builder - .comment("The additional energy used by the Fortune 2 Upgrade") - .defineInRange("fortune2UpgradeEnergyUsage", DefaultEnergyUsage.FORTUNE_2_UPGRADE, 0, Long.MAX_VALUE); - fortune3UpgradeEnergyUsage = builder - .comment("The additional energy used by the Fortune 3 Upgrade") - .defineInRange("fortune3UpgradeEnergyUsage", DefaultEnergyUsage.FORTUNE_3_UPGRADE, 0, Long.MAX_VALUE); - silkTouchUpgradeEnergyUsage = builder - .comment("The additional energy used by the Silk Touch Upgrade") - .defineInRange("silkTouchUpgradeEnergyUsage", DefaultEnergyUsage.SILK_TOUCH_UPGRADE, 0, Long.MAX_VALUE); - regulatorUpgradeEnergyUsage = builder - .comment("The additional energy used by the Regulator Upgrade") - .defineInRange("regulatorUpgradeEnergyUsage", DefaultEnergyUsage.REGULATOR_UPGRADE, 0, Long.MAX_VALUE); - rangeUpgradeEnergyUsage = builder - .comment("The additional energy used by the Range Upgrade") - .defineInRange("rangeUpgradeEnergyUsage", DefaultEnergyUsage.RANGE_UPGRADE, 0, Long.MAX_VALUE); - creativeRangeUpgradeEnergyUsage = builder - .comment("The additional energy used by the Creative Range Upgrade") - .defineInRange( - "creativeRangeUpgradeEnergyUsage", - DefaultEnergyUsage.CREATIVE_RANGE_UPGRADE, - 0, - Long.MAX_VALUE - ); - rangeUpgradeRange = builder - .comment("The additional range by the Range Upgrade") - .defineInRange("rangeUpgradeRange", DefaultEnergyUsage.RANGE_UPGRADE_RANGE, 0, Integer.MAX_VALUE); - builder.pop(); - } - - @Override - public long getSpeedUpgradeEnergyUsage() { - return speedUpgradeEnergyUsage.get(); - } - - @Override - public long getStackUpgradeEnergyUsage() { - return stackUpgradeEnergyUsage.get(); - } - - @Override - public long getFortune1UpgradeEnergyUsage() { - return fortune1UpgradeEnergyUsage.get(); - } - - @Override - public long getFortune2UpgradeEnergyUsage() { - return fortune2UpgradeEnergyUsage.get(); - } - - @Override - public long getFortune3UpgradeEnergyUsage() { - return fortune3UpgradeEnergyUsage.get(); - } - - @Override - public long getSilkTouchUpgradeEnergyUsage() { - return silkTouchUpgradeEnergyUsage.get(); - } - - @Override - public long getRegulatorUpgradeEnergyUsage() { - return regulatorUpgradeEnergyUsage.get(); - } - - @Override - public long getRangeUpgradeEnergyUsage() { - return rangeUpgradeEnergyUsage.get(); - } - - @Override - public long getCreativeRangeUpgradeEnergyUsage() { - return creativeRangeUpgradeEnergyUsage.get(); - } - - @Override - public int getRangeUpgradeRange() { - return rangeUpgradeRange.get(); - } - } - - private class WirelessGridEntryImpl implements WirelessGridEntry { - private final ModConfigSpec.LongValue energyCapacity; - private final ModConfigSpec.LongValue openEnergyUsage; - private final ModConfigSpec.LongValue extractEnergyUsage; - private final ModConfigSpec.LongValue insertEnergyUsage; - - WirelessGridEntryImpl() { - builder.push("wirelessGrid"); - energyCapacity = builder.comment("The energy capacity of the Wireless Grid") - .defineInRange(ENERGY_CAPACITY, DefaultEnergyUsage.WIRELESS_GRID_CAPACITY, 0, Long.MAX_VALUE); - openEnergyUsage = builder.comment("The energy used by the Wireless Grid to open") - .defineInRange("openEnergyUsage", DefaultEnergyUsage.WIRELESS_GRID_OPEN, 0, Long.MAX_VALUE); - extractEnergyUsage = builder.comment("The energy used by the Wireless Grid to extract resources") - .defineInRange("extractEnergyUsage", DefaultEnergyUsage.WIRELESS_GRID_EXTRACT, 0, Long.MAX_VALUE); - insertEnergyUsage = builder.comment("The energy used by the Wireless Grid to insert resources") - .defineInRange("insertEnergyUsage", DefaultEnergyUsage.WIRELESS_GRID_INSERT, 0, Long.MAX_VALUE); - builder.pop(); - } - - public long getEnergyCapacity() { - return energyCapacity.get(); - } - - public long getOpenEnergyUsage() { - return openEnergyUsage.get(); - } - - public long getExtractEnergyUsage() { - return extractEnergyUsage.get(); - } - - public long getInsertEnergyUsage() { - return insertEnergyUsage.get(); - } - } - - private class WirelessTransmitterEntryImpl implements WirelessTransmitterEntry { - private final ModConfigSpec.LongValue energyUsage; - private final ModConfigSpec.IntValue baseRange; - - WirelessTransmitterEntryImpl() { - builder.push("wirelessTransmitter"); - - energyUsage = builder.comment("The energy used by the Wireless Transmitter") - .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.WIRELESS_TRANSMITTER, 0, Long.MAX_VALUE); - baseRange = builder.comment("The base range of the Wireless Transmitter") - .defineInRange("baseRange", DefaultEnergyUsage.WIRELESS_TRANSMITTER_BASE_RANGE, 0, Integer.MAX_VALUE); - - builder.pop(); - } - - public long getEnergyUsage() { - return energyUsage.get(); - } - - public int getBaseRange() { - return baseRange.get(); - } - } - - private class PortableGridEntryImpl implements PortableGridEntry { - private final ModConfigSpec.LongValue energyCapacity; - private final ModConfigSpec.LongValue openEnergyUsage; - private final ModConfigSpec.LongValue extractEnergyUsage; - private final ModConfigSpec.LongValue insertEnergyUsage; - - PortableGridEntryImpl() { - builder.push("portableGrid"); - energyCapacity = builder.comment("The energy capacity of the Portable Grid") - .defineInRange(ENERGY_CAPACITY, DefaultEnergyUsage.PORTABLE_GRID_CAPACITY, 0, Long.MAX_VALUE); - openEnergyUsage = builder.comment("The energy used by the Portable Grid to open") - .defineInRange("openEnergyUsage", DefaultEnergyUsage.PORTABLE_GRID_OPEN, 0, Long.MAX_VALUE); - extractEnergyUsage = builder.comment("The energy used by the Portable Grid to extract resources") - .defineInRange("extractEnergyUsage", DefaultEnergyUsage.PORTABLE_GRID_EXTRACT, 0, Long.MAX_VALUE); - insertEnergyUsage = builder.comment("The energy used by the Portable Grid to insert resources") - .defineInRange("insertEnergyUsage", DefaultEnergyUsage.PORTABLE_GRID_INSERT, 0, Long.MAX_VALUE); - builder.pop(); - } - - public long getEnergyCapacity() { - return energyCapacity.get(); - } - - public long getOpenEnergyUsage() { - return openEnergyUsage.get(); - } - - public long getExtractEnergyUsage() { - return extractEnergyUsage.get(); - } - - public long getInsertEnergyUsage() { - return insertEnergyUsage.get(); - } - } - - private class RelayEntryImpl implements RelayEntry { - private final ModConfigSpec.LongValue inputNetworkEnergyUsage; - private final ModConfigSpec.LongValue outputNetworkEnergyUsage; - - RelayEntryImpl() { - builder.push("relay"); - inputNetworkEnergyUsage = builder.comment("The energy used by the Relay in the input network") - .defineInRange(ENERGY_CAPACITY, DefaultEnergyUsage.RELAY_INPUT_NETWORK, 8, Long.MAX_VALUE); - outputNetworkEnergyUsage = builder.comment( - "The energy used by the Relay in the output network (if not in pass through mode)" - ).defineInRange(ENERGY_CAPACITY, DefaultEnergyUsage.RELAY_OUTPUT_NETWORK, 8, Long.MAX_VALUE); - builder.pop(); - } - - @Override - public long getInputNetworkEnergyUsage() { - return inputNetworkEnergyUsage.get(); - } - - @Override - public long getOutputNetworkEnergyUsage() { - return outputNetworkEnergyUsage.get(); - } - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java deleted file mode 100644 index 97d07acf3..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java +++ /dev/null @@ -1,639 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.network.NetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.AbstractModInitializer; -import com.refinedmods.refinedstorage.platform.common.PlatformProxy; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage.platform.common.content.BlockEntityTypeFactory; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage.platform.common.content.CreativeModeTabItems; -import com.refinedmods.refinedstorage.platform.common.content.DirectRegistryCallback; -import com.refinedmods.refinedstorage.platform.common.content.ExtendedMenuTypeFactory; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.content.MenuTypeFactory; -import com.refinedmods.refinedstorage.platform.common.content.RegistryCallback; -import com.refinedmods.refinedstorage.platform.common.grid.WirelessGridItem; -import com.refinedmods.refinedstorage.platform.common.iface.InterfacePlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.common.security.FallbackSecurityCardItem; -import com.refinedmods.refinedstorage.platform.common.security.SecurityCardItem; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlockItem; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridType; -import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseBlock; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketHandler; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.CraftingGridClearPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.CraftingGridRecipeTransferPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.GridExtractPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.GridInsertPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.GridScrollPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.PropertyChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.ResourceFilterSlotChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.ResourceSlotAmountChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.ResourceSlotChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SecurityCardBoundPlayerPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SecurityCardPermissionPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SecurityCardResetPermissionPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SingleAmountChangePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.StorageInfoRequestPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.UseSlotReferencedItemPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.EnergyInfoPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridActivePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridClearPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridUpdatePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.NetworkTransmitterStatusPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.NoPermissionPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.ResourceSlotUpdatePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.StorageInfoResponsePacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.WirelessTransmitterRangePacket; -import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeItem; -import com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil; -import com.refinedmods.refinedstorage.platform.common.util.ServerEventQueue; -import com.refinedmods.refinedstorage.platform.neoforge.exporter.FluidHandlerExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.neoforge.exporter.ItemHandlerExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.neoforge.grid.strategy.FluidGridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.neoforge.grid.strategy.FluidGridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.neoforge.grid.strategy.ItemGridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.neoforge.grid.strategy.ItemGridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.neoforge.importer.FluidHandlerImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.neoforge.importer.ItemHandlerImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.neoforge.storage.diskdrive.ForgeDiskDriveBlockEntity; -import com.refinedmods.refinedstorage.platform.neoforge.storage.diskinterface.ForgeDiskInterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.neoforge.storage.externalstorage.FluidHandlerPlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.neoforge.storage.externalstorage.ItemHandlerPlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid.ForgePortableGridBlockEntity; -import com.refinedmods.refinedstorage.platform.neoforge.support.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage.platform.neoforge.support.inventory.InsertExtractItemHandler; -import com.refinedmods.refinedstorage.platform.neoforge.support.resource.ResourceContainerFluidHandlerAdapter; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.function.Supplier; - -import net.minecraft.core.component.DataComponentType; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.core.registries.Registries; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.sounds.SoundEvent; -import net.minecraft.world.flag.FeatureFlags; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.RecipeSerializer; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.neoforged.api.distmarker.Dist; -import net.neoforged.bus.api.IEventBus; -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.ModContainer; -import net.neoforged.fml.common.Mod; -import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; -import net.neoforged.fml.loading.FMLEnvironment; -import net.neoforged.neoforge.capabilities.Capabilities; -import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; -import net.neoforged.neoforge.common.NeoForge; -import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; -import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; -import net.neoforged.neoforge.event.level.BlockEvent; -import net.neoforged.neoforge.event.tick.ServerTickEvent; -import net.neoforged.neoforge.items.wrapper.InvWrapper; -import net.neoforged.neoforge.items.wrapper.RangedWrapper; -import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent; -import net.neoforged.neoforge.network.handling.IPayloadHandler; -import net.neoforged.neoforge.network.registration.PayloadRegistrar; -import net.neoforged.neoforge.registries.DeferredRegister; -import net.neoforged.neoforge.registries.RegisterEvent; - -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CREATIVE_PORTABLE_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.CREATIVE_WIRELESS_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.FALLBACK_SECURITY_CARD; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.PORTABLE_GRID; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.REGULATOR_UPGRADE; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.SECURITY_CARD; -import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.WIRELESS_GRID; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.MOD_ID; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; - -@Mod(IdentifierUtil.MOD_ID) -public class ModInitializer extends AbstractModInitializer { - private final DeferredRegister blockRegistry = - DeferredRegister.create(BuiltInRegistries.BLOCK, IdentifierUtil.MOD_ID); - private final DeferredRegister itemRegistry = - DeferredRegister.create(BuiltInRegistries.ITEM, IdentifierUtil.MOD_ID); - private final DeferredRegister> blockEntityTypeRegistry = - DeferredRegister.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, IdentifierUtil.MOD_ID); - private final DeferredRegister> menuTypeRegistry = - DeferredRegister.create(BuiltInRegistries.MENU, IdentifierUtil.MOD_ID); - private final DeferredRegister soundEventRegistry = - DeferredRegister.create(BuiltInRegistries.SOUND_EVENT, IdentifierUtil.MOD_ID); - private final DeferredRegister> recipeSerializerRegistry = - DeferredRegister.create(BuiltInRegistries.RECIPE_SERIALIZER, IdentifierUtil.MOD_ID); - private final DeferredRegister> dataComponentTypeRegistry = - DeferredRegister.create(BuiltInRegistries.DATA_COMPONENT_TYPE, IdentifierUtil.MOD_ID); - - public ModInitializer(final IEventBus eventBus, final ModContainer modContainer) { - PlatformProxy.loadPlatform(new PlatformImpl(modContainer)); - initializePlatformApi(); - registerAdditionalGridInsertionStrategyFactories(); - registerGridExtractionStrategyFactories(); - registerGridScrollingStrategyFactories(); - registerImporterTransferStrategyFactories(); - registerExporterTransferStrategyFactories(); - registerExternalStorageProviderFactories(); - registerContent(eventBus); - registerSounds(eventBus); - registerRecipeSerializers(eventBus); - registerTickHandler(); - - if (FMLEnvironment.dist == Dist.CLIENT) { - eventBus.addListener(ClientModInitializer::onClientSetup); - eventBus.addListener(ClientModInitializer::onRegisterModelGeometry); - eventBus.addListener(ClientModInitializer::onRegisterMenuScreens); - eventBus.addListener(ClientModInitializer::onRegisterKeyMappings); - eventBus.addListener(ClientModInitializer::onRegisterTooltipFactories); - } - - eventBus.addListener(this::onCommonSetup); - eventBus.addListener(this::onRegister); - eventBus.addListener(this::registerNetworkPackets); - eventBus.addListener(this::registerCapabilities); - - NeoForge.EVENT_BUS.addListener(this::registerWrenchingEvent); - NeoForge.EVENT_BUS.addListener(this::registerSecurityBlockBreakEvent); - } - - private void registerAdditionalGridInsertionStrategyFactories() { - PlatformApi.INSTANCE.addGridInsertionStrategyFactory(FluidGridInsertionStrategy::new); - } - - private void registerGridExtractionStrategyFactories() { - PlatformApi.INSTANCE.addGridExtractionStrategyFactory(ItemGridExtractionStrategy::new); - PlatformApi.INSTANCE.addGridExtractionStrategyFactory(FluidGridExtractionStrategy::new); - } - - private void registerGridScrollingStrategyFactories() { - PlatformApi.INSTANCE.addGridScrollingStrategyFactory(ItemGridScrollingStrategy::new); - } - - private void registerImporterTransferStrategyFactories() { - PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().register( - createIdentifier("item"), - new ItemHandlerImporterTransferStrategyFactory() - ); - PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().register( - createIdentifier("fluid"), - new FluidHandlerImporterTransferStrategyFactory() - ); - } - - private void registerExporterTransferStrategyFactories() { - PlatformApi.INSTANCE.getExporterTransferStrategyRegistry().register( - createIdentifier("item"), - new ItemHandlerExporterTransferStrategyFactory() - ); - PlatformApi.INSTANCE.getExporterTransferStrategyRegistry().register( - createIdentifier("fluid"), - new FluidHandlerExporterTransferStrategyFactory() - ); - } - - private void registerExternalStorageProviderFactories() { - PlatformApi.INSTANCE.addExternalStorageProviderFactory(new InterfacePlatformExternalStorageProviderFactory()); - PlatformApi.INSTANCE.addExternalStorageProviderFactory(new ItemHandlerPlatformExternalStorageProviderFactory()); - PlatformApi.INSTANCE.addExternalStorageProviderFactory( - new FluidHandlerPlatformExternalStorageProviderFactory() - ); - } - - private void registerContent(final IEventBus eventBus) { - registerBlocks(eventBus); - registerItems(eventBus); - registerBlockEntities(eventBus); - registerMenus(eventBus); - registerDataComponents(eventBus); - } - - private void registerBlocks(final IEventBus eventBus) { - registerBlocks( - new ForgeRegistryCallback<>(blockRegistry), - ForgeDiskDriveBlockEntity::new, - (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.NORMAL, pos, state), - (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.CREATIVE, pos, state), - ForgeDiskInterfaceBlockEntity::new - ); - blockRegistry.register(eventBus); - } - - private void registerItems(final IEventBus eventBus) { - final RegistryCallback callback = new ForgeRegistryCallback<>(itemRegistry); - registerItems(callback); - registerCustomItems(callback); - itemRegistry.register(eventBus); - } - - private void registerCustomItems(final RegistryCallback callback) { - Items.INSTANCE.setRegulatorUpgrade(callback.register(REGULATOR_UPGRADE, () -> new RegulatorUpgradeItem( - PlatformApi.INSTANCE.getUpgradeRegistry() - ) { - @Override - public boolean shouldCauseReequipAnimation(final ItemStack oldStack, - final ItemStack newStack, - final boolean slotChanged) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - })); - Items.INSTANCE.setWirelessGrid(callback.register(WIRELESS_GRID, () -> new WirelessGridItem() { - @Override - public boolean shouldCauseReequipAnimation(final ItemStack oldStack, - final ItemStack newStack, - final boolean slotChanged) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - })); - Items.INSTANCE.setCreativeWirelessGrid(callback.register( - CREATIVE_WIRELESS_GRID, - () -> new WirelessGridItem() { - @Override - public boolean shouldCauseReequipAnimation(final ItemStack oldStack, - final ItemStack newStack, - final boolean slotChanged) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - } - )); - Items.INSTANCE.setPortableGrid(callback.register(PORTABLE_GRID, () -> new PortableGridBlockItem( - Blocks.INSTANCE.getPortableGrid(), PortableGridType.NORMAL - ) { - @Override - public boolean shouldCauseReequipAnimation(final ItemStack oldStack, - final ItemStack newStack, - final boolean slotChanged) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - })); - Items.INSTANCE.setCreativePortableGrid(callback.register( - CREATIVE_PORTABLE_GRID, - () -> new PortableGridBlockItem(Blocks.INSTANCE.getCreativePortableGrid(), PortableGridType.CREATIVE) { - @Override - public boolean shouldCauseReequipAnimation(final ItemStack oldStack, - final ItemStack newStack, - final boolean slotChanged) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - } - )); - Items.INSTANCE.setSecurityCard(callback.register(SECURITY_CARD, () -> new SecurityCardItem() { - @Override - public boolean shouldCauseReequipAnimation(final ItemStack oldStack, - final ItemStack newStack, - final boolean slotChanged) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - })); - Items.INSTANCE.setFallbackSecurityCard(callback.register( - FALLBACK_SECURITY_CARD, - () -> new FallbackSecurityCardItem() { - @Override - public boolean shouldCauseReequipAnimation(final ItemStack oldStack, - final ItemStack newStack, - final boolean slotChanged) { - return AbstractModInitializer.allowComponentsUpdateAnimation(oldStack, newStack); - } - } - )); - } - - private void registerBlockEntities(final IEventBus eventBus) { - registerBlockEntities( - new ForgeRegistryCallback<>(blockEntityTypeRegistry), - new BlockEntityTypeFactory() { - @Override - public BlockEntityType create(final BlockEntitySupplier factory, - final Block... allowedBlocks) { - return new BlockEntityType<>(factory::create, new HashSet<>(Arrays.asList(allowedBlocks)), null); - } - }, - ForgeDiskDriveBlockEntity::new, - (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.NORMAL, pos, state), - (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.CREATIVE, pos, state), - ForgeDiskInterfaceBlockEntity::new - ); - blockEntityTypeRegistry.register(eventBus); - } - - private void registerMenus(final IEventBus eventBus) { - registerMenus(new ForgeRegistryCallback<>(menuTypeRegistry), new MenuTypeFactory() { - @Override - public MenuType create(final MenuSupplier supplier) { - return new MenuType<>(supplier::create, FeatureFlags.DEFAULT_FLAGS); - } - }, new ExtendedMenuTypeFactory() { - @Override - public MenuType create(final MenuSupplier supplier, - final StreamCodec - streamCodec) { - return IMenuTypeExtension.create((syncId, inventory, buf) -> { - final D data = streamCodec.decode(buf); - return supplier.create(syncId, inventory, data); - }); - } - }); - menuTypeRegistry.register(eventBus); - } - - private void registerDataComponents(final IEventBus eventBus) { - final RegistryCallback> callback = new ForgeRegistryCallback<>(dataComponentTypeRegistry); - registerDataComponents(callback); - dataComponentTypeRegistry.register(eventBus); - } - - private void registerCapabilities(final RegisterCapabilitiesEvent event) { - event.registerBlockEntity( - Capabilities.ItemHandler.BLOCK, - BlockEntities.INSTANCE.getDiskDrive(), - (be, side) -> new InvWrapper(be.getDiskInventory()) - ); - event.registerBlockEntity( - Capabilities.ItemHandler.BLOCK, - BlockEntities.INSTANCE.getInterface(), - (be, side) -> new InvWrapper(be.getExportedResourcesAsContainer()) - ); - event.registerBlockEntity( - Capabilities.FluidHandler.BLOCK, - BlockEntities.INSTANCE.getInterface(), - (be, side) -> new ResourceContainerFluidHandlerAdapter(be.getExportedResources()) - ); - event.registerBlockEntity( - Capabilities.EnergyStorage.BLOCK, - BlockEntities.INSTANCE.getController(), - (be, side) -> new EnergyStorageAdapter(be.getEnergyStorage()) - ); - event.registerBlockEntity( - Capabilities.EnergyStorage.BLOCK, - BlockEntities.INSTANCE.getPortableGrid(), - (be, side) -> new EnergyStorageAdapter(be.getEnergyStorage()) - ); - event.registerItem( - Capabilities.EnergyStorage.ITEM, - (stack, ctx) -> new EnergyStorageAdapter(Items.INSTANCE.getWirelessGrid().createEnergyStorage(stack)), - Items.INSTANCE.getWirelessGrid() - ); - Items.INSTANCE.getControllers().forEach(controllerItem -> event.registerItem( - Capabilities.EnergyStorage.ITEM, - (stack, ctx) -> new EnergyStorageAdapter(controllerItem.get().createEnergyStorage(stack)), - controllerItem.get() - )); - event.registerItem( - Capabilities.EnergyStorage.ITEM, - (stack, ctx) -> new EnergyStorageAdapter(PortableGridBlockItem.createEnergyStorage(stack)), - Items.INSTANCE.getPortableGrid() - ); - event.registerBlockEntity( - Capabilities.ItemHandler.BLOCK, - BlockEntities.INSTANCE.getDiskInterface(), - (be, side) -> { - final InvWrapper wrapper = new InvWrapper(be.getDiskInventory()); - return new InsertExtractItemHandler( - new RangedWrapper( - wrapper, - 0, - AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS / 2 - ), - new RangedWrapper( - wrapper, - AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS / 2, - AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS - ) - ); - } - ); - } - - private void registerSounds(final IEventBus eventBus) { - registerSounds(new ForgeRegistryCallback<>(soundEventRegistry)); - soundEventRegistry.register(eventBus); - } - - private void registerRecipeSerializers(final IEventBus eventBus) { - registerRecipeSerializers(new ForgeRegistryCallback<>(recipeSerializerRegistry)); - recipeSerializerRegistry.register(eventBus); - } - - private void registerTickHandler() { - NeoForge.EVENT_BUS.addListener(this::onServerTick); - } - - @SubscribeEvent - public void onCommonSetup(final FMLCommonSetupEvent e) { - registerUpgradeMappings(); - } - - @SubscribeEvent - public void onRegister(final RegisterEvent e) { - e.register( - Registries.LOOT_FUNCTION_TYPE, - helper -> registerLootFunctions(new DirectRegistryCallback<>(BuiltInRegistries.LOOT_FUNCTION_TYPE)) - ); - e.register(Registries.CREATIVE_MODE_TAB, helper -> helper.register( - createIdentifier("general"), - CreativeModeTab.builder() - .title(ContentNames.MOD) - .icon(() -> new ItemStack(Blocks.INSTANCE.getCreativeController().getDefault())) - .displayItems((params, output) -> CreativeModeTabItems.append(output::accept)) - .build() - )); - } - - @SubscribeEvent - public void registerWrenchingEvent(final PlayerInteractEvent.RightClickBlock e) { - final Level level = e.getLevel(); - final BlockState state = level.getBlockState(e.getHitVec().getBlockPos()); - if (!(state.getBlock() instanceof AbstractBaseBlock block)) { - return; - } - block.tryUseWrench(state, level, e.getHitVec(), e.getEntity(), e.getHand()).or(() -> block.tryUpdateColor( - state, - level, - e.getHitVec().getBlockPos(), - e.getEntity(), - e.getHand() - )).ifPresent(result -> { - e.setCanceled(true); - e.setCancellationResult(result); - }); - } - - @SubscribeEvent - public void registerSecurityBlockBreakEvent(final BlockEvent.BreakEvent e) { - final BlockEntity blockEntity = e.getLevel().getBlockEntity(e.getPos()); - if (blockEntity instanceof NetworkNodeContainerBlockEntity networkNodeContainerBlockEntity - && e.getPlayer() instanceof ServerPlayer serverPlayer - && !networkNodeContainerBlockEntity.canBuild(serverPlayer)) { - PlatformApi.INSTANCE.sendNoPermissionMessage( - serverPlayer, - createTranslation("misc", "no_permission.build.break", e.getState().getBlock().getName()) - ); - e.setCanceled(true); - } - } - - @SubscribeEvent - public void registerNetworkPackets(final RegisterPayloadHandlersEvent event) { - final PayloadRegistrar registrar = event.registrar(MOD_ID); - registerServerToClientPackets(registrar); - registerClientToServerPackets(registrar); - } - - private static void registerServerToClientPackets(final PayloadRegistrar registrar) { - registrar.playToClient( - EnergyInfoPacket.PACKET_TYPE, - EnergyInfoPacket.STREAM_CODEC, - wrapHandler(EnergyInfoPacket::handle) - ); - registrar.playToClient( - GridActivePacket.PACKET_TYPE, - GridActivePacket.STREAM_CODEC, - wrapHandler(GridActivePacket::handle) - ); - registrar.playToClient( - GridClearPacket.PACKET_TYPE, - GridClearPacket.STREAM_CODEC, - wrapHandler((packet, ctx) -> GridClearPacket.handle(ctx)) - ); - registrar.playToClient( - GridUpdatePacket.PACKET_TYPE, - GridUpdatePacket.STREAM_CODEC, - wrapHandler(GridUpdatePacket::handle) - ); - registrar.playToClient( - NetworkTransmitterStatusPacket.PACKET_TYPE, - NetworkTransmitterStatusPacket.STREAM_CODEC, - wrapHandler(NetworkTransmitterStatusPacket::handle) - ); - registrar.playToClient( - ResourceSlotUpdatePacket.PACKET_TYPE, - ResourceSlotUpdatePacket.STREAM_CODEC, - wrapHandler(ResourceSlotUpdatePacket::handle) - ); - registrar.playToClient( - StorageInfoResponsePacket.PACKET_TYPE, - StorageInfoResponsePacket.STREAM_CODEC, - wrapHandler((packet, ctx) -> StorageInfoResponsePacket.handle(packet)) - ); - registrar.playToClient( - WirelessTransmitterRangePacket.PACKET_TYPE, - WirelessTransmitterRangePacket.STREAM_CODEC, - wrapHandler(WirelessTransmitterRangePacket::handle) - ); - registrar.playToClient( - NoPermissionPacket.PACKET_TYPE, - NoPermissionPacket.STREAM_CODEC, - wrapHandler((packet, ctx) -> NoPermissionPacket.handle(packet)) - ); - } - - private static void registerClientToServerPackets(final PayloadRegistrar registrar) { - registrar.playToServer( - CraftingGridClearPacket.PACKET_TYPE, - CraftingGridClearPacket.STREAM_CODEC, - wrapHandler(CraftingGridClearPacket::handle) - ); - registrar.playToServer( - CraftingGridRecipeTransferPacket.PACKET_TYPE, - CraftingGridRecipeTransferPacket.STREAM_CODEC, - wrapHandler(CraftingGridRecipeTransferPacket::handle) - ); - registrar.playToServer( - GridExtractPacket.PACKET_TYPE, - GridExtractPacket.STREAM_CODEC, - wrapHandler(GridExtractPacket::handle) - ); - registrar.playToServer( - GridInsertPacket.PACKET_TYPE, - GridInsertPacket.STREAM_CODEC, - wrapHandler(GridInsertPacket::handle) - ); - registrar.playToServer( - GridScrollPacket.PACKET_TYPE, - GridScrollPacket.STREAM_CODEC, - wrapHandler(GridScrollPacket::handle) - ); - registrar.playToServer( - PropertyChangePacket.PACKET_TYPE, - PropertyChangePacket.STREAM_CODEC, - wrapHandler(PropertyChangePacket::handle) - ); - registrar.playToServer( - ResourceFilterSlotChangePacket.PACKET_TYPE, - ResourceFilterSlotChangePacket.STREAM_CODEC, - wrapHandler(ResourceFilterSlotChangePacket::handle) - ); - registrar.playToServer( - ResourceSlotAmountChangePacket.PACKET_TYPE, - ResourceSlotAmountChangePacket.STREAM_CODEC, - wrapHandler(ResourceSlotAmountChangePacket::handle) - ); - registrar.playToServer( - ResourceSlotChangePacket.PACKET_TYPE, - ResourceSlotChangePacket.STREAM_CODEC, - wrapHandler(ResourceSlotChangePacket::handle) - ); - registrar.playToServer( - SingleAmountChangePacket.PACKET_TYPE, - SingleAmountChangePacket.STREAM_CODEC, - wrapHandler(SingleAmountChangePacket::handle) - ); - registrar.playToServer( - StorageInfoRequestPacket.PACKET_TYPE, - StorageInfoRequestPacket.STREAM_CODEC, - wrapHandler(StorageInfoRequestPacket::handle) - ); - registrar.playToServer( - UseSlotReferencedItemPacket.PACKET_TYPE, - UseSlotReferencedItemPacket.STREAM_CODEC, - wrapHandler(UseSlotReferencedItemPacket::handle) - ); - registrar.playToServer( - SecurityCardPermissionPacket.PACKET_TYPE, - SecurityCardPermissionPacket.STREAM_CODEC, - wrapHandler(SecurityCardPermissionPacket::handle) - ); - registrar.playToServer( - SecurityCardResetPermissionPacket.PACKET_TYPE, - SecurityCardResetPermissionPacket.STREAM_CODEC, - wrapHandler(SecurityCardResetPermissionPacket::handle) - ); - registrar.playToServer( - SecurityCardBoundPlayerPacket.PACKET_TYPE, - SecurityCardBoundPlayerPacket.STREAM_CODEC, - wrapHandler(SecurityCardBoundPlayerPacket::handle) - ); - } - - private static IPayloadHandler wrapHandler(final PacketHandler handler) { - return (packet, ctx) -> handler.handle(packet, ctx::player); - } - - @SubscribeEvent - public void onServerTick(final ServerTickEvent.Pre e) { - ServerEventQueue.runQueuedActions(); - } - - private record ForgeRegistryCallback(DeferredRegister registry) implements RegistryCallback { - @Override - public Supplier register(final ResourceLocation id, final Supplier value) { - return registry.register(id.getPath(), value); - } - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/PlatformImpl.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/PlatformImpl.java deleted file mode 100644 index 9fe267ffb..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/PlatformImpl.java +++ /dev/null @@ -1,325 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.platform.common.AbstractPlatform; -import com.refinedmods.refinedstorage.platform.common.Config; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.TransferManager; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.util.CustomBlockPlaceContext; -import com.refinedmods.refinedstorage.platform.neoforge.grid.strategy.ItemGridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.neoforge.grid.view.ForgeFluidGridResourceFactory; -import com.refinedmods.refinedstorage.platform.neoforge.grid.view.ForgeItemGridResourceFactory; -import com.refinedmods.refinedstorage.platform.neoforge.support.containermenu.ContainerTransferDestination; -import com.refinedmods.refinedstorage.platform.neoforge.support.containermenu.MenuOpenerImpl; -import com.refinedmods.refinedstorage.platform.neoforge.support.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.FluidStackFluidRenderer; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.UUID; -import javax.annotation.Nullable; - -import com.mojang.blaze3d.platform.InputConstants; -import net.minecraft.client.KeyMapping; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.components.EditBox; -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.client.gui.screens.inventory.tooltip.DefaultTooltipPositioner; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.NonNullList; -import net.minecraft.network.chat.Component; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.sounds.SoundEvent; -import net.minecraft.world.Container; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.CraftingContainer; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.context.BlockPlaceContext; -import net.minecraft.world.item.crafting.CraftingInput; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.LevelReader; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.LiquidBlock; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.Vec3; -import net.neoforged.fml.ModContainer; -import net.neoforged.fml.config.ModConfig; -import net.neoforged.neoforge.capabilities.Capabilities; -import net.neoforged.neoforge.client.ClientHooks; -import net.neoforged.neoforge.common.CommonHooks; -import net.neoforged.neoforge.common.NeoForge; -import net.neoforged.neoforge.common.util.FakePlayerFactory; -import net.neoforged.neoforge.event.EventHooks; -import net.neoforged.neoforge.event.level.BlockEvent; -import net.neoforged.neoforge.fluids.FluidActionResult; -import net.neoforged.neoforge.fluids.FluidStack; -import net.neoforged.neoforge.fluids.FluidType; -import net.neoforged.neoforge.fluids.FluidUtil; -import net.neoforged.neoforge.fluids.capability.IFluidHandler; -import net.neoforged.neoforge.fluids.capability.templates.FluidTank; -import net.neoforged.neoforge.items.ItemHandlerHelper; -import net.neoforged.neoforge.items.wrapper.InvWrapper; -import net.neoforged.neoforge.network.PacketDistributor; - -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.ofFluidStack; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidStack; - -public final class PlatformImpl extends AbstractPlatform { - private final ConfigImpl config = new ConfigImpl(); - - public PlatformImpl(final ModContainer modContainer) { - super(new MenuOpenerImpl(), new FluidStackFluidRenderer(), ItemGridInsertionStrategy::new); - modContainer.registerConfig(ModConfig.Type.COMMON, config.getSpec()); - } - - @Override - public long getBucketAmount() { - return FluidType.BUCKET_VOLUME; - } - - @Override - public Config getConfig() { - return config; - } - - @Override - public boolean canEditBoxLoseFocus(final EditBox editBox) { - return editBox.canLoseFocus; - } - - @Override - public boolean isKeyDown(final KeyMapping keyMapping) { - return !keyMapping.isUnbound() && InputConstants.isKeyDown( - Minecraft.getInstance().getWindow().getWindow(), - keyMapping.getKey().getValue() - ); - } - - @Override - public GridResourceFactory getItemGridResourceFactory() { - return new ForgeItemGridResourceFactory(); - } - - @Override - public GridResourceFactory getFluidGridResourceFactory() { - return new ForgeFluidGridResourceFactory(); - } - - @Override - public Optional getContainedFluid(final ItemStack stack) { - final FluidTank tank = new FluidTank(Integer.MAX_VALUE); - final FluidActionResult result = FluidUtil.tryEmptyContainer( - stack, - tank, - Integer.MAX_VALUE, - null, - true - ); - if (!result.isSuccess() || tank.isEmpty()) { - return Optional.empty(); - } - final FluidResource fluidResource = ofFluidStack(tank.getFluid()); - return Optional.of(new ContainedFluid( - result.getResult(), - fluidResource, - tank.getFluidAmount() - )); - } - - @Override - public Optional convertToBucket(final FluidResource fluidResource) { - return Optional.ofNullable( - new ItemStack(Items.BUCKET).getCapability(Capabilities.FluidHandler.ITEM) - ).map(dest -> { - dest.fill( - toFluidStack(fluidResource, FluidType.BUCKET_VOLUME), - IFluidHandler.FluidAction.EXECUTE - ); - return dest.getContainer(); - }); - } - - @Override - public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) { - return new TransferManager(containerMenu, ContainerTransferDestination::new); - } - - @Override - public long insertIntoContainer(final Container container, - final ItemResource itemResource, - final long amount, - final Action action) { - final InvWrapper wrapper = new InvWrapper(container); - final ItemStack stack = itemResource.toItemStack(amount); - final ItemStack remainder = ItemHandlerHelper.insertItem(wrapper, stack, action == Action.SIMULATE); - return amount - remainder.getCount(); - } - - @Override - public ItemStack getCloneItemStack(final BlockState state, - final Level level, - final BlockHitResult hitResult, - final Player player) { - return state.getCloneItemStack(hitResult, level, hitResult.getBlockPos(), player); - } - - @Override - @SuppressWarnings("DataFlowIssue") // NeoForge allows null - public NonNullList getRemainingCraftingItems(final Player player, - final CraftingRecipe craftingRecipe, - final CraftingInput input) { - CommonHooks.setCraftingPlayer(player); - final NonNullList remainingItems = craftingRecipe.getRemainingItems(input); - CommonHooks.setCraftingPlayer(null); - return remainingItems; - } - - @Override - public void onItemCrafted(final Player player, final ItemStack craftedStack, final CraftingContainer container) { - EventHooks.firePlayerCraftingEvent(player, craftedStack, container); - } - - @Override - public Player getFakePlayer(final ServerLevel level, @Nullable final UUID playerId) { - return Optional.ofNullable(playerId) - .flatMap(id -> level.getServer().getProfileCache().get(id)) - .map(profile -> FakePlayerFactory.get(level, profile)) - .orElseGet(() -> FakePlayerFactory.getMinecraft(level)); - } - - @Override - public boolean canBreakBlock(final Level level, final BlockPos pos, final BlockState state, final Player player) { - final BlockEvent.BreakEvent e = new BlockEvent.BreakEvent(level, pos, state, player); - return !NeoForge.EVENT_BUS.post(e).isCanceled(); - } - - @Override - public boolean placeBlock( - final Level level, - final BlockPos pos, - final Direction direction, - final Player player, - final ItemStack stack - ) { - final BlockPlaceContext ctx = new CustomBlockPlaceContext( - level, - player, - InteractionHand.MAIN_HAND, - stack, - new BlockHitResult(Vec3.ZERO, direction, pos, false) - ); - final InteractionResult result = CommonHooks.onPlaceItemIntoWorld(ctx); - return result.consumesAction(); - } - - @Override - public boolean placeFluid( - final Level level, - final BlockPos pos, - final Direction direction, - final Player player, - final FluidResource fluidResource - ) { - if (level.getBlockState(pos).getFluidState().isSource()) { - return false; - } - final FluidStack stack = toFluidStack(fluidResource, FluidType.BUCKET_VOLUME); - final FluidTank tank = new FluidTank(FluidType.BUCKET_VOLUME); - tank.fill(stack, IFluidHandler.FluidAction.EXECUTE); - return FluidUtil.tryPlaceFluid( - player, - level, - InteractionHand.MAIN_HAND, - pos, - tank, - toFluidStack(fluidResource, FluidType.BUCKET_VOLUME) - ); - } - - @Override - public ItemStack getBlockAsItemStack(final Block block, - final BlockState state, - final Direction direction, - final LevelReader level, - final BlockPos position, - final Player player) { - return block.getCloneItemStack( - state, - new BlockHitResult(Vec3.ZERO, direction, position, false), - level, - position, - player - ); - } - - @Override - public Optional getBucketPickupSound(final LiquidBlock liquidBlock, final BlockState state) { - return liquidBlock.getPickupSound(state); - } - - @Override - public List processTooltipComponents( - final ItemStack stack, - final GuiGraphics graphics, - final int mouseX, - final Optional imageComponent, - final List components - ) { - return new ArrayList<>(ClientHooks.gatherTooltipComponents( - stack, - components, - imageComponent, - mouseX, - graphics.guiWidth(), - graphics.guiHeight(), - Minecraft.getInstance().font - )); // make modifiable - } - - @Override - public void renderTooltip(final GuiGraphics graphics, - final List components, - final int x, - final int y) { - graphics.renderTooltipInternal( - Minecraft.getInstance().font, - components, - x, - y, - DefaultTooltipPositioner.INSTANCE - ); - } - - @Override - public Optional getEnergyStorage(final ItemStack stack) { - return Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM)) - .filter(EnergyStorageAdapter.class::isInstance) - .map(EnergyStorageAdapter.class::cast) - .map(EnergyStorageAdapter::getEnergyStorage); - } - - @Override - public void sendPacketToServer(final T packet) { - PacketDistributor.sendToServer(packet); - } - - @Override - public void sendPacketToClient(final ServerPlayer player, final T packet) { - PacketDistributor.sendToPlayer(player, packet); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/loot/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/loot/package-info.java deleted file mode 100644 index 9bc99f9e5..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/loot/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.datagen.loot; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/package-info.java deleted file mode 100644 index 0180e5c80..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.datagen; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/recipe/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/recipe/package-info.java deleted file mode 100644 index d2939e72c..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/recipe/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.datagen.recipe; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/tag/ItemTagsProviderImpl.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/tag/ItemTagsProviderImpl.java deleted file mode 100644 index 18b4f10eb..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/tag/ItemTagsProviderImpl.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.datagen.tag; - -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage.platform.common.support.BaseBlockItem; - -import java.util.Arrays; -import java.util.Collection; -import java.util.concurrent.CompletableFuture; -import java.util.function.Supplier; - -import net.minecraft.core.HolderLookup; -import net.minecraft.data.PackOutput; -import net.minecraft.data.tags.ItemTagsProvider; -import net.minecraft.data.tags.TagsProvider; -import net.minecraft.tags.TagKey; -import net.minecraft.world.item.Item; -import net.minecraft.world.level.block.Block; -import net.neoforged.neoforge.common.data.ExistingFileHelper; - -import static com.refinedmods.refinedstorage.platform.common.content.Tags.CABLES; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.CONSTRUCTORS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.CONTROLLERS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.CRAFTING_GRIDS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.CREATIVE_CONTROLLERS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.DESTRUCTORS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.DETECTORS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.DISK_INTERFACES; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.EXPORTERS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.EXTERNAL_STORAGES; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.FLUID_STORAGE_DISKS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.GRIDS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.IMPORTERS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.NETWORK_RECEIVERS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.NETWORK_TRANSMITTERS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.RELAYS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.SECURITY_MANAGERS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.STORAGE_DISKS; -import static com.refinedmods.refinedstorage.platform.common.content.Tags.WIRELESS_TRANSMITTERS; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.MOD_ID; - -public class ItemTagsProviderImpl extends ItemTagsProvider { - public ItemTagsProviderImpl(final PackOutput packOutput, - final CompletableFuture registries, - final TagsProvider blockTagsProvider, - final ExistingFileHelper existingFileHelper) { - super(packOutput, registries, blockTagsProvider.contentsGetter(), MOD_ID, existingFileHelper); - } - - @Override - protected void addTags(final HolderLookup.Provider provider) { - addAllToTag2(CABLES, Items.INSTANCE.getCables()); - addAllToTag(CONTROLLERS, Items.INSTANCE.getControllers()); - addAllToTag(CREATIVE_CONTROLLERS, Blocks.INSTANCE.getCreativeController().values().stream() - .map(Block::asItem) - .map(c -> (Supplier) () -> c) - .toList()); - addAllToTag(FLUID_STORAGE_DISKS, - Arrays.stream(FluidStorageType.Variant.values()) - .filter(variant -> variant != FluidStorageType.Variant.CREATIVE) - .map(Items.INSTANCE::getFluidStorageDisk) - .map(t -> (Supplier) () -> t) - .toList()); - addAllToTag(GRIDS, - Blocks.INSTANCE.getGrid().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(CRAFTING_GRIDS, - Blocks.INSTANCE.getCraftingGrid().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(STORAGE_DISKS, - Arrays.stream(ItemStorageType.Variant.values()) - .filter(variant -> variant != ItemStorageType.Variant.CREATIVE) - .map(Items.INSTANCE::getItemStorageDisk) - .map(t -> (Supplier) () -> t) - .toList()); - addAllToTag(IMPORTERS, - Blocks.INSTANCE.getImporter().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(EXPORTERS, - Blocks.INSTANCE.getExporter().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(EXTERNAL_STORAGES, - Blocks.INSTANCE.getExternalStorage().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(DETECTORS, - Blocks.INSTANCE.getDetector().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(CONSTRUCTORS, - Blocks.INSTANCE.getConstructor().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(DESTRUCTORS, - Blocks.INSTANCE.getDestructor().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(WIRELESS_TRANSMITTERS, - Blocks.INSTANCE.getWirelessTransmitter().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(NETWORK_RECEIVERS, - Blocks.INSTANCE.getNetworkReceiver().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(NETWORK_TRANSMITTERS, - Blocks.INSTANCE.getNetworkTransmitter().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(SECURITY_MANAGERS, - Blocks.INSTANCE.getSecurityManager().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(RELAYS, - Blocks.INSTANCE.getRelay().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - addAllToTag(DISK_INTERFACES, - Blocks.INSTANCE.getDiskInterface().values().stream() - .map(block -> (Supplier) block::asItem) - .toList()); - } - - private void addAllToTag(final TagKey t, final Collection> items) { - tag(t).add(items.stream().map(Supplier::get).toArray(Item[]::new)).replace(false); - } - - private void addAllToTag2(final TagKey t, final Collection> items) { - tag(t).add(items.stream().map(Supplier::get).toArray(Item[]::new)).replace(false); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/tag/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/tag/package-info.java deleted file mode 100644 index 9ffb1ad2f..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/datagen/tag/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.datagen.tag; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/exporter/FluidHandlerExporterTransferStrategyFactory.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/exporter/FluidHandlerExporterTransferStrategyFactory.java deleted file mode 100644 index c58b265f4..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/exporter/FluidHandlerExporterTransferStrategyFactory.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.exporter; - -import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterTransferStrategyImpl; -import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.exporter.FuzzyExporterTransferStrategy; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCache; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCacheImpl; -import com.refinedmods.refinedstorage.platform.neoforge.storage.FluidHandlerInsertableStorage; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; - -public class FluidHandlerExporterTransferStrategyFactory implements ExporterTransferStrategyFactory { - @Override - public ExporterTransferStrategy create(final ServerLevel level, - final BlockPos pos, - final Direction direction, - final UpgradeState upgradeState, - final AmountOverride amountOverride, - final boolean fuzzyMode) { - final CapabilityCache coordinates = new CapabilityCacheImpl(level, pos, direction); - final FluidHandlerInsertableStorage destination = new FluidHandlerInsertableStorage( - coordinates, - amountOverride - ); - final long transferQuota = (upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1) - * Platform.INSTANCE.getBucketAmount(); - if (fuzzyMode) { - return new FuzzyExporterTransferStrategy(destination, transferQuota); - } - return new ExporterTransferStrategyImpl(destination, transferQuota); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/exporter/ItemHandlerExporterTransferStrategyFactory.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/exporter/ItemHandlerExporterTransferStrategyFactory.java deleted file mode 100644 index cd90beb86..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/exporter/ItemHandlerExporterTransferStrategyFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.exporter; - -import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterTransferStrategyImpl; -import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.common.exporter.FuzzyExporterTransferStrategy; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCacheImpl; -import com.refinedmods.refinedstorage.platform.neoforge.storage.ItemHandlerInsertableStorage; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; - -public class ItemHandlerExporterTransferStrategyFactory implements ExporterTransferStrategyFactory { - @Override - public ExporterTransferStrategy create(final ServerLevel level, - final BlockPos pos, - final Direction direction, - final UpgradeState upgradeState, - final AmountOverride amountOverride, - final boolean fuzzyMode) { - final CapabilityCacheImpl coordinates = new CapabilityCacheImpl(level, pos, direction); - final ItemHandlerInsertableStorage destination = new ItemHandlerInsertableStorage(coordinates, amountOverride); - final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; - if (fuzzyMode) { - return new FuzzyExporterTransferStrategy(destination, transferQuota); - } - return new ExporterTransferStrategyImpl(destination, transferQuota); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/exporter/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/exporter/package-info.java deleted file mode 100644 index 20d03298c..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/exporter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.exporter; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/FluidGridExtractionStrategy.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/FluidGridExtractionStrategy.java deleted file mode 100644 index 6a331fe15..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/FluidGridExtractionStrategy.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; - -import javax.annotation.Nullable; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.neoforged.neoforge.capabilities.Capabilities; -import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; -import net.neoforged.neoforge.items.IItemHandler; -import net.neoforged.neoforge.items.ItemHandlerHelper; -import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; - -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidAction; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidStack; - -public class FluidGridExtractionStrategy implements GridExtractionStrategy { - private static final ItemResource BUCKET_ITEM_RESOURCE = new ItemResource(Items.BUCKET); - - private final AbstractContainerMenu menu; - private final GridOperations gridOperations; - private final PlayerMainInvWrapper playerInventoryStorage; - private final Storage itemStorage; - - public FluidGridExtractionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - this.menu = containerMenu; - this.gridOperations = grid.createOperations(ResourceTypes.FLUID, player); - this.playerInventoryStorage = new PlayerMainInvWrapper(player.getInventory()); - this.itemStorage = grid.getItemStorage(); - } - - @Override - public boolean onExtract(final PlatformResourceKey resource, - final GridExtractMode extractMode, - final boolean cursor) { - if (resource instanceof FluidResource fluidResource) { - final boolean bucketInInventory = hasBucketInInventory(); - final boolean bucketInStorageChannel = hasBucketInStorage(); - if (bucketInInventory) { - extract(fluidResource, extractMode, cursor, true); - } else if (bucketInStorageChannel) { - extract(fluidResource, extractMode, cursor, false); - } - return true; - } - return false; - } - - @Nullable - private IFluidHandlerItem getFluidStorage(final ItemStack stack) { - return stack.getCapability(Capabilities.FluidHandler.ITEM); - } - - private void extract(final FluidResource fluidResource, - final GridExtractMode mode, - final boolean cursor, - final boolean bucketFromInventory) { - final IFluidHandlerItem destination = getFluidStorage(BUCKET_ITEM_RESOURCE.toItemStack()); - if (destination == null) { - return; // shouldn't happen - } - gridOperations.extract(fluidResource, mode, (resource, amount, action, source) -> { - if (!(resource instanceof FluidResource fluidResource2)) { - return 0; - } - final int inserted = destination.fill(toFluidStack(fluidResource2, amount), toFluidAction(action)); - if (action == Action.EXECUTE) { - extractSourceBucket(bucketFromInventory, source); - if (!insertResultingBucket(cursor, destination)) { - insertSourceBucket(bucketFromInventory, source); - return 0; - } - } - return inserted; - }); - } - - private void extractSourceBucket(final boolean bucketFromInventory, final Actor actor) { - if (bucketFromInventory) { - extractBucket(playerInventoryStorage, Action.EXECUTE); - } else { - itemStorage.extract(BUCKET_ITEM_RESOURCE, 1, Action.EXECUTE, actor); - } - } - - private void insertSourceBucket(final boolean bucketFromInventory, final Actor actor) { - if (bucketFromInventory) { - insertBucket(playerInventoryStorage); - } else { - itemStorage.insert(BUCKET_ITEM_RESOURCE, 1, Action.EXECUTE, actor); - } - } - - private boolean insertResultingBucket(final boolean cursor, final IFluidHandlerItem destination) { - if (cursor) { - menu.setCarried(destination.getContainer()); - return true; - } else { - final ItemStack remainder = ItemHandlerHelper.insertItem( - playerInventoryStorage, - destination.getContainer(), - false - ); - return remainder.isEmpty(); - } - } - - private boolean hasBucketInStorage() { - return itemStorage.extract(BUCKET_ITEM_RESOURCE, 1, Action.SIMULATE, EmptyActor.INSTANCE) == 1; - } - - private boolean hasBucketInInventory() { - return extractBucket(playerInventoryStorage, Action.SIMULATE); - } - - private boolean extractBucket(final IItemHandler source, final Action action) { - final ItemStack toExtractStack = BUCKET_ITEM_RESOURCE.toItemStack(); - for (int slot = 0; slot < source.getSlots(); ++slot) { - final boolean relevant = isSame(source.getStackInSlot(slot), toExtractStack); - if (!relevant) { - continue; - } - if (source.extractItem(slot, 1, action == Action.SIMULATE).getCount() == 1) { - return true; - } - } - return false; - } - - private void insertBucket(final IItemHandler destination) { - ItemHandlerHelper.insertItem(destination, BUCKET_ITEM_RESOURCE.toItemStack(), false); - } - - private boolean isSame(final ItemStack a, final ItemStack b) { - return ItemStack.isSameItemSameComponents(a, b); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/FluidGridInsertionStrategy.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/FluidGridInsertionStrategy.java deleted file mode 100644 index 46b48a635..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/FluidGridInsertionStrategy.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; - -import javax.annotation.Nullable; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.capabilities.Capabilities; -import net.neoforged.neoforge.fluids.FluidStack; -import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; - -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.ofFluidStack; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidAction; -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidStack; - -public class FluidGridInsertionStrategy implements GridInsertionStrategy { - private final AbstractContainerMenu menu; - private final GridOperations gridOperations; - - public FluidGridInsertionStrategy(final AbstractContainerMenu menu, final ServerPlayer player, final Grid grid) { - this.menu = menu; - this.gridOperations = grid.createOperations(ResourceTypes.FLUID, player); - } - - @Override - public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { - final IFluidHandlerItem cursorStorage = getFluidCursorStorage(); - if (cursorStorage == null) { - return false; - } - final FluidStack extractableResource = cursorStorage.getFluidInTank(0); - if (extractableResource.isEmpty()) { - return false; - } - final FluidResource fluidResource = ofFluidStack(extractableResource); - gridOperations.insert(fluidResource, insertMode, (resource, amount, action, source) -> { - if (!(resource instanceof FluidResource fluidResource2)) { - return 0; - } - final FluidStack toDrain = toFluidStack( - fluidResource2, - amount == Long.MAX_VALUE ? Integer.MAX_VALUE : amount - ); - final FluidStack drained = cursorStorage.drain(toDrain, toFluidAction(action)); - if (action == Action.EXECUTE) { - menu.setCarried(cursorStorage.getContainer()); - } - return drained.getAmount(); - }); - return true; - } - - @Nullable - private IFluidHandlerItem getFluidCursorStorage() { - return getFluidStorage(menu.getCarried()); - } - - @Nullable - private IFluidHandlerItem getFluidStorage(final ItemStack stack) { - return stack.getCapability(Capabilities.FluidHandler.ITEM); - } - - @Override - public boolean onTransfer(final int slotIndex) { - throw new UnsupportedOperationException(); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/ItemGridExtractionStrategy.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/ItemGridExtractionStrategy.java deleted file mode 100644 index cc30ab2f2..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/ItemGridExtractionStrategy.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.grid.strategy; - -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCache; -import com.refinedmods.refinedstorage.platform.neoforge.storage.ItemHandlerInsertableStorage; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.neoforged.neoforge.items.IItemHandler; -import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; - -public class ItemGridExtractionStrategy implements GridExtractionStrategy { - private final GridOperations gridOperations; - private final PlayerMainInvWrapper playerInventoryStorage; - private final CursorItemHandler playerCursorItemHandler; - - public ItemGridExtractionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); - this.playerInventoryStorage = new PlayerMainInvWrapper(player.getInventory()); - this.playerCursorItemHandler = new CursorItemHandler(containerMenu); - } - - @Override - public boolean onExtract(final PlatformResourceKey resource, - final GridExtractMode extractMode, - final boolean cursor) { - if (resource instanceof ItemResource itemResource) { - final IItemHandler handler = cursor ? playerCursorItemHandler : playerInventoryStorage; - gridOperations.extract( - itemResource, - extractMode, - new ItemHandlerInsertableStorage(CapabilityCache.ofItemHandler(handler), AmountOverride.NONE) - ); - return true; - } - return false; - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/ItemGridInsertionStrategy.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/ItemGridInsertionStrategy.java deleted file mode 100644 index 6770ec662..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/ItemGridInsertionStrategy.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.grid.strategy; - -import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCache; -import com.refinedmods.refinedstorage.platform.neoforge.storage.ItemHandlerExtractableStorage; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.items.wrapper.InvWrapper; -import net.neoforged.neoforge.items.wrapper.RangedWrapper; - -import static com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource.ofItemStack; - -public class ItemGridInsertionStrategy implements GridInsertionStrategy { - private final AbstractContainerMenu containerMenu; - private final GridOperations gridOperations; - private final CursorItemHandler playerCursorItemHandler; - - public ItemGridInsertionStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - this.containerMenu = containerMenu; - this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); - this.playerCursorItemHandler = new CursorItemHandler(containerMenu); - } - - @Override - public boolean onInsert(final GridInsertMode insertMode, final boolean tryAlternatives) { - final ItemStack carried = containerMenu.getCarried(); - if (carried.isEmpty()) { - return false; - } - final ItemResource itemResource = ItemResource.ofItemStack(carried); - gridOperations.insert( - itemResource, - insertMode, - new ItemHandlerExtractableStorage( - CapabilityCache.ofItemHandler(playerCursorItemHandler), - AmountOverride.NONE - ) - ); - return true; - } - - @Override - public boolean onTransfer(final int slotIndex) { - final Slot slot = containerMenu.getSlot(slotIndex); - final RangedWrapper storage = new RangedWrapper( - new InvWrapper(slot.container), - slot.getContainerSlot(), - slot.getContainerSlot() + 1 - ); - final ItemStack itemStackInSlot = storage.getStackInSlot(0); - if (itemStackInSlot.isEmpty()) { - return false; - } - final ItemResource itemResource = ofItemStack(itemStackInSlot); - gridOperations.insert( - itemResource, - GridInsertMode.ENTIRE_RESOURCE, - new ItemHandlerExtractableStorage( - CapabilityCache.ofItemHandler(storage), - AmountOverride.NONE - ) - ); - return true; - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/ItemGridScrollingStrategy.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/ItemGridScrollingStrategy.java deleted file mode 100644 index 65453ea79..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/ItemGridScrollingStrategy.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.grid.strategy; - -import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage.api.grid.operations.GridOperations; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCache; -import com.refinedmods.refinedstorage.platform.neoforge.storage.ItemHandlerExtractableStorage; -import com.refinedmods.refinedstorage.platform.neoforge.storage.ItemHandlerInsertableStorage; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.neoforged.neoforge.items.IItemHandler; -import net.neoforged.neoforge.items.wrapper.InvWrapper; -import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; -import net.neoforged.neoforge.items.wrapper.RangedWrapper; - -public class ItemGridScrollingStrategy implements GridScrollingStrategy { - private final GridOperations gridOperations; - private final Inventory playerInventory; - private final PlayerMainInvWrapper playerInventoryStorage; - private final CursorItemHandler playerCursorItemHandler; - - public ItemGridScrollingStrategy(final AbstractContainerMenu containerMenu, - final ServerPlayer player, - final Grid grid) { - this.gridOperations = grid.createOperations(ResourceTypes.ITEM, player); - this.playerInventory = player.getInventory(); - this.playerInventoryStorage = new PlayerMainInvWrapper(playerInventory); - this.playerCursorItemHandler = new CursorItemHandler(containerMenu); - } - - @Override - public boolean onScroll(final PlatformResourceKey resource, final GridScrollMode scrollMode, final int slotIndex) { - if (resource instanceof ItemResource itemResource) { - final IItemHandler playerStorage = slotIndex >= 0 - ? new RangedWrapper(new InvWrapper(playerInventory), slotIndex, slotIndex + 1) - : playerInventoryStorage; - switch (scrollMode) { - case GRID_TO_INVENTORY -> handleGridToInventoryScroll(itemResource, playerStorage); - case INVENTORY_TO_GRID -> handleInventoryToGridScroll(itemResource, playerStorage); - case GRID_TO_CURSOR -> handleGridToInventoryScroll(itemResource, playerCursorItemHandler); - } - return true; - } - return false; - } - - private void handleInventoryToGridScroll(final ItemResource itemResource, final IItemHandler sourceStorage) { - gridOperations.insert( - itemResource, - GridInsertMode.SINGLE_RESOURCE, - new ItemHandlerExtractableStorage( - CapabilityCache.ofItemHandler(sourceStorage), - AmountOverride.NONE - ) - ); - } - - private void handleGridToInventoryScroll(final ItemResource itemResource, final IItemHandler destinationStorage) { - gridOperations.extract( - itemResource, - GridExtractMode.SINGLE_RESOURCE, - new ItemHandlerInsertableStorage( - CapabilityCache.ofItemHandler(destinationStorage), - AmountOverride.NONE - ) - ); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/package-info.java deleted file mode 100644 index df7c35c37..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/strategy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.grid.strategy; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/view/ForgeFluidGridResourceFactory.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/view/ForgeFluidGridResourceFactory.java deleted file mode 100644 index 1f27ea832..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/view/ForgeFluidGridResourceFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.grid.view; - -import com.refinedmods.refinedstorage.platform.common.grid.view.AbstractFluidGridResourceFactory; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; - -import net.neoforged.fml.ModList; -import net.neoforged.neoforge.fluids.FluidType; - -import static com.refinedmods.refinedstorage.platform.neoforge.support.resource.VariantUtil.toFluidStack; - -public class ForgeFluidGridResourceFactory extends AbstractFluidGridResourceFactory { - @Override - protected String getTooltip(final FluidResource resource) { - return getName(resource); - } - - @Override - protected String getModName(final String modId) { - return ModList - .get() - .getModContainerById(modId) - .map(container -> container.getModInfo().getDisplayName()) - .orElse(""); - } - - @Override - protected String getName(final FluidResource fluidResource) { - return toFluidStack(fluidResource, FluidType.BUCKET_VOLUME).getHoverName().getString(); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/view/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/view/package-info.java deleted file mode 100644 index ae8c40a5e..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/grid/view/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.grid.view; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/FluidHandlerImporterTransferStrategyFactory.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/FluidHandlerImporterTransferStrategyFactory.java deleted file mode 100644 index 86602ba77..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/FluidHandlerImporterTransferStrategyFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.importer; - -import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterSource; -import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterTransferStrategyImpl; -import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCacheImpl; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; -import net.neoforged.neoforge.fluids.FluidType; - -public class FluidHandlerImporterTransferStrategyFactory implements ImporterTransferStrategyFactory { - @Override - public ImporterTransferStrategy create(final ServerLevel level, - final BlockPos pos, - final Direction direction, - final UpgradeState upgradeState, - final AmountOverride amountOverride) { - final ImporterSource source = new FluidHandlerImporterSource(new CapabilityCacheImpl( - level, - pos, - direction - ), amountOverride); - final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) - ? FluidType.BUCKET_VOLUME * 64 - : FluidType.BUCKET_VOLUME; - return new ImporterTransferStrategyImpl(source, transferQuota); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/ItemHandlerImporterTransferStrategyFactory.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/ItemHandlerImporterTransferStrategyFactory.java deleted file mode 100644 index 4d8d9e056..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/ItemHandlerImporterTransferStrategyFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.importer; - -import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterSource; -import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterTransferStrategyImpl; -import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.api.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage.platform.common.content.Items; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCacheImpl; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; - -public class ItemHandlerImporterTransferStrategyFactory implements ImporterTransferStrategyFactory { - @Override - public ImporterTransferStrategy create(final ServerLevel level, - final BlockPos pos, - final Direction direction, - final UpgradeState upgradeState, - final AmountOverride amountOverride) { - final ImporterSource source = new ItemHandlerImporterSource(new CapabilityCacheImpl( - level, - pos, - direction - ), amountOverride); - final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; - return new ImporterTransferStrategyImpl(source, transferQuota); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/package-info.java deleted file mode 100644 index 83c3211a2..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/importer/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.importer; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/package-info.java deleted file mode 100644 index e7e6917db..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/ItemHandlerInsertableStorage.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/ItemHandlerInsertableStorage.java deleted file mode 100644 index bae970bca..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/ItemHandlerInsertableStorage.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.items.IItemHandler; -import net.neoforged.neoforge.items.ItemHandlerHelper; - -public class ItemHandlerInsertableStorage implements InsertableStorage { - private final CapabilityCache capabilityCache; - private final AmountOverride amountOverride; - - public ItemHandlerInsertableStorage(final CapabilityCache capabilityCache, - final AmountOverride amountOverride) { - this.capabilityCache = capabilityCache; - this.amountOverride = amountOverride; - } - - @Override - public long insert(final ResourceKey resource, final long amount, final Action action, final Actor actor) { - if (!(resource instanceof ItemResource itemResource)) { - return 0L; - } - return capabilityCache - .getItemHandler() - .map(itemHandler -> { - final long correctedAmount = amountOverride.overrideAmount( - resource, - amount, - () -> ForgeHandlerUtil.getCurrentAmount(itemHandler, itemResource.toItemStack()) - ); - if (correctedAmount == 0) { - return 0L; - } - return doInsert(itemResource, correctedAmount, action, itemHandler); - }) - .orElse(0L); - } - - private long doInsert(final ItemResource resource, - final long amount, - final Action action, - final IItemHandler itemHandler) { - final ItemStack stack = resource.toItemStack(amount); - final ItemStack remainder = ItemHandlerHelper.insertItem( - itemHandler, - stack, - action == Action.SIMULATE - ); - return amount - remainder.getCount(); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveBakedModel.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveBakedModel.java deleted file mode 100644 index 3755fe14d..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveBakedModel.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskdrive; - -import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.DiskDriveBlock; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.neoforge.storage.DiskContainerItemOverrides; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.DiskModelBaker; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RotationTranslationModelBaker; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.TransformationBuilder; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import javax.annotation.Nullable; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import com.mojang.math.Transformation; -import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.ItemOverrides; -import net.minecraft.client.resources.model.BakedModel; -import net.minecraft.core.Direction; -import net.minecraft.util.RandomSource; -import net.minecraft.world.level.block.state.BlockState; -import net.neoforged.neoforge.client.model.BakedModelWrapper; -import net.neoforged.neoforge.client.model.data.ModelData; -import org.joml.Vector3f; - -class DiskDriveBakedModel extends BakedModelWrapper { - private final LoadingCache> cache; - private final DiskContainerItemOverrides itemOverrides; - private final Vector3f[] diskTranslations = new Vector3f[8]; - - DiskDriveBakedModel(final BakedModel baseModel, - final RotationTranslationModelBaker baseModelBaker, - final DiskModelBaker diskModelBaker, - final RotationTranslationModelBaker ledInactiveModelBaker) { - super(baseModel); - int i = 0; - for (int y = 0; y < 4; ++y) { - for (int x = 0; x < 2; ++x) { - this.diskTranslations[i++] = getDiskTranslation(x, y); - } - } - this.cache = CacheBuilder.newBuilder().build(CacheLoader.from(cacheKey -> { - final Transformation rotation = TransformationBuilder.create().rotate(cacheKey.direction).build(); - final RandomSource rand = RandomSource.create(); - final List quads = baseModelBaker.bake(rotation, cacheKey.side, rand); - for (int j = 0; j < diskTranslations.length; ++j) { - final Disk disk = cacheKey.disks[j]; - quads.addAll(getDiskQuads(diskModelBaker, cacheKey, disk, j)); - if (cacheKey.withInactiveLed && disk.state() == StorageState.INACTIVE) { - final Transformation ledTransform = TransformationBuilder - .create() - .rotate(cacheKey.direction) - .translate(diskTranslations[j]) - .build(); - quads.addAll(ledInactiveModelBaker.bake(ledTransform, cacheKey.side, rand)); - } - } - return quads; - })); - this.itemOverrides = new DiskContainerItemOverrides<>( - cache, - baseModel, - diskTranslations, - disks -> new CacheKey(null, true, BiDirection.NORTH, disks), - CacheKey::withSide - ); - } - - @Override - public ItemOverrides getOverrides() { - return itemOverrides; - } - - @Override - public List getQuads(@Nullable final BlockState state, - @Nullable final Direction side, - final RandomSource rand, - final ModelData extraData, - @Nullable final RenderType renderType) { - if (state == null || !(state.getBlock() instanceof DiskDriveBlock diskDriveBlock)) { - return super.getQuads(state, side, rand); - } - final BiDirection direction = diskDriveBlock.getDirection(state); - if (direction == null) { - return super.getQuads(state, side, rand); - } - final Disk[] disks = extraData.get(ForgeDiskDriveBlockEntity.DISKS_PROPERTY); - if (disks == null) { - return super.getQuads(state, side, rand); - } - return cache.getUnchecked(new CacheKey(side, false, direction, disks)); - } - - private List getDiskQuads(final DiskModelBaker diskBakers, - final CacheKey cacheKey, - final Disk disk, - final int index) { - if (disk.state() == StorageState.NONE || disk.item() == null) { - return Collections.emptyList(); - } - final RotationTranslationModelBaker diskBaker = diskBakers.forDisk(disk.item()); - if (diskBaker == null) { - return Collections.emptyList(); - } - final Transformation diskTransform = TransformationBuilder.create() - .rotate(cacheKey.direction) - .translate(diskTranslations[index]) - .build(); - return diskBaker.bake(diskTransform, cacheKey.side, RandomSource.create()); - } - - private static Vector3f getDiskTranslation(final int x, final int y) { - return new Vector3f( - x == 0 ? -(2F / 16F) : -(9F / 16F), - -((y * 3F) / 16F) - (2F / 16F), - 0 - ); - } - - private record CacheKey(@Nullable Direction side, boolean withInactiveLed, BiDirection direction, Disk[] disks) { - CacheKey withSide(final Direction newSide) { - return new CacheKey(newSide, withInactiveLed, direction, disks); - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final CacheKey cacheKey = (CacheKey) o; - return side == cacheKey.side && direction == cacheKey.direction && Arrays.equals(disks, cacheKey.disks) - && withInactiveLed == cacheKey.withInactiveLed; - } - - @Override - public int hashCode() { - int result = Objects.hash(side, direction, withInactiveLed); - result = 31 * result + Arrays.hashCode(disks); - return result; - } - - @Override - public String toString() { - return "CacheKey{" - + "side=" + side - + ", withInactiveLed=" + withInactiveLed - + ", direction=" + direction - + ", disks=" + Arrays.toString(disks) - + '}'; - } - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java deleted file mode 100644 index ca777044d..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskdrive; - -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntityRenderer; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RenderTypes; - -public class DiskDriveBlockEntityRendererImpl - extends AbstractDiskDriveBlockEntityRenderer { - public DiskDriveBlockEntityRendererImpl() { - super(RenderTypes.DISK_LED); - } - - @Override - protected Disk[] getDisks(final AbstractDiskDriveBlockEntity blockEntity) { - return blockEntity.getModelData().get(ForgeDiskDriveBlockEntity.DISKS_PROPERTY); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/package-info.java deleted file mode 100644 index 4050fcfcb..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskdrive/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskdrive; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceBakedModel.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceBakedModel.java deleted file mode 100644 index 2b0d3a885..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceBakedModel.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskinterface; - -import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.DiskInterfaceBlock; -import com.refinedmods.refinedstorage.platform.common.support.AbstractActiveColoredDirectionalBlock; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.neoforge.storage.DiskContainerItemOverrides; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.DiskModelBaker; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RotationTranslationModelBaker; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.TransformationBuilder; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import javax.annotation.Nullable; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import com.mojang.math.Transformation; -import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.ItemOverrides; -import net.minecraft.client.resources.model.BakedModel; -import net.minecraft.core.Direction; -import net.minecraft.util.RandomSource; -import net.minecraft.world.level.block.state.BlockState; -import net.neoforged.neoforge.client.model.BakedModelWrapper; -import net.neoforged.neoforge.client.model.data.ModelData; -import org.joml.Vector3f; - -public class DiskInterfaceBakedModel extends BakedModelWrapper { - private final LoadingCache> cache; - private final DiskContainerItemOverrides itemOverrides; - private final Vector3f[] diskTranslations = new Vector3f[6]; - - DiskInterfaceBakedModel(final BakedModel baseModel, - final RotationTranslationModelBaker inactiveBaseModelBaker, - final RotationTranslationModelBaker baseModelBaker, - final DiskModelBaker diskModelBaker, - final RotationTranslationModelBaker ledInactiveModelBaker) { - super(baseModel); - for (int i = 0; i < 6; ++i) { - this.diskTranslations[i] = getDiskTranslation(i); - } - this.cache = CacheBuilder.newBuilder().build(CacheLoader.from(cacheKey -> { - final Transformation rotation = TransformationBuilder.create().rotate(cacheKey.direction).build(); - final RandomSource rand = RandomSource.create(); - final List quads = (cacheKey.active ? baseModelBaker : inactiveBaseModelBaker) - .bake(rotation, cacheKey.side, rand); - for (int j = 0; j < diskTranslations.length; ++j) { - final Disk disk = cacheKey.disks[j]; - quads.addAll(getDiskQuads(diskModelBaker, cacheKey, disk, j)); - if (cacheKey.withInactiveLed && disk.state() == StorageState.INACTIVE) { - final Transformation ledTransform = TransformationBuilder - .create() - .rotate(cacheKey.direction) - .translate(diskTranslations[j]) - .build(); - quads.addAll(ledInactiveModelBaker.bake(ledTransform, cacheKey.side, rand)); - } - } - return quads; - })); - this.itemOverrides = new DiskContainerItemOverrides<>( - cache, - baseModel, - diskTranslations, - disks -> new CacheKey(null, true, true, BiDirection.NORTH, disks), - CacheKey::withSide - ); - } - - @Override - public ItemOverrides getOverrides() { - return itemOverrides; - } - - @Override - public List getQuads(@Nullable final BlockState state, - @Nullable final Direction side, - final RandomSource rand, - final ModelData extraData, - @Nullable final RenderType renderType) { - if (state == null || !(state.getBlock() instanceof DiskInterfaceBlock diskInterfaceBlock)) { - return super.getQuads(state, side, rand); - } - final BiDirection direction = diskInterfaceBlock.getDirection(state); - if (direction == null) { - return super.getQuads(state, side, rand); - } - final Disk[] disks = extraData.get(ForgeDiskInterfaceBlockEntity.DISKS_PROPERTY); - if (disks == null) { - return super.getQuads(state, side, rand); - } - final boolean active = state.getValue(AbstractActiveColoredDirectionalBlock.ACTIVE); - return cache.getUnchecked(new CacheKey(side, active, false, direction, disks)); - } - - private List getDiskQuads(final DiskModelBaker diskBakers, - final CacheKey cacheKey, - final Disk disk, - final int index) { - if (disk.state() == StorageState.NONE || disk.item() == null) { - return Collections.emptyList(); - } - final RotationTranslationModelBaker diskBaker = diskBakers.forDisk(disk.item()); - if (diskBaker == null) { - return Collections.emptyList(); - } - final Transformation diskTransform = TransformationBuilder.create() - .rotate(cacheKey.direction) - .translate(diskTranslations[index]) - .build(); - return diskBaker.bake(diskTransform, cacheKey.side, RandomSource.create()); - } - - private static Vector3f getDiskTranslation(final int i) { - final int x = i < 3 ? 0 : 1; - final int y = i % 3; - return new Vector3f( - x == 0 ? -(2F / 16F) : -(9F / 16F), - -((y * 3F) / 16F) - (6F / 16F), - 0 - ); - } - - private record CacheKey(@Nullable Direction side, - boolean active, - boolean withInactiveLed, - BiDirection direction, - Disk[] disks) { - CacheKey withSide(final Direction newSide) { - return new CacheKey(newSide, active, withInactiveLed, direction, disks); - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final CacheKey cacheKey = (CacheKey) o; - return side == cacheKey.side && direction == cacheKey.direction && Arrays.equals(disks, cacheKey.disks) - && withInactiveLed == cacheKey.withInactiveLed && active == cacheKey.active; - } - - @Override - public int hashCode() { - int result = Objects.hash(side, active, direction, withInactiveLed); - result = 31 * result + Arrays.hashCode(disks); - return result; - } - - @Override - public String toString() { - return "CacheKey{" - + "side=" + side - + ", active=" + active - + ", withInactiveLed=" + withInactiveLed - + ", direction=" + direction - + ", disks=" + Arrays.toString(disks) - + '}'; - } - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java deleted file mode 100644 index 1e4adf49d..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskinterface; - -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntityRenderer; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RenderTypes; - -public class DiskInterfaceBlockEntityRendererImpl - extends AbstractDiskInterfaceBlockEntityRenderer { - public DiskInterfaceBlockEntityRendererImpl() { - super(RenderTypes.DISK_LED); - } - - @Override - protected Disk[] getDisks(final AbstractDiskInterfaceBlockEntity blockEntity) { - return blockEntity.getModelData().get(ForgeDiskInterfaceBlockEntity.DISKS_PROPERTY); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/package-info.java deleted file mode 100644 index 2ebdb0cfa..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/diskinterface/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.storage.diskinterface; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java deleted file mode 100644 index a64aecf55..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.externalstorage; - -import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCacheImpl; - -import java.util.Optional; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; - -public class FluidHandlerPlatformExternalStorageProviderFactory implements PlatformExternalStorageProviderFactory { - @Override - public Optional create(final ServerLevel level, - final BlockPos pos, - final Direction direction) { - return Optional.of(new FluidHandlerExternalStorageProvider(new CapabilityCacheImpl(level, pos, direction))); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java deleted file mode 100644 index d65eb3ea9..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.externalstorage; - -import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage.platform.neoforge.storage.CapabilityCacheImpl; - -import java.util.Optional; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; - -public class ItemHandlerPlatformExternalStorageProviderFactory implements PlatformExternalStorageProviderFactory { - @Override - public Optional create(final ServerLevel level, - final BlockPos pos, - final Direction direction) { - return Optional.of(new ItemHandlerExternalStorageProvider(new CapabilityCacheImpl(level, pos, direction))); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/package-info.java deleted file mode 100644 index 5d55cb170..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/externalstorage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.storage.externalstorage; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/package-info.java deleted file mode 100644 index 43b91e753..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.storage; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/ForgePortableGridBlockEntity.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/ForgePortableGridBlockEntity.java deleted file mode 100644 index cc1f73317..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/ForgePortableGridBlockEntity.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid; - -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.AbstractPortableGridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridType; - -import javax.annotation.Nonnull; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.state.BlockState; -import net.neoforged.neoforge.client.model.data.ModelData; -import net.neoforged.neoforge.client.model.data.ModelProperty; - -public class ForgePortableGridBlockEntity extends AbstractPortableGridBlockEntity { - public static final ModelProperty DISK_PROPERTY = new ModelProperty<>(); - - public ForgePortableGridBlockEntity(final PortableGridType type, final BlockPos pos, final BlockState state) { - super(type, pos, state); - } - - @Override - protected void onClientDriveStateUpdated() { - requestModelDataUpdate(); - super.onClientDriveStateUpdated(); - } - - @Nonnull - @Override - public ModelData getModelData() { - return ModelData.builder().with(DISK_PROPERTY, disk).build(); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridBakedModel.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridBakedModel.java deleted file mode 100644 index 5f8c2a03b..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridBakedModel.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid; - -import com.refinedmods.refinedstorage.api.storage.StorageState; -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlock; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlockItem; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.PortableGridBlockItemRenderInfo; -import com.refinedmods.refinedstorage.platform.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.DiskModelBaker; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.ItemBakedModel; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RotationTranslationModelBaker; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.TransformationBuilder; - -import java.util.Collections; -import java.util.List; -import javax.annotation.Nullable; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.ItemOverrides; -import net.minecraft.client.resources.model.BakedModel; -import net.minecraft.core.Direction; -import net.minecraft.util.RandomSource; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.state.BlockState; -import net.neoforged.neoforge.client.model.BakedModelWrapper; -import net.neoforged.neoforge.client.model.data.ModelData; -import org.joml.Vector3f; - -class PortableGridBakedModel extends BakedModelWrapper { - private static final Vector3f MOVE_TO_DISK_LOCATION = new Vector3f(0, -12 / 16F, 9 / 16F); - private static final Vector3f MOVE_TO_DISK_LED_LOCATION = new Vector3f(0, -12 / 16F, 9 / 16F); - - private final LoadingCache> cache; - private final PortableGridItemOverrides itemOverrides = new PortableGridItemOverrides(); - - PortableGridBakedModel(final BakedModel baseModel, - final RotationTranslationModelBaker activeModelBaker, - final RotationTranslationModelBaker inactiveModelBaker, - final DiskModelBaker diskModelBaker, - final DiskLedBakers diskLedBakers) { - super(baseModel); - this.cache = CacheBuilder.newBuilder().build(CacheLoader.from(cacheKey -> { - final RotationTranslationModelBaker baseModelBaker = cacheKey.active - ? activeModelBaker - : inactiveModelBaker; - final List quads = baseModelBaker.bake( - TransformationBuilder.create().rotate(cacheKey.direction).build(), - cacheKey.side(), - RandomSource.create() - ); - if (cacheKey.disk.item() == null) { - return quads; - } - final RotationTranslationModelBaker diskBaker = diskModelBaker.forDisk(cacheKey.disk.item()); - if (diskBaker != null) { - quads.addAll(diskBaker.bake(TransformationBuilder.create() - .rotate(cacheKey.direction) - .translate(MOVE_TO_DISK_LOCATION) - .rotate(BiDirection.WEST) - .build(), cacheKey.side(), RandomSource.create())); - } - if (cacheKey.includeLed && cacheKey.disk.state() != StorageState.NONE) { - quads.addAll(diskLedBakers.forState(cacheKey.disk.state()).bake(TransformationBuilder.create() - .translate(MOVE_TO_DISK_LED_LOCATION) - .rotate(BiDirection.WEST) - .build(), cacheKey.side(), RandomSource.create())); - } - return quads; - })); - } - - @Override - public List getQuads(@Nullable final BlockState state, - @Nullable final Direction side, - final RandomSource randomSource, - final ModelData extraData, - @Nullable final RenderType renderType) { - if (state == null || !(state.getBlock() instanceof PortableGridBlock portableGridBlock)) { - return super.getQuads(state, side, randomSource); - } - final BiDirection direction = portableGridBlock.getDirection(state); - if (direction == null) { - return super.getQuads(state, side, randomSource); - } - final Disk disk = extraData.get(ForgePortableGridBlockEntity.DISK_PROPERTY); - if (disk == null) { - return super.getQuads(state, side, randomSource); - } - final boolean active = state.getValue(PortableGridBlock.ACTIVE); - return cache.getUnchecked(new CacheKey(side, direction, active, disk, false)); - } - - @Override - public ItemOverrides getOverrides() { - return itemOverrides; - } - - private class PortableGridItemOverrides extends ItemOverrides { - private final LoadingCache itemCache = CacheBuilder.newBuilder().build( - CacheLoader.from(cacheKey -> new ItemBakedModel( - originalModel, - cache.getUnchecked(cacheKey), - Collections.emptyMap() - )) - ); - - @Override - @Nullable - public BakedModel resolve(final BakedModel bakedModel, - final ItemStack stack, - @Nullable final ClientLevel level, - @Nullable final LivingEntity entity, - final int seed) { - if (level == null) { - return null; - } - final PortableGridBlockItemRenderInfo renderInfo = PortableGridBlockItem.getRenderInfo(stack, level); - return itemCache.getUnchecked(new CacheKey( - null, - BiDirection.NORTH, - renderInfo.active(), - renderInfo.disk(), - true - )); - } - } - - private record CacheKey(@Nullable Direction side, - BiDirection direction, - boolean active, - Disk disk, - boolean includeLed) { - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridBlockEntityRendererImpl.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridBlockEntityRendererImpl.java deleted file mode 100644 index 71dc5b662..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/PortableGridBlockEntityRendererImpl.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid; - -import com.refinedmods.refinedstorage.platform.common.storage.Disk; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.AbstractPortableGridBlockEntity; -import com.refinedmods.refinedstorage.platform.common.storage.portablegrid.AbstractPortableGridBlockEntityRenderer; -import com.refinedmods.refinedstorage.platform.neoforge.support.render.RenderTypes; - -import javax.annotation.Nullable; - -public class PortableGridBlockEntityRendererImpl - extends AbstractPortableGridBlockEntityRenderer { - public PortableGridBlockEntityRendererImpl() { - super(RenderTypes.DISK_LED); - } - - @Override - @Nullable - protected Disk getDisk(final T blockEntity) { - return blockEntity.getModelData().get(ForgePortableGridBlockEntity.DISK_PROPERTY); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/package-info.java deleted file mode 100644 index c721b6141..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/storage/portablegrid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.storage.portablegrid; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/containermenu/ContainerTransferDestination.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/containermenu/ContainerTransferDestination.java deleted file mode 100644 index 6dde05407..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/containermenu/ContainerTransferDestination.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.containermenu; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.TransferDestination; - -import net.minecraft.world.Container; -import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.items.ItemHandlerHelper; -import net.neoforged.neoforge.items.wrapper.InvWrapper; - -public record ContainerTransferDestination(Container destination) implements TransferDestination { - @Override - public ItemStack transfer(final ItemStack stack) { - final InvWrapper destinationInv = new InvWrapper(destination); - return ItemHandlerHelper.insertItem(destinationInv, stack, false); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/containermenu/MenuOpenerImpl.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/containermenu/MenuOpenerImpl.java deleted file mode 100644 index 6be6d3531..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/containermenu/MenuOpenerImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.containermenu; - -import com.refinedmods.refinedstorage.platform.common.support.containermenu.ExtendedMenuProvider; -import com.refinedmods.refinedstorage.platform.common.support.containermenu.MenuOpener; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.MenuProvider; - -public class MenuOpenerImpl implements MenuOpener { - @Override - public void openMenu(final ServerPlayer player, final MenuProvider menuProvider) { - if (menuProvider instanceof ExtendedMenuProvider extendedMenuProvider) { - openExtendedMenu(player, extendedMenuProvider); - } else { - player.openMenu(menuProvider); - } - } - - private static void openExtendedMenu(final ServerPlayer player, - final ExtendedMenuProvider extendedMenuProvider) { - player.openMenu( - extendedMenuProvider, - buf -> extendedMenuProvider.getMenuCodec().encode(buf, extendedMenuProvider.getMenuData()) - ); - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/containermenu/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/containermenu/package-info.java deleted file mode 100644 index 0d92a442e..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/containermenu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.support.containermenu; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/EnergyStorageAdapter.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/EnergyStorageAdapter.java deleted file mode 100644 index 35ff1effa..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/EnergyStorageAdapter.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.energy; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; - -import net.neoforged.neoforge.energy.IEnergyStorage; - -public class EnergyStorageAdapter implements IEnergyStorage { - private final EnergyStorage energyStorage; - - public EnergyStorageAdapter(final EnergyStorage energyStorage) { - this.energyStorage = energyStorage; - } - - public EnergyStorage getEnergyStorage() { - return energyStorage; - } - - @Override - public int receiveEnergy(final int maxReceive, final boolean simulate) { - return (int) energyStorage.receive(maxReceive, simulate ? Action.SIMULATE : Action.EXECUTE); - } - - @Override - public int extractEnergy(final int maxExtract, final boolean simulate) { - return (int) energyStorage.extract(maxExtract, simulate ? Action.SIMULATE : Action.EXECUTE); - } - - @Override - public int getEnergyStored() { - return (int) energyStorage.getStored(); - } - - @Override - public int getMaxEnergyStored() { - return (int) energyStorage.getCapacity(); - } - - @Override - public boolean canExtract() { - return false; - } - - @Override - public boolean canReceive() { - return true; - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/package-info.java deleted file mode 100644 index 59b8b4647..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.support.energy; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/inventory/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/inventory/package-info.java deleted file mode 100644 index d0db718c9..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/inventory/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.support.inventory; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RenderTypes.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RenderTypes.java deleted file mode 100644 index 3fc2a1fba..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RenderTypes.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.render; - -import com.mojang.blaze3d.vertex.DefaultVertexFormat; -import com.mojang.blaze3d.vertex.VertexFormat; -import net.minecraft.client.renderer.GameRenderer; -import net.minecraft.client.renderer.RenderStateShard; -import net.minecraft.client.renderer.RenderType; - -public final class RenderTypes { - public static final RenderType DISK_LED = RenderType.create( - "disk_led", - DefaultVertexFormat.POSITION_COLOR, - VertexFormat.Mode.QUADS, - 32565, - false, - true, - RenderType.CompositeState.builder() - .setShaderState(new RenderStateShard.ShaderStateShard(GameRenderer::getPositionColorShader)) - .createCompositeState(false) - ); - - private RenderTypes() { - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/package-info.java deleted file mode 100644 index d4aac3d9a..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.support.render; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/resource/VariantUtil.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/resource/VariantUtil.java deleted file mode 100644 index 3a050e902..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/resource/VariantUtil.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.refinedmods.refinedstorage.platform.neoforge.support.resource; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; - -import java.util.Objects; - -import net.neoforged.neoforge.fluids.FluidStack; -import net.neoforged.neoforge.fluids.capability.IFluidHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public final class VariantUtil { - private static final Logger LOGGER = LoggerFactory.getLogger(VariantUtil.class); - - private VariantUtil() { - } - - public static boolean isSame(final FluidResource resource, final FluidStack stack) { - return resource.fluid() == stack.getFluid() && Objects.equals( - resource.components(), - stack.getComponents().asPatch() - ); - } - - public static FluidResource ofFluidStack(final FluidStack fluidStack) { - return new FluidResource(fluidStack.getFluid(), fluidStack.getComponents().asPatch()); - } - - @SuppressWarnings("deprecation") - public static FluidStack toFluidStack(final FluidResource fluidResource, final long amount) { - if (amount > Integer.MAX_VALUE) { - LOGGER.warn("Truncating too large amount for {} to fit into FluidStack {}", fluidResource, amount); - } - return new FluidStack( - fluidResource.fluid().builtInRegistryHolder(), - (int) amount, - fluidResource.components() - ); - } - - public static Action toAction(final IFluidHandler.FluidAction action) { - return action == IFluidHandler.FluidAction.SIMULATE ? Action.SIMULATE : Action.EXECUTE; - } - - public static IFluidHandler.FluidAction toFluidAction(final Action action) { - return action == Action.SIMULATE ? IFluidHandler.FluidAction.SIMULATE : IFluidHandler.FluidAction.EXECUTE; - } -} diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/resource/package-info.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/resource/package-info.java deleted file mode 100644 index 8ea903117..000000000 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/resource/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.platform.neoforge.support.resource; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/GameTestUtil.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/GameTestUtil.java deleted file mode 100644 index 22d5a5561..000000000 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/GameTestUtil.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.platform.api.support.network.AbstractNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.content.Blocks; -import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; - -import java.util.Arrays; -import java.util.function.Consumer; -import java.util.stream.IntStream; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.gametest.framework.GameTestAssertException; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.level.material.FluidState; - -public final class GameTestUtil { - public static final Blocks RSBLOCKS = Blocks.INSTANCE; - - private GameTestUtil() { - } - - @Nullable - private static Network getNetwork(final GameTestHelper helper, final BlockPos pos) { - try { - final var be = requireBlockEntity(helper, pos, AbstractNetworkNodeContainerBlockEntity.class); - final var field = AbstractNetworkNodeContainerBlockEntity.class.getDeclaredField("mainNode"); - field.setAccessible(true); - final NetworkNode mainNode = (NetworkNode) field.get(be); - return mainNode.getNetwork(); - } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException e) { - throw new RuntimeException(e); - } - } - - public static Runnable networkIsAvailable(final GameTestHelper helper, - final BlockPos networkPos, - final Consumer networkConsumer) { - return () -> { - final Network network = getNetwork(helper, networkPos); - helper.assertTrue(network != null, "Network is not available"); - networkConsumer.accept(network); - }; - } - - public static void insert(final GameTestHelper helper, - final Network network, - final Item resource, - final long amount) { - insert(helper, network, new ItemResource(resource), amount); - } - - public static void insert(final GameTestHelper helper, - final Network network, - final Fluid resource, - final long amount) { - insert(helper, network, new FluidResource(resource), amount); - } - - public static void insert(final GameTestHelper helper, - final Network network, - final ResourceKey resource, - final long amount) { - final StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); - final long inserted = storage.insert(resource, amount, Action.EXECUTE, EmptyActor.INSTANCE); - helper.assertTrue(inserted == amount, "Resource couldn't be inserted"); - } - - @SuppressWarnings("unchecked") - public static T requireBlockEntity( - final GameTestHelper helper, - final BlockPos pos, - final Class clazz - ) { - final BlockEntity blockEntity = helper.getBlockEntity(pos); - if (blockEntity == null) { - throw new GameTestAssertException("Block entity not found at " + pos); - } - if (!clazz.isInstance(blockEntity)) { - throw new GameTestAssertException( - "Expected block entity of type " + clazz + " but was " + blockEntity.getClass() - ); - } - return (T) blockEntity; - } - - public static void assertFluidPresent(final GameTestHelper helper, - final BlockPos pos, - final Fluid fluid, - final int level) { - final FluidState fluidState = helper.getLevel().getFluidState(helper.absolutePos(pos)); - helper.assertTrue( - fluidState.getType() == fluid && fluidState.getAmount() == level, - "Unexpected " + fluidState.getType() + ", " + fluidState.getAmount() - ); - } - - public static Runnable containerContainsExactly(final GameTestHelper helper, - final BlockPos pos, - final ResourceAmount... expected) { - final var containerBlockEntity = requireBlockEntity(helper, pos, BaseContainerBlockEntity.class); - - return () -> { - for (final ResourceAmount expectedStack : expected) { - final boolean contains = IntStream.range(0, containerBlockEntity.getContainerSize()) - .mapToObj(containerBlockEntity::getItem) - .anyMatch(inContainer -> asResource(inContainer).equals(expectedStack.getResource()) - && inContainer.getCount() == expectedStack.getAmount()); - helper.assertTrue(contains, "Expected resource is missing from storage: " - + expectedStack + " with count: " + expectedStack.getAmount()); - } - for (int i = 0; i < containerBlockEntity.getContainerSize(); i++) { - final ItemStack inContainer = containerBlockEntity.getItem(i); - - if (inContainer.getItem() != Items.AIR) { - final boolean wasExpected = Arrays.stream(expected).anyMatch( - expectedStack -> expectedStack.getResource().equals(asResource(inContainer)) - && expectedStack.getAmount() == inContainer.getCount() - ); - helper.assertTrue(wasExpected, "Unexpected resource found in storage: " - + inContainer.getDescriptionId() + " with count: " + inContainer.getCount()); - } - } - }; - } - - public static Runnable storageContainsExactly(final GameTestHelper helper, - final BlockPos networkPos, - final ResourceAmount... expected) { - return networkIsAvailable(helper, networkPos, network -> { - final StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); - for (final ResourceAmount expectedResource : expected) { - final boolean contains = storage.getAll() - .stream() - .anyMatch(inStorage -> inStorage.getResource().equals(expectedResource.getResource()) - && inStorage.getAmount() == expectedResource.getAmount()); - helper.assertTrue(contains, "Expected resource is missing from storage: " + expectedResource); - } - for (final ResourceAmount inStorage : storage.getAll()) { - final boolean wasExpected = Arrays.stream(expected).anyMatch( - expectedResource -> expectedResource.getResource().equals(inStorage.getResource()) - && expectedResource.getAmount() == inStorage.getAmount() - ); - helper.assertTrue(wasExpected, "Unexpected resource found in storage: " + inStorage); - } - }); - } - - public static ItemResource asResource(final Item item) { - return new ItemResource(item); - } - - public static ItemResource asResource(final ItemStack itemStack) { - return ItemResource.ofItemStack(itemStack); - } - - public static FluidResource asResource(final Fluid fluid) { - return new FluidResource(fluid); - } -} diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorTest.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorTest.java deleted file mode 100644 index 505551875..000000000 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorTest.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil; - -import java.util.List; - -import net.minecraft.core.Direction; -import net.minecraft.gametest.framework.GameTest; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.material.FluidState; -import net.neoforged.neoforge.gametest.GameTestHolder; -import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; - -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.asResource; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.assertFluidPresent; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.insert; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.networkIsAvailable; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.storageContainsExactly; -import static com.refinedmods.refinedstorage.platform.common.constructordestructor.ConstructorTestPlots.preparePlot; -import static net.minecraft.world.item.Items.DIRT; -import static net.minecraft.world.item.Items.FIREWORK_ROCKET; -import static net.minecraft.world.item.Items.STONE; -import static net.minecraft.world.level.material.Fluids.WATER; - -@GameTestHolder(IdentifierUtil.MOD_ID) -@PrefixGameTestTemplate(false) -public final class ConstructorTest { - private ConstructorTest() { - } - - @GameTest(template = "empty_15x15") - public static void shouldPlaceBlock(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - constructor.setFilters(List.of(asResource(DIRT))); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.DIRT, pos.east())) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 9), - new ResourceAmount(asResource(STONE), 15) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldPlaceWater(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - insert(helper, network, WATER, Platform.INSTANCE.getBucketAmount() * 2); - })); - - // Act - constructor.setFilters(List.of(asResource(WATER))); - - // Assert - sequence - .thenWaitUntil(() -> assertFluidPresent(helper, pos.east(), WATER, FluidState.AMOUNT_FULL)) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 10), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldDropItem(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - constructor.setDropItems(true); - constructor.setFilters(List.of(asResource(DIRT))); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) - .thenWaitUntil(() -> helper.assertItemEntityPresent(DIRT, pos.east(), 1)) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 9), - new ResourceAmount(asResource(STONE), 15) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldPlaceFireworks(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, FIREWORK_ROCKET, 15); - })); - - // Act - constructor.setFilters(List.of(asResource(FIREWORK_ROCKET))); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.AIR, pos.east())) - .thenWaitUntil(() -> helper.assertEntityPresent(EntityType.FIREWORK_ROCKET, pos.east())) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 10), - new ResourceAmount(asResource(FIREWORK_ROCKET), 14) - )) - .thenSucceed(); - }); - } -} diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorTestPlots.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorTestPlots.java deleted file mode 100644 index 8bf1cb20a..000000000 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ConstructorTestPlots.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.gametest.framework.GameTestSequence; -import org.apache.commons.lang3.function.TriConsumer; - -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.RSBLOCKS; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.requireBlockEntity; -import static net.minecraft.core.BlockPos.ZERO; - -final class ConstructorTestPlots { - private ConstructorTestPlots() { - } - - static void preparePlot(final GameTestHelper helper, - final Direction direction, - final TriConsumer consumer) { - helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); - helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); - helper.setBlock( - ZERO.above().above().north(), - RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) - ); - final BlockPos constructorPos = ZERO.above().above().above(); - helper.setBlock(constructorPos, RSBLOCKS.getConstructor().getDefault().rotated(direction)); - consumer.accept( - requireBlockEntity(helper, constructorPos, ConstructorBlockEntity.class), - constructorPos, - helper.startSequence() - ); - } -} diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorTest.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorTest.java deleted file mode 100644 index c6207d66e..000000000 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorTest.java +++ /dev/null @@ -1,247 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil; - -import java.util.Set; - -import net.minecraft.core.Direction; -import net.minecraft.gametest.framework.GameTest; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.world.level.block.Blocks; -import net.neoforged.neoforge.gametest.GameTestHolder; -import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; - -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.asResource; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.insert; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.networkIsAvailable; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.storageContainsExactly; -import static com.refinedmods.refinedstorage.platform.common.constructordestructor.DestructorTestPlots.preparePlot; -import static net.minecraft.world.item.Items.DIRT; -import static net.minecraft.world.item.Items.STONE; -import static net.minecraft.world.level.material.Fluids.LAVA; -import static net.minecraft.world.level.material.Fluids.WATER; - -@GameTestHolder(IdentifierUtil.MOD_ID) -@PrefixGameTestTemplate(false) -public final class DestructorTest { - private DestructorTest() { - } - - @GameTest(template = "empty_15x15") - public static void shouldBreakBlock(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - helper.setBlock(pos.east(), Blocks.DIRT); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 11), - new ResourceAmount(asResource(STONE), 15) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldBreakBlockAllowlist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - destructor.setFilterMode(FilterMode.ALLOW); - destructor.setFilters(Set.of(asResource(DIRT))); - - helper.setBlock(pos.east(), Blocks.DIRT); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) - .thenExecute(() -> helper.setBlock(pos.east(), Blocks.STONE)) - .thenIdle(20) - .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.STONE, pos.east())) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 11), - new ResourceAmount(asResource(STONE), 15) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldBreakBlockBlocklist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - destructor.setFilterMode(FilterMode.BLOCK); - destructor.setFilters(Set.of(asResource(STONE))); - - helper.setBlock(pos.east(), Blocks.DIRT); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) - .thenExecute(() -> helper.setBlock(pos.east(), Blocks.STONE)) - .thenIdle(20) - .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.STONE, pos.east())) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 11), - new ResourceAmount(asResource(STONE), 15) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldPickupItemAllowlist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - destructor.setFilterMode(FilterMode.ALLOW); - destructor.setPickupItems(true); - destructor.setFilters(Set.of(asResource(DIRT))); - - helper.spawnItem(DIRT, pos.east()); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertItemEntityNotPresent(DIRT, pos.east(), 1)) - .thenExecute(() -> helper.spawnItem(STONE, pos.east())) - .thenIdle(20) - .thenWaitUntil(() -> helper.assertItemEntityPresent(STONE, pos.east(), 1)) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 11), - new ResourceAmount(asResource(STONE), 15) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldPickupItemBlocklist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - destructor.setFilterMode(FilterMode.BLOCK); - destructor.setPickupItems(true); - destructor.setFilters(Set.of(asResource(STONE))); - - helper.spawnItem(DIRT, pos.east()); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertItemEntityNotPresent(DIRT, pos.east(), 1)) - .thenExecute(() -> helper.spawnItem(STONE, pos.east())) - .thenIdle(20) - .thenWaitUntil(() -> helper.assertItemEntityPresent(STONE, pos.east(), 1)) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 11), - new ResourceAmount(asResource(STONE), 15) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldDrainFluidAllowlist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - destructor.setFilterMode(FilterMode.ALLOW); - destructor.setFilters(Set.of(asResource(WATER))); - - helper.setBlock(pos.east(), Blocks.WATER); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.WATER, pos.east())) - .thenExecute(() -> helper.setBlock(pos.east(), Blocks.DIRT)) - .thenIdle(20) - .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.DIRT, pos.east())) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 10), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldDrainFluidBlocklist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - destructor.setFilterMode(FilterMode.BLOCK); - destructor.setFilters(Set.of(asResource(LAVA))); - - helper.setBlock(pos.east(), Blocks.WATER); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.WATER, pos.east())) - .thenExecute(() -> helper.setBlock(pos.east(), Blocks.LAVA)) - .thenIdle(20) - .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.LAVA, pos.east())) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 10), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) - )) - .thenSucceed(); - }); - } -} diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorTestPlots.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorTestPlots.java deleted file mode 100644 index 9444e559c..000000000 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/DestructorTestPlots.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.constructordestructor; - -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.gametest.framework.GameTestSequence; -import org.apache.commons.lang3.function.TriConsumer; - -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.RSBLOCKS; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.requireBlockEntity; -import static net.minecraft.core.BlockPos.ZERO; - -final class DestructorTestPlots { - private DestructorTestPlots() { - } - - static void preparePlot(final GameTestHelper helper, - final Direction direction, - final TriConsumer consumer) { - helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); - helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); - helper.setBlock( - ZERO.above().above().north(), - RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) - ); - final BlockPos destructorPos = ZERO.above().above().above(); - helper.setBlock(destructorPos, RSBLOCKS.getDestructor().getDefault().rotated(direction)); - consumer.accept( - requireBlockEntity(helper, destructorPos, DestructorBlockEntity.class), - destructorPos, - helper.startSequence() - ); - } -} diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterTest.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterTest.java deleted file mode 100644 index dd4e4809f..000000000 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterTest.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.exporter; - -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil; - -import java.util.List; - -import net.minecraft.core.Direction; -import net.minecraft.gametest.framework.GameTest; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.LayeredCauldronBlock; -import net.neoforged.neoforge.gametest.GameTestHolder; -import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; - -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.asResource; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.containerContainsExactly; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.insert; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.networkIsAvailable; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.storageContainsExactly; -import static com.refinedmods.refinedstorage.platform.common.exporter.ExporterTestPlots.preparePlot; -import static net.minecraft.world.item.Items.DIAMOND_CHESTPLATE; -import static net.minecraft.world.item.Items.DIRT; -import static net.minecraft.world.item.Items.STONE; -import static net.minecraft.world.level.material.Fluids.WATER; - -@GameTestHolder(IdentifierUtil.MOD_ID) -@PrefixGameTestTemplate(false) -public final class ExporterTest { - private ExporterTest() { - } - - @GameTest(template = "empty_15x15") - public static void shouldExportItem(final GameTestHelper helper) { - preparePlot(helper, true, Direction.EAST, (exporter, pos, sequence) -> { - // Arrange - final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); - damagedDiamondChestplate.setDamageValue(500); - - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - insert(helper, network, asResource(damagedDiamondChestplate), 1); - })); - - // Act - exporter.setFilters(List.of(asResource(DIRT), asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); - - // Assert - sequence - .thenWaitUntil(containerContainsExactly( - helper, - pos.east(), - new ResourceAmount(asResource(DIRT), 1))) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 9), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(damagedDiamondChestplate), 1) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldExportItemFuzzy(final GameTestHelper helper) { - preparePlot(helper, true, Direction.EAST, (exporter, pos, sequence) -> { - // Arrange - final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); - damagedDiamondChestplate.setDamageValue(500); - - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - insert(helper, network, DIAMOND_CHESTPLATE, 1); - insert(helper, network, asResource(damagedDiamondChestplate), 1); - })); - - // Act - exporter.setFuzzyMode(true); - exporter.setFilters(List.of(asResource(DIAMOND_CHESTPLATE))); - - // Assert - sequence - .thenWaitUntil(containerContainsExactly( - helper, - pos.east(), - new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1), - new ResourceAmount(asResource(damagedDiamondChestplate), 1))) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 10), - new ResourceAmount(asResource(STONE), 15) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldExportFluid(final GameTestHelper helper) { - preparePlot(helper, false, Direction.EAST, (exporter, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - insert(helper, network, WATER, Platform.INSTANCE.getBucketAmount() * 2); - })); - - // Act - exporter.setFilters(List.of(asResource(WATER))); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockProperty(pos.east(), LayeredCauldronBlock.LEVEL, - LayeredCauldronBlock.MAX_FILL_LEVEL)) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 10), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) - )) - .thenSucceed(); - }); - } -} diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterTestPlots.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterTestPlots.java deleted file mode 100644 index 48fea077a..000000000 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/exporter/ExporterTestPlots.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.exporter; - -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.gametest.framework.GameTestSequence; -import net.minecraft.world.level.block.Blocks; -import org.apache.commons.lang3.function.TriConsumer; - -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.RSBLOCKS; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.requireBlockEntity; -import static net.minecraft.core.BlockPos.ZERO; - -final class ExporterTestPlots { - private ExporterTestPlots() { - } - - static void preparePlot(final GameTestHelper helper, - final boolean itemTest, - final Direction direction, - final TriConsumer consumer) { - helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); - helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); - helper.setBlock( - ZERO.above().above().north(), - RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) - ); - final BlockPos exporterPos = ZERO.above().above().above(); - helper.setBlock(exporterPos, RSBLOCKS.getExporter().getDefault().rotated(direction)); - helper.setBlock(exporterPos.east(), itemTest ? Blocks.CHEST : Blocks.CAULDRON); - consumer.accept( - requireBlockEntity(helper, exporterPos, ExporterBlockEntity.class), - exporterPos, - helper.startSequence() - ); - } -} diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterTest.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterTest.java deleted file mode 100644 index f2650ec82..000000000 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterTest.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.importer; - -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; -import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil; - -import java.util.Set; - -import net.minecraft.core.Direction; -import net.minecraft.gametest.framework.GameTest; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.LayeredCauldronBlock; -import net.neoforged.neoforge.gametest.GameTestHolder; -import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; - -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.asResource; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.containerContainsExactly; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.insert; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.networkIsAvailable; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.storageContainsExactly; -import static com.refinedmods.refinedstorage.platform.common.importer.ImporterTestPlots.prepareChest; -import static com.refinedmods.refinedstorage.platform.common.importer.ImporterTestPlots.preparePlot; -import static net.minecraft.world.item.Items.COBBLESTONE; -import static net.minecraft.world.item.Items.DIAMOND_CHESTPLATE; -import static net.minecraft.world.item.Items.DIRT; -import static net.minecraft.world.item.Items.STONE; -import static net.minecraft.world.level.material.Fluids.WATER; - -@GameTestHolder(IdentifierUtil.MOD_ID) -@PrefixGameTestTemplate(false) -public final class ImporterTest { - private ImporterTest() { - } - - @GameTest(template = "empty_15x15") - public static void shouldImportItem(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), - COBBLESTONE.getDefaultInstance().copyWithCount(3)); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertContainerEmpty(pos.east())) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 11), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(COBBLESTONE), 3) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldImportItemBlocklist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); - damagedDiamondChestplate.setDamageValue(500); - prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), - DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate); - - importer.setFuzzyMode(false); - importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); - importer.setFilterMode(FilterMode.BLOCK); - - // Assert - sequence - .thenWaitUntil(containerContainsExactly( - helper, - pos.east(), - new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1))) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 11), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(damagedDiamondChestplate), 1) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldImportItemFuzzyBlocklist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); - damagedDiamondChestplate.setDamageValue(500); - prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), - DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate); - - importer.setFuzzyMode(true); - importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); - importer.setFilterMode(FilterMode.BLOCK); - - // Assert - sequence - .thenIdle(10) - .thenWaitUntil(containerContainsExactly( - helper, - pos.east(), - new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1), - new ResourceAmount(asResource(damagedDiamondChestplate), 1))) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 11), - new ResourceAmount(asResource(STONE), 15) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldImportItemAllowlist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); - damagedDiamondChestplate.setDamageValue(500); - prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), - DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate); - - importer.setFuzzyMode(false); - importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); - importer.setFilterMode(FilterMode.ALLOW); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertContainerContains(pos.east(), DIRT)) - .thenWaitUntil(containerContainsExactly( - helper, - pos.east(), - new ResourceAmount(asResource(DIRT), 1), - new ResourceAmount(asResource(damagedDiamondChestplate), 1))) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 10), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldImportItemFuzzyAllowlist(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); - damagedDiamondChestplate.setDamageValue(500); - prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), - DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate); - - importer.setFuzzyMode(true); - importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); - importer.setFilterMode(FilterMode.ALLOW); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertContainerContains(pos.east(), DIRT)) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 10), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1), - new ResourceAmount(asResource(damagedDiamondChestplate), 1) - )) - .thenSucceed(); - }); - } - - @GameTest(template = "empty_15x15") - public static void shouldImportFluid(final GameTestHelper helper) { - preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { - // Arrange - sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insert(helper, network, DIRT, 10); - insert(helper, network, STONE, 15); - })); - - // Act - helper.setBlock(pos.east(), Blocks.WATER_CAULDRON.defaultBlockState() - .setValue(LayeredCauldronBlock.LEVEL, LayeredCauldronBlock.MAX_FILL_LEVEL)); - - // Assert - sequence - .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.CAULDRON, pos.east())) - .thenWaitUntil(storageContainsExactly( - helper, - pos, - new ResourceAmount(asResource(DIRT), 10), - new ResourceAmount(asResource(STONE), 15), - new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) - )) - .thenSucceed(); - }); - } -} diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterTestPlots.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterTestPlots.java deleted file mode 100644 index 54ec0431d..000000000 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/importer/ImporterTestPlots.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.importer; - -import com.refinedmods.refinedstorage.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage.platform.common.storage.ItemStorageType; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.gametest.framework.GameTestSequence; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; -import org.apache.commons.lang3.function.TriConsumer; - -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.RSBLOCKS; -import static com.refinedmods.refinedstorage.platform.common.GameTestUtil.requireBlockEntity; -import static net.minecraft.core.BlockPos.ZERO; - -final class ImporterTestPlots { - private ImporterTestPlots() { - } - - static void preparePlot(final GameTestHelper helper, - final Direction direction, - final TriConsumer consumer) { - helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); - helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); - helper.setBlock( - ZERO.above().above().north(), - RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) - ); - final BlockPos importerPos = ZERO.above().above().above(); - helper.setBlock(importerPos, RSBLOCKS.getImporter().getDefault().rotated(direction)); - consumer.accept( - requireBlockEntity(helper, importerPos, ImporterBlockEntity.class), - importerPos, - helper.startSequence() - ); - } - - static void prepareChest(final GameTestHelper helper, - final BlockPos pos, - final ItemStack... stacks) { - helper.setBlock(pos, Blocks.CHEST.defaultBlockState()); - final var chestBlockEntity = requireBlockEntity(helper, pos, BaseContainerBlockEntity.class); - for (int i = 0; i < stacks.length; i++) { - chestBlockEntity.setItem(i, stacks[i]); - } - } -} diff --git a/refinedstorage-query-parser/src/main/java/com/refinedmods/refinedstorage/query/parser/Parser.java b/refinedstorage-query-parser/src/main/java/com/refinedmods/refinedstorage/query/parser/Parser.java index 14b583868..bc283637b 100644 --- a/refinedstorage-query-parser/src/main/java/com/refinedmods/refinedstorage/query/parser/Parser.java +++ b/refinedstorage-query-parser/src/main/java/com/refinedmods/refinedstorage/query/parser/Parser.java @@ -78,7 +78,7 @@ private Node parseParen() { final Token currentAfterExpression = currentOrNull(); if (currentAfterExpression == null) { - throw new ParserException("Expected ')'", tokens.get(tokens.size() - 1)); + throw new ParserException("Expected ')'", tokens.getLast()); } if (currentAfterExpression.type() == TokenType.PAREN_CLOSE diff --git a/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/lexer/LexerTest.java b/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/lexer/LexerTest.java index 50cd0101e..341479880 100644 --- a/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/lexer/LexerTest.java +++ b/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/lexer/LexerTest.java @@ -42,7 +42,7 @@ void testSingleIdentifier() { // Assert assertThat(tokens).hasSize(1); - final Token token = tokens.get(0); + final Token token = tokens.getFirst(); assertToken(token, "hel1lo", TokenType.IDENTIFIER); assertPosition(token.position(), SOURCE_NAME, 1, 1, 1, 6); } @@ -55,7 +55,7 @@ void testMultipleIdentifiers() { // Assert assertThat(tokens).hasSize(3); - final Token hello = tokens.get(0); + final Token hello = tokens.getFirst(); assertToken(hello, "hello", TokenType.IDENTIFIER); assertPosition(hello.position(), SOURCE_NAME, 1, 1, 1, 5); @@ -76,7 +76,7 @@ void testSingleStringIdentifier() { // Assert assertThat(tokens).hasSize(1); - final Token token = tokens.get(0); + final Token token = tokens.getFirst(); assertToken(token, "h_el1lo", TokenType.IDENTIFIER); assertPosition(token.position(), SOURCE_NAME, 1, 1, 1, 9); } @@ -89,7 +89,7 @@ void testMultipleStringIdentifiers() { // Assert assertThat(tokens).hasSize(3); - final Token hello = tokens.get(0); + final Token hello = tokens.getFirst(); assertToken(hello, "hello", TokenType.IDENTIFIER); assertPosition(hello.position(), SOURCE_NAME, 1, 1, 1, 7); @@ -103,14 +103,14 @@ void testMultipleStringIdentifiers() { } @Test - void testEmptyStirngIdentifier() { + void testEmptyStringIdentifier() { // Act final List tokens = getTokens("\"\""); // Assert assertThat(tokens).hasSize(1); - final Token text = tokens.get(0); + final Token text = tokens.getFirst(); assertToken(text, "", TokenType.IDENTIFIER); assertPosition(text.position(), SOURCE_NAME, 1, 1, 1, 2); } @@ -133,7 +133,7 @@ void testNewLines() { // Assert assertThat(tokens).hasSize(4); - final Token hello = tokens.get(0); + final Token hello = tokens.getFirst(); assertToken(hello, "hello", TokenType.IDENTIFIER); assertPosition(hello.position(), SOURCE_NAME, 1, 1, 1, 5); @@ -158,7 +158,7 @@ void testIntegerNumber() { // Assert assertThat(tokens).hasSize(1); - final Token token = tokens.get(0); + final Token token = tokens.getFirst(); assertToken(token, "123", TokenType.INTEGER_NUMBER); assertPosition(token.position(), SOURCE_NAME, 1, 1, 1, 3); } @@ -171,7 +171,7 @@ void testFloatingNumber() { // Assert assertThat(tokens).hasSize(1); - final Token token = tokens.get(0); + final Token token = tokens.getFirst(); assertToken(token, "123.45", TokenType.FLOATING_NUMBER); assertPosition(token.position(), SOURCE_NAME, 1, 1, 1, 6); } @@ -209,7 +209,7 @@ void testTokenMappings() { assertThat(tokens).hasSize(9); - assertToken(tokens.get(0), "(", TokenType.PAREN_OPEN); + assertToken(tokens.getFirst(), "(", TokenType.PAREN_OPEN); assertToken(tokens.get(1), ")", TokenType.PAREN_CLOSE); assertToken(tokens.get(2), "+", TokenType.BIN_OP); assertToken(tokens.get(3), "-", TokenType.BIN_OP); @@ -219,7 +219,7 @@ void testTokenMappings() { assertToken(tokens.get(7), "&&", TokenType.BIN_OP); assertToken(tokens.get(8), "||", TokenType.BIN_OP); - assertPosition(tokens.get(0).position(), SOURCE_NAME, 1, 1, 1, 1); + assertPosition(tokens.getFirst().position(), SOURCE_NAME, 1, 1, 1, 1); assertPosition(tokens.get(1).position(), SOURCE_NAME, 1, 2, 1, 2); assertPosition(tokens.get(2).position(), SOURCE_NAME, 1, 3, 1, 3); assertPosition(tokens.get(3).position(), SOURCE_NAME, 1, 4, 1, 4); diff --git a/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/parser/ParserTest.java b/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/parser/ParserTest.java index 5f3001696..6cf950b59 100644 --- a/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/parser/ParserTest.java +++ b/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/parser/ParserTest.java @@ -26,7 +26,7 @@ void testIdentifierLiteral() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("hello"); + assertThat(nodes.getFirst()).hasToString("hello"); } @Test @@ -39,7 +39,7 @@ void testNumberLiteral() { // Assert assertThat(nodes).hasSize(2); - assertThat(nodes.get(0)).hasToString("1"); + assertThat(nodes.getFirst()).hasToString("1"); assertThat(nodes.get(1)).hasToString("2.345"); } @@ -54,7 +54,7 @@ void testSimpleBinaryOperator() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(1 + 2)"); + assertThat(nodes.getFirst()).hasToString("(1 + 2)"); } @Test @@ -72,7 +72,7 @@ void testLeftToRightBinaryOperatorAssociativity() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(((1 + 2) + 3) + 4)"); + assertThat(nodes.getFirst()).hasToString("(((1 + 2) + 3) + 4)"); } @Test @@ -90,7 +90,7 @@ void testRightToLeftBinaryOperatorAssociativity() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(1 ^ (2 ^ (3 ^ 4)))"); + assertThat(nodes.getFirst()).hasToString("(1 ^ (2 ^ (3 ^ 4)))"); } @Test @@ -114,7 +114,7 @@ void testBinaryOperatorAssociativity() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(((1 + 2) + 3) + (4 * (5 ^ (6 ^ 7))))"); + assertThat(nodes.getFirst()).hasToString("(((1 + 2) + 3) + (4 * (5 ^ (6 ^ 7))))"); } @Test @@ -134,7 +134,7 @@ void testBinaryOperatorPrecedence() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(x = ((1 + (2 * 3)) + 4))"); + assertThat(nodes.getFirst()).hasToString("(x = ((1 + (2 * 3)) + 4))"); } @Test @@ -152,7 +152,7 @@ void testLogicalOperatorPrecedence() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("((x && y) || (z && a))"); + assertThat(nodes.getFirst()).hasToString("((x && y) || (z && a))"); } @Test @@ -173,7 +173,7 @@ void testUnaryOperators() { // Assert assertThat(nodes).hasSize(3); - assertThat(nodes.get(0)).hasToString("!true"); + assertThat(nodes.getFirst()).hasToString("!true"); assertThat(nodes.get(1)).hasToString("++x"); assertThat(nodes.get(2)).hasToString("!((x && y))"); } @@ -202,7 +202,7 @@ void testParenthesis() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(1)"); + assertThat(nodes.getFirst()).hasToString("(1)"); } @Test @@ -226,7 +226,7 @@ void testNestedParenthesis() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(((1 + (1 * ((2 ^ 4))))))"); + assertThat(nodes.getFirst()).hasToString("(((1 + (1 * ((2 ^ 4))))))"); } @Test @@ -274,7 +274,7 @@ void testMultipleExpressionsInParenthesis() { // Assert final List nodes = builder.getNodes(); assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(a b)"); + assertThat(nodes.getFirst()).hasToString("(a b)"); } @Test diff --git a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannel.java b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannel.java deleted file mode 100644 index 2a54a342e..000000000 --- a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannel.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.refinedmods.refinedstorage.api.storage.channel; - -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.resource.list.listenable.ResourceListListener; -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorage; - -import java.util.Optional; -import java.util.function.Predicate; - -import org.apiguardian.api.API; - -/** - * A storage channel is the entry-point for various storage operations. - * It acts as a storage, and is usually backed by a - * {@link com.refinedmods.refinedstorage.api.storage.composite.CompositeStorage}. - */ -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") -public interface StorageChannel extends Storage, TrackedStorage { - /** - * Adds a listener to the storage channel. - * - * @param listener the listener - */ - void addListener(ResourceListListener listener); - - /** - * Removes a listener from the storage channel. - * - * @param listener the listener - */ - void removeListener(ResourceListListener listener); - - /** - * @param resource the resource to retrieve - * @return the resource amount for the given resource, if present - */ - Optional get(ResourceKey resource); - - /** - * Sorts the sources in the backing storage. - */ - void sortSources(); - - /** - * Adds a source to the channel and resorts all the sources. - * - * @param source the source - */ - void addSource(Storage source); - - /** - * Removes a source from the channel. - * - * @param source the source - */ - void removeSource(Storage source); - - /** - * Checks if a source is present. - * - * @param matcher a predicate - * @return whether the predicate matched - */ - boolean hasSource(Predicate matcher); -} diff --git a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImpl.java b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImpl.java deleted file mode 100644 index 48882a351..000000000 --- a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.refinedmods.refinedstorage.api.storage.channel; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; -import com.refinedmods.refinedstorage.api.resource.list.listenable.ListenableResourceList; -import com.refinedmods.refinedstorage.api.resource.list.listenable.ResourceListListener; -import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.api.storage.composite.CompositeStorageImpl; -import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; - -import java.util.Collection; -import java.util.Optional; -import java.util.function.Predicate; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") -public class StorageChannelImpl implements StorageChannel { - protected final CompositeStorageImpl storage; - private final ListenableResourceList list; - - public StorageChannelImpl() { - this(new ResourceListImpl()); - } - - public StorageChannelImpl(final ResourceList list) { - this.list = new ListenableResourceList(list); - this.storage = new CompositeStorageImpl(this.list); - } - - @Override - public void sortSources() { - storage.sortSources(); - } - - @Override - public void addSource(final Storage source) { - storage.addSource(source); - } - - @Override - public void removeSource(final Storage source) { - storage.removeSource(source); - } - - @Override - public boolean hasSource(final Predicate matcher) { - return storage.getSources().stream().anyMatch(matcher); - } - - @Override - public void addListener(final ResourceListListener listener) { - list.addListener(listener); - } - - @Override - public void removeListener(final ResourceListListener listener) { - list.removeListener(listener); - } - - @Override - public Optional get(final ResourceKey resource) { - return list.get(resource); - } - - @Override - public long extract(final ResourceKey resource, final long amount, final Action action, final Actor actor) { - return storage.extract(resource, amount, action, actor); - } - - @Override - public long insert(final ResourceKey resource, final long amount, final Action action, final Actor actor) { - return storage.insert(resource, amount, action, actor); - } - - @Override - public Collection getAll() { - return storage.getAll(); - } - - @Override - public long getStored() { - return storage.getStored(); - } - - @Override - public Optional findTrackedResourceByActorType(final ResourceKey resource, - final Class actorType) { - return storage.findTrackedResourceByActorType(resource, actorType); - } -} diff --git a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/channel/package-info.java b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/channel/package-info.java deleted file mode 100644 index b4779aeeb..000000000 --- a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/channel/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.api.storage.channel; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/root/RootStorage.java b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/root/RootStorage.java new file mode 100644 index 000000000..7a5920523 --- /dev/null +++ b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/root/RootStorage.java @@ -0,0 +1,67 @@ +package com.refinedmods.refinedstorage.api.storage.root; + +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.resource.list.listenable.ResourceListListener; +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorage; + +import java.util.Optional; +import java.util.function.Predicate; + +import org.apiguardian.api.API; + +/** + * The entry-point for various storage operations. + * It acts as a storage, and is usually backed by a + * {@link com.refinedmods.refinedstorage.api.storage.composite.CompositeStorage}. + */ +@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") +public interface RootStorage extends Storage, TrackedStorage { + /** + * Adds a listener. + * + * @param listener the listener + */ + void addListener(ResourceListListener listener); + + /** + * Removes a listener. + * + * @param listener the listener + */ + void removeListener(ResourceListListener listener); + + /** + * @param resource the resource to retrieve + * @return the resource amount for the given resource, if present + */ + Optional get(ResourceKey resource); + + /** + * Sorts the sources in the backing storage. + */ + void sortSources(); + + /** + * Adds a source and resorts all the sources. + * + * @param source the source + */ + void addSource(Storage source); + + /** + * Removes a source . + * + * @param source the source + */ + void removeSource(Storage source); + + /** + * Checks if a source is present. + * + * @param matcher a predicate + * @return whether the predicate matched + */ + boolean hasSource(Predicate matcher); +} diff --git a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/root/RootStorageImpl.java b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/root/RootStorageImpl.java new file mode 100644 index 000000000..92735fd32 --- /dev/null +++ b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/root/RootStorageImpl.java @@ -0,0 +1,95 @@ +package com.refinedmods.refinedstorage.api.storage.root; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.resource.list.ResourceList; +import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; +import com.refinedmods.refinedstorage.api.resource.list.listenable.ListenableResourceList; +import com.refinedmods.refinedstorage.api.resource.list.listenable.ResourceListListener; +import com.refinedmods.refinedstorage.api.storage.Actor; +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.composite.CompositeStorageImpl; +import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; + +import java.util.Collection; +import java.util.Optional; +import java.util.function.Predicate; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") +public class RootStorageImpl implements RootStorage { + protected final CompositeStorageImpl storage; + private final ListenableResourceList list; + + public RootStorageImpl() { + this(new ResourceListImpl()); + } + + public RootStorageImpl(final ResourceList list) { + this.list = new ListenableResourceList(list); + this.storage = new CompositeStorageImpl(this.list); + } + + @Override + public void sortSources() { + storage.sortSources(); + } + + @Override + public void addSource(final Storage source) { + storage.addSource(source); + } + + @Override + public void removeSource(final Storage source) { + storage.removeSource(source); + } + + @Override + public boolean hasSource(final Predicate matcher) { + return storage.getSources().stream().anyMatch(matcher); + } + + @Override + public void addListener(final ResourceListListener listener) { + list.addListener(listener); + } + + @Override + public void removeListener(final ResourceListListener listener) { + list.removeListener(listener); + } + + @Override + public Optional get(final ResourceKey resource) { + return list.get(resource); + } + + @Override + public long extract(final ResourceKey resource, final long amount, final Action action, final Actor actor) { + return storage.extract(resource, amount, action, actor); + } + + @Override + public long insert(final ResourceKey resource, final long amount, final Action action, final Actor actor) { + return storage.insert(resource, amount, action, actor); + } + + @Override + public Collection getAll() { + return storage.getAll(); + } + + @Override + public long getStored() { + return storage.getStored(); + } + + @Override + public Optional findTrackedResourceByActorType(final ResourceKey resource, + final Class actorType) { + return storage.findTrackedResourceByActorType(resource, actorType); + } +} diff --git a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/root/package-info.java b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/root/package-info.java new file mode 100644 index 000000000..ebe3af2f7 --- /dev/null +++ b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/root/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.api.storage.root; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java index ef7a787ba..633034084 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java @@ -273,12 +273,12 @@ void shouldNotTransferInvalidAmount() { assertThrows(NullPointerException.class, action3); } - record Transfer(@Nullable ResourceAmount amountInSource, - @Nullable ResourceAmount amountInDestination, - ResourceAmount amountToTransfer, - long amountExpectedToBeTransferred, - @Nullable ResourceAmount amountExpectedAfterTransferInSource, - @Nullable ResourceAmount amountExpectedAfterTransferInDestination) { + public record Transfer(@Nullable ResourceAmount amountInSource, + @Nullable ResourceAmount amountInDestination, + ResourceAmount amountToTransfer, + long amountExpectedToBeTransferred, + @Nullable ResourceAmount amountExpectedAfterTransferInSource, + @Nullable ResourceAmount amountExpectedAfterTransferInDestination) { } public static class TransferBuilder { diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImplTest.java deleted file mode 100644 index aac9d49cc..000000000 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImplTest.java +++ /dev/null @@ -1,295 +0,0 @@ -package com.refinedmods.refinedstorage.api.storage.channel; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage.api.resource.list.listenable.ResourceListListener; -import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.api.storage.composite.PriorityStorage; -import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; -import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl; - -import java.util.Optional; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; -import org.mockito.ArgumentCaptor; - -import static com.refinedmods.refinedstorage.api.storage.TestResource.A; -import static com.refinedmods.refinedstorage.api.storage.TestResource.B; -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.atMost; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; - -class StorageChannelImplTest { - private StorageChannel sut; - - @BeforeEach - void setUp() { - sut = new StorageChannelImpl(); - } - - @Test - void shouldAddSource() { - // Arrange - final Storage storage = new LimitedStorageImpl(10); - storage.insert(A, 8, Action.EXECUTE, EmptyActor.INSTANCE); - - // Act - sut.addSource(storage); - - final long inserted = sut.insert(A, 3, Action.EXECUTE, EmptyActor.INSTANCE); - - // Assert - assertThat(sut.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( - new ResourceAmount(A, 10) - ); - assertThat(inserted).isEqualTo(2); - } - - @Test - void shouldRemoveSource() { - // Arrange - final Storage storage = new LimitedStorageImpl(10); - storage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); - - final Storage removedStorage = new LimitedStorageImpl(10); - removedStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - - sut.addSource(storage); - sut.addSource(removedStorage); - - // Act - sut.removeSource(removedStorage); - - final long extracted = sut.extract(A, 15, Action.SIMULATE, EmptyActor.INSTANCE); - - // Assert - assertThat(sut.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( - new ResourceAmount(A, 5) - ); - assertThat(extracted).isEqualTo(5); - } - - @Test - void shouldFindMatchingStorage() { - // Arrange - final Storage matchedStorage = new LimitedStorageImpl(10); - matchedStorage.insert(A, 8, Action.EXECUTE, EmptyActor.INSTANCE); - sut.addSource(matchedStorage); - - final Storage unmatchedStorage = new LimitedStorageImpl(10); - - // Act - final boolean foundMatched = sut.hasSource(s -> s == matchedStorage); - final boolean foundUnmatched = sut.hasSource(s -> s == unmatchedStorage); - - // Assert - assertThat(foundMatched).isTrue(); - assertThat(foundUnmatched).isFalse(); - } - - @ParameterizedTest - @EnumSource(Action.class) - void shouldCallListenerOnInsertion(final Action action) { - // Arrange - sut.addSource(new LimitedStorageImpl(10)); - sut.insert(A, 2, Action.EXECUTE, EmptyActor.INSTANCE); - - final ResourceListListener listener = mock(ResourceListListener.class); - sut.addListener(listener); - - final var changedResource = ArgumentCaptor.forClass(ResourceList.OperationResult.class); - - // Act - sut.insert(A, 8, action, EmptyActor.INSTANCE); - - // Assert - if (action == Action.EXECUTE) { - verify(listener, atMost(1)).onChanged(changedResource.capture()); - - assertThat(changedResource.getValue().change()).isEqualTo(8); - assertThat(changedResource.getValue().resourceAmount()).usingRecursiveComparison().isEqualTo( - new ResourceAmount(A, 10) - ); - } else { - verify(listener, never()).onChanged(any()); - } - } - - @ParameterizedTest - @EnumSource(Action.class) - void shouldCallListenerOnExtraction(final Action action) { - // Arrange - final Storage storage = new LimitedStorageImpl(10); - storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - - sut.addSource(storage); - sut.extract(A, 2, Action.EXECUTE, EmptyActor.INSTANCE); - - final ResourceListListener listener = mock(ResourceListListener.class); - sut.addListener(listener); - - final var changedResource = ArgumentCaptor.forClass(ResourceList.OperationResult.class); - - // Act - sut.extract(A, 5, action, EmptyActor.INSTANCE); - - // Assert - if (action == Action.EXECUTE) { - verify(listener, atMost(1)).onChanged(changedResource.capture()); - - assertThat(changedResource.getValue().change()).isEqualTo(-5); - assertThat(changedResource.getValue().resourceAmount()).usingRecursiveComparison().isEqualTo( - new ResourceAmount(A, 3) - ); - } else { - verify(listener, never()).onChanged(any()); - } - } - - @Test - void shouldRemoveListener() { - // Arrange - sut.addSource(new LimitedStorageImpl(10)); - sut.insert(A, 2, Action.EXECUTE, EmptyActor.INSTANCE); - - final ResourceListListener listener = mock(ResourceListListener.class); - sut.addListener(listener); - - // Act - sut.removeListener(listener); - sut.insert(A, 8, Action.EXECUTE, EmptyActor.INSTANCE); - - // Assert - verify(listener, never()).onChanged(any()); - } - - @Test - void shouldInsert() { - // Arrange - sut.addSource(new LimitedStorageImpl(10)); - - // Act - final long inserted1 = sut.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); - final long inserted2 = sut.insert(B, 4, Action.EXECUTE, EmptyActor.INSTANCE); - - // Assert - assertThat(sut.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( - new ResourceAmount(A, 5), - new ResourceAmount(B, 4) - ); - assertThat(inserted1).isEqualTo(5); - assertThat(inserted2).isEqualTo(4); - assertThat(sut.getStored()).isEqualTo(9); - } - - @Test - void shouldExtract() { - // Arrange - final Storage storage = new LimitedStorageImpl(100); - storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE); - - sut.addSource(storage); - - // Act - final long extracted = sut.extract(A, 49, Action.EXECUTE, EmptyActor.INSTANCE); - - // Assert - assertThat(sut.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( - new ResourceAmount(A, 1) - ); - assertThat(extracted).isEqualTo(49); - assertThat(sut.getStored()).isEqualTo(1); - } - - @Test - void shouldBeAbleToRetrieveResource() { - // Arrange - final Storage storage = new LimitedStorageImpl(100); - storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE); - - sut.addSource(storage); - - // Act - final Optional resource = sut.get(A); - - // Assert - assertThat(resource).isPresent(); - assertThat(resource.get()).usingRecursiveComparison().isEqualTo(new ResourceAmount(A, 50)); - assertThat(sut.findTrackedResourceByActorType(A, EmptyActor.class)).isEmpty(); - } - - @Test - void shouldBeAbleToRetrieveTrackedResource() { - // Arrange - final Storage storage = new TrackedStorageImpl( - new LimitedStorageImpl(100), - () -> 0L - ); - - sut.addSource(storage); - - // Act - sut.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE); - - // Assert - final Optional value = sut.get(A); - assertThat(value).isPresent(); - assertThat(value.get()).usingRecursiveComparison().isEqualTo(new ResourceAmount(A, 50)); - - assertThat(sut.findTrackedResourceByActorType(A, EmptyActor.class)) - .get() - .usingRecursiveComparison() - .isEqualTo(new TrackedResource("Empty", 0)); - } - - @Test - void shouldNotBeAbleToRetrieveNonExistentResource() { - // Arrange - sut.addSource(new LimitedStorageImpl(100)); - - // Act - final Optional resource = sut.get(A); - - // Assert - assertThat(resource).isEmpty(); - } - - @Test - void shouldSortSources() { - // Arrange - final PriorityStorage storage1 = PriorityStorage.of(new LimitedStorageImpl(10), 0); - final PriorityStorage storage2 = PriorityStorage.of(new LimitedStorageImpl(10), 0); - final PriorityStorage storage3 = PriorityStorage.of(new LimitedStorageImpl(10), 0); - - sut.addSource(storage1); - sut.addSource(storage2); - sut.addSource(storage3); - - storage1.setPriority(8); - storage2.setPriority(15); - storage3.setPriority(2); - - // Act - sut.sortSources(); - - sut.insert(A, 15, Action.EXECUTE, EmptyActor.INSTANCE); - - // Assert - assertThat(storage2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( - new ResourceAmount(A, 10) - ); - assertThat(storage1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( - new ResourceAmount(A, 5) - ); - assertThat(storage3.getAll()).isEmpty(); - } -} diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java index 2086629f6..db2dcbfc4 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java @@ -204,6 +204,7 @@ void shouldOnlyRespectPriorityWhenSortingSourcesExplicitlyWhenChangingPriorityAf assertThat(storage2.getStored()).isEqualTo(2); } + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug @Test void shouldFindMostRecentChange() { // Arrange diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/ExternalStorageInRootStorageTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/ExternalStorageInRootStorageTest.java new file mode 100644 index 000000000..e3e2b1880 --- /dev/null +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/ExternalStorageInRootStorageTest.java @@ -0,0 +1,210 @@ +package com.refinedmods.refinedstorage.api.storage.external; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.storage.EmptyActor; +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.root.RootStorage; +import com.refinedmods.refinedstorage.api.storage.root.RootStorageImpl; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; + +import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.A; +import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.A_ALTERNATIVE; +import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.A_TRANSFORMED; +import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.B; +import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.B_TRANSFORMED; +import static org.assertj.core.api.Assertions.assertThat; + +class ExternalStorageInRootStorageTest { + SpyingExternalStorageListener listener; + + @BeforeEach + void setUp() { + listener = new SpyingExternalStorageListener(); + } + + @Test + void shouldNotTakeExistingResourcesIntoConsiderationWhenBuildingInitialState() { + // Arrange + final Storage storage = new TransformingStorage(); + storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); + final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); + final RootStorage rootStorage = new RootStorageImpl(); + + // Act + rootStorage.addSource(sut); + + // Assert + assertThat(sut.getAll()).isEmpty(); + assertThat(sut.getStored()).isZero(); + assertThat(rootStorage.getAll()).isEmpty(); + assertThat(rootStorage.getStored()).isZero(); + assertThat(listener.resources).isEmpty(); + assertThat(listener.actors).isEmpty(); + } + + @Test + void shouldTakeExistingResourcesIntoConsiderationWhenDetectingChanges() { + // Arrange + final Storage storage = new TransformingStorage(); + storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); + final ExternalStorage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); + final RootStorage rootStorage = new RootStorageImpl(); + rootStorage.addSource(sut); + + // Act + sut.detectChanges(); + + // Assert + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + new ResourceAmount(A_TRANSFORMED, 10) + ); + assertThat(rootStorage.getStored()).isEqualTo(10); + assertThat(listener.resources).isEmpty(); + assertThat(listener.actors).isEmpty(); + } + + @Test + void shouldNoLongerPropagateChangesToRootStorageWhenRemoving() { + // Arrange + final Storage storage = new TransformingStorage(); + storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); + final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); + final RootStorage rootStorage = new RootStorageImpl(); + rootStorage.addSource(sut); + + // Act + rootStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); + rootStorage.removeSource(sut); + final long insertedStraightIntoExternalStorage = sut.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); + final long insertedIntoRootStorage = rootStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); + + // Assert + assertThat(insertedStraightIntoExternalStorage).isEqualTo(10); + assertThat(insertedIntoRootStorage).isZero(); + assertThat(sut.getAll()).isNotEmpty(); + assertThat(sut.getStored()).isEqualTo(25); + assertThat(rootStorage.getAll()).isEmpty(); + assertThat(rootStorage.getStored()).isZero(); + assertThat(listener.resources).containsExactly(A, A); + assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); + } + + @ParameterizedTest + @EnumSource(Action.class) + void shouldInsertAndDetectAndPropagateChanges(final Action action) { + // Arrange + final Storage storage = new TransformingStorage(); + final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); + final RootStorage rootStorage = new RootStorageImpl(); + rootStorage.addSource(sut); + + // Act + final long insertedA1 = rootStorage.insert(A, 10, action, EmptyActor.INSTANCE); + final long insertedA2 = rootStorage.insert(A, 1, action, EmptyActor.INSTANCE); + final long insertedB = rootStorage.insert(B, 5, action, EmptyActor.INSTANCE); + + // Assert + assertThat(insertedA1).isEqualTo(10); + assertThat(insertedA2).isEqualTo(1); + assertThat(insertedB).isEqualTo(5); + + if (action == Action.EXECUTE) { + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( + new ResourceAmount(A_TRANSFORMED, 11), + new ResourceAmount(B_TRANSFORMED, 5) + ); + assertThat(rootStorage.getStored()).isEqualTo(16); + assertThat(listener.resources).containsExactly(A, A, B); + assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); + } else { + assertThat(rootStorage.getAll()).isEmpty(); + assertThat(rootStorage.getStored()).isZero(); + assertThat(listener.resources).isEmpty(); + assertThat(listener.actors).isEmpty(); + } + } + + @ParameterizedTest + @EnumSource(Action.class) + void shouldExtractPartiallyAndDetectAndPropagateChanges(final Action action) { + // Arrange + final Storage storage = new TransformingStorage(); + final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); + sut.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); + sut.insert(A_ALTERNATIVE, 10, Action.EXECUTE, EmptyActor.INSTANCE); + sut.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); + final RootStorage rootStorage = new RootStorageImpl(); + rootStorage.addSource(sut); + + // Act + // this will try to extract A!(5) and A2!(5/2) + final long extracted = rootStorage.extract(A_TRANSFORMED, 5, action, EmptyActor.INSTANCE); + + // Assert + assertThat(extracted).isEqualTo(5); + + if (action == Action.EXECUTE) { + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( + new ResourceAmount(A_TRANSFORMED, 5), + new ResourceAmount(A_ALTERNATIVE, 8), + new ResourceAmount(B_TRANSFORMED, 10) + ); + assertThat(rootStorage.getStored()).isEqualTo(23); + assertThat(listener.resources).containsExactly(A, A_ALTERNATIVE, B, A_TRANSFORMED); + assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); + } else { + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( + new ResourceAmount(A_TRANSFORMED, 10), + new ResourceAmount(A_ALTERNATIVE, 10), + new ResourceAmount(B_TRANSFORMED, 10) + ); + assertThat(rootStorage.getStored()).isEqualTo(30); + assertThat(listener.resources).containsExactly(A, A_ALTERNATIVE, B); + assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); + } + } + + @ParameterizedTest + @EnumSource(Action.class) + void shouldExtractCompletelyAndDetectAndPropagateChanges(final Action action) { + // Arrange + final Storage storage = new TransformingStorage(); + final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); + sut.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); + sut.insert(A_ALTERNATIVE, 10, Action.EXECUTE, EmptyActor.INSTANCE); + sut.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); + final RootStorage rootStorage = new RootStorageImpl(); + rootStorage.addSource(sut); + + // Act + // this will try to extract A!(10) and A2!(10/2) + final long extracted = rootStorage.extract(A_TRANSFORMED, 10, action, EmptyActor.INSTANCE); + + // Assert + assertThat(extracted).isEqualTo(10); + + if (action == Action.EXECUTE) { + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( + new ResourceAmount(A_ALTERNATIVE, 5), + new ResourceAmount(B_TRANSFORMED, 10) + ); + assertThat(rootStorage.getStored()).isEqualTo(15); + assertThat(listener.resources).containsExactly(A, A_ALTERNATIVE, B, A_TRANSFORMED); + assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); + } else { + assertThat(rootStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( + new ResourceAmount(A_TRANSFORMED, 10), + new ResourceAmount(A_ALTERNATIVE, 10), + new ResourceAmount(B_TRANSFORMED, 10) + ); + assertThat(rootStorage.getStored()).isEqualTo(30); + assertThat(listener.resources).containsExactly(A, A_ALTERNATIVE, B); + assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); + } + } +} diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/StorageChannelExternalStorageTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/StorageChannelExternalStorageTest.java deleted file mode 100644 index ce320d947..000000000 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/StorageChannelExternalStorageTest.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.refinedmods.refinedstorage.api.storage.external; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.Storage; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage.api.storage.channel.StorageChannelImpl; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; - -import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.A; -import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.A_ALTERNATIVE; -import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.A_TRANSFORMED; -import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.B; -import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.B_TRANSFORMED; -import static org.assertj.core.api.Assertions.assertThat; - -class StorageChannelExternalStorageTest { - SpyingExternalStorageListener listener; - - @BeforeEach - void setUp() { - listener = new SpyingExternalStorageListener(); - } - - @Test - void shouldNotTakeExistingResourcesIntoConsiderationWhenBuildingInitialState() { - // Arrange - final Storage storage = new TransformingStorage(); - storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); - final StorageChannel storageChannel = new StorageChannelImpl(); - - // Act - storageChannel.addSource(sut); - - // Assert - assertThat(sut.getAll()).isEmpty(); - assertThat(sut.getStored()).isZero(); - assertThat(storageChannel.getAll()).isEmpty(); - assertThat(storageChannel.getStored()).isZero(); - assertThat(listener.resources).isEmpty(); - assertThat(listener.actors).isEmpty(); - } - - @Test - void shouldTakeExistingResourcesIntoConsiderationWhenDetectingChanges() { - // Arrange - final Storage storage = new TransformingStorage(); - storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - final ExternalStorage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); - final StorageChannel storageChannel = new StorageChannelImpl(); - storageChannel.addSource(sut); - - // Act - sut.detectChanges(); - - // Assert - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( - new ResourceAmount(A_TRANSFORMED, 10) - ); - assertThat(storageChannel.getStored()).isEqualTo(10); - assertThat(listener.resources).isEmpty(); - assertThat(listener.actors).isEmpty(); - } - - @Test - void shouldNoLongerPropagateChangesToStorageChannelWhenRemoving() { - // Arrange - final Storage storage = new TransformingStorage(); - storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); - final StorageChannel storageChannel = new StorageChannelImpl(); - storageChannel.addSource(sut); - - // Act - storageChannel.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); - storageChannel.removeSource(sut); - final long insertedStraightIntoExternalStorage = sut.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - final long insertedIntoStorageChannel = storageChannel.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - - // Assert - assertThat(insertedStraightIntoExternalStorage).isEqualTo(10); - assertThat(insertedIntoStorageChannel).isZero(); - assertThat(sut.getAll()).isNotEmpty(); - assertThat(sut.getStored()).isEqualTo(25); - assertThat(storageChannel.getAll()).isEmpty(); - assertThat(storageChannel.getStored()).isZero(); - assertThat(listener.resources).containsExactly(A, A); - assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); - } - - @ParameterizedTest - @EnumSource(Action.class) - void shouldInsertAndDetectAndPropagateChanges(final Action action) { - // Arrange - final Storage storage = new TransformingStorage(); - final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); - final StorageChannel storageChannel = new StorageChannelImpl(); - storageChannel.addSource(sut); - - // Act - final long insertedA1 = storageChannel.insert(A, 10, action, EmptyActor.INSTANCE); - final long insertedA2 = storageChannel.insert(A, 1, action, EmptyActor.INSTANCE); - final long insertedB = storageChannel.insert(B, 5, action, EmptyActor.INSTANCE); - - // Assert - assertThat(insertedA1).isEqualTo(10); - assertThat(insertedA2).isEqualTo(1); - assertThat(insertedB).isEqualTo(5); - - if (action == Action.EXECUTE) { - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( - new ResourceAmount(A_TRANSFORMED, 11), - new ResourceAmount(B_TRANSFORMED, 5) - ); - assertThat(storageChannel.getStored()).isEqualTo(16); - assertThat(listener.resources).containsExactly(A, A, B); - assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); - } else { - assertThat(storageChannel.getAll()).isEmpty(); - assertThat(storageChannel.getStored()).isZero(); - assertThat(listener.resources).isEmpty(); - assertThat(listener.actors).isEmpty(); - } - } - - @ParameterizedTest - @EnumSource(Action.class) - void shouldExtractPartiallyAndDetectAndPropagateChanges(final Action action) { - // Arrange - final Storage storage = new TransformingStorage(); - final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); - sut.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - sut.insert(A_ALTERNATIVE, 10, Action.EXECUTE, EmptyActor.INSTANCE); - sut.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); - final StorageChannel storageChannel = new StorageChannelImpl(); - storageChannel.addSource(sut); - - // Act - // this will try to extract A!(5) and A2!(5/2) - final long extracted = storageChannel.extract(A_TRANSFORMED, 5, action, EmptyActor.INSTANCE); - - // Assert - assertThat(extracted).isEqualTo(5); - - if (action == Action.EXECUTE) { - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( - new ResourceAmount(A_TRANSFORMED, 5), - new ResourceAmount(A_ALTERNATIVE, 8), - new ResourceAmount(B_TRANSFORMED, 10) - ); - assertThat(storageChannel.getStored()).isEqualTo(23); - assertThat(listener.resources).containsExactly(A, A_ALTERNATIVE, B, A_TRANSFORMED); - assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); - } else { - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( - new ResourceAmount(A_TRANSFORMED, 10), - new ResourceAmount(A_ALTERNATIVE, 10), - new ResourceAmount(B_TRANSFORMED, 10) - ); - assertThat(storageChannel.getStored()).isEqualTo(30); - assertThat(listener.resources).containsExactly(A, A_ALTERNATIVE, B); - assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); - } - } - - @ParameterizedTest - @EnumSource(Action.class) - void shouldExtractCompletelyAndDetectAndPropagateChanges(final Action action) { - // Arrange - final Storage storage = new TransformingStorage(); - final Storage sut = new ExternalStorage(new ExternalStorageProviderImpl(storage), listener); - sut.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - sut.insert(A_ALTERNATIVE, 10, Action.EXECUTE, EmptyActor.INSTANCE); - sut.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); - final StorageChannel storageChannel = new StorageChannelImpl(); - storageChannel.addSource(sut); - - // Act - // this will try to extract A!(10) and A2!(10/2) - final long extracted = storageChannel.extract(A_TRANSFORMED, 10, action, EmptyActor.INSTANCE); - - // Assert - assertThat(extracted).isEqualTo(10); - - if (action == Action.EXECUTE) { - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( - new ResourceAmount(A_ALTERNATIVE, 5), - new ResourceAmount(B_TRANSFORMED, 10) - ); - assertThat(storageChannel.getStored()).isEqualTo(15); - assertThat(listener.resources).containsExactly(A, A_ALTERNATIVE, B, A_TRANSFORMED); - assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); - } else { - assertThat(storageChannel.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( - new ResourceAmount(A_TRANSFORMED, 10), - new ResourceAmount(A_ALTERNATIVE, 10), - new ResourceAmount(B_TRANSFORMED, 10) - ); - assertThat(storageChannel.getStored()).isEqualTo(30); - assertThat(listener.resources).containsExactly(A, A_ALTERNATIVE, B); - assertThat(listener.actors).containsOnly(EmptyActor.INSTANCE); - } - } -} diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/root/RootStorageImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/root/RootStorageImplTest.java new file mode 100644 index 000000000..67896ab94 --- /dev/null +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/root/RootStorageImplTest.java @@ -0,0 +1,296 @@ +package com.refinedmods.refinedstorage.api.storage.root; + +import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.list.ResourceList; +import com.refinedmods.refinedstorage.api.resource.list.listenable.ResourceListListener; +import com.refinedmods.refinedstorage.api.storage.EmptyActor; +import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.composite.PriorityStorage; +import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; +import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; +import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl; + +import java.util.Optional; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; +import org.mockito.ArgumentCaptor; + +import static com.refinedmods.refinedstorage.api.storage.TestResource.A; +import static com.refinedmods.refinedstorage.api.storage.TestResource.B; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.atMost; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; + +class RootStorageImplTest { + private RootStorage sut; + + @BeforeEach + void setUp() { + sut = new RootStorageImpl(); + } + + @Test + void shouldAddSource() { + // Arrange + final Storage storage = new LimitedStorageImpl(10); + storage.insert(A, 8, Action.EXECUTE, EmptyActor.INSTANCE); + + // Act + sut.addSource(storage); + + final long inserted = sut.insert(A, 3, Action.EXECUTE, EmptyActor.INSTANCE); + + // Assert + assertThat(sut.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( + new ResourceAmount(A, 10) + ); + assertThat(inserted).isEqualTo(2); + } + + @Test + void shouldRemoveSource() { + // Arrange + final Storage storage = new LimitedStorageImpl(10); + storage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); + + final Storage removedStorage = new LimitedStorageImpl(10); + removedStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); + + sut.addSource(storage); + sut.addSource(removedStorage); + + // Act + sut.removeSource(removedStorage); + + final long extracted = sut.extract(A, 15, Action.SIMULATE, EmptyActor.INSTANCE); + + // Assert + assertThat(sut.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( + new ResourceAmount(A, 5) + ); + assertThat(extracted).isEqualTo(5); + } + + @Test + void shouldFindMatchingStorage() { + // Arrange + final Storage matchedStorage = new LimitedStorageImpl(10); + matchedStorage.insert(A, 8, Action.EXECUTE, EmptyActor.INSTANCE); + sut.addSource(matchedStorage); + + final Storage unmatchedStorage = new LimitedStorageImpl(10); + + // Act + final boolean foundMatched = sut.hasSource(s -> s == matchedStorage); + final boolean foundUnmatched = sut.hasSource(s -> s == unmatchedStorage); + + // Assert + assertThat(foundMatched).isTrue(); + assertThat(foundUnmatched).isFalse(); + } + + @ParameterizedTest + @EnumSource(Action.class) + void shouldCallListenerOnInsertion(final Action action) { + // Arrange + sut.addSource(new LimitedStorageImpl(10)); + sut.insert(A, 2, Action.EXECUTE, EmptyActor.INSTANCE); + + final ResourceListListener listener = mock(ResourceListListener.class); + sut.addListener(listener); + + final var changedResource = ArgumentCaptor.forClass(ResourceList.OperationResult.class); + + // Act + sut.insert(A, 8, action, EmptyActor.INSTANCE); + + // Assert + if (action == Action.EXECUTE) { + verify(listener, atMost(1)).onChanged(changedResource.capture()); + + assertThat(changedResource.getValue().change()).isEqualTo(8); + assertThat(changedResource.getValue().resourceAmount()).usingRecursiveComparison().isEqualTo( + new ResourceAmount(A, 10) + ); + } else { + verify(listener, never()).onChanged(any()); + } + } + + @ParameterizedTest + @EnumSource(Action.class) + void shouldCallListenerOnExtraction(final Action action) { + // Arrange + final Storage storage = new LimitedStorageImpl(10); + storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); + + sut.addSource(storage); + sut.extract(A, 2, Action.EXECUTE, EmptyActor.INSTANCE); + + final ResourceListListener listener = mock(ResourceListListener.class); + sut.addListener(listener); + + final var changedResource = ArgumentCaptor.forClass(ResourceList.OperationResult.class); + + // Act + sut.extract(A, 5, action, EmptyActor.INSTANCE); + + // Assert + if (action == Action.EXECUTE) { + verify(listener, atMost(1)).onChanged(changedResource.capture()); + + assertThat(changedResource.getValue().change()).isEqualTo(-5); + assertThat(changedResource.getValue().resourceAmount()).usingRecursiveComparison().isEqualTo( + new ResourceAmount(A, 3) + ); + } else { + verify(listener, never()).onChanged(any()); + } + } + + @Test + void shouldRemoveListener() { + // Arrange + sut.addSource(new LimitedStorageImpl(10)); + sut.insert(A, 2, Action.EXECUTE, EmptyActor.INSTANCE); + + final ResourceListListener listener = mock(ResourceListListener.class); + sut.addListener(listener); + + // Act + sut.removeListener(listener); + sut.insert(A, 8, Action.EXECUTE, EmptyActor.INSTANCE); + + // Assert + verify(listener, never()).onChanged(any()); + } + + @Test + void shouldInsert() { + // Arrange + sut.addSource(new LimitedStorageImpl(10)); + + // Act + final long inserted1 = sut.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); + final long inserted2 = sut.insert(B, 4, Action.EXECUTE, EmptyActor.INSTANCE); + + // Assert + assertThat(sut.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder( + new ResourceAmount(A, 5), + new ResourceAmount(B, 4) + ); + assertThat(inserted1).isEqualTo(5); + assertThat(inserted2).isEqualTo(4); + assertThat(sut.getStored()).isEqualTo(9); + } + + @Test + void shouldExtract() { + // Arrange + final Storage storage = new LimitedStorageImpl(100); + storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE); + + sut.addSource(storage); + + // Act + final long extracted = sut.extract(A, 49, Action.EXECUTE, EmptyActor.INSTANCE); + + // Assert + assertThat(sut.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + new ResourceAmount(A, 1) + ); + assertThat(extracted).isEqualTo(49); + assertThat(sut.getStored()).isEqualTo(1); + } + + @Test + void shouldBeAbleToRetrieveResource() { + // Arrange + final Storage storage = new LimitedStorageImpl(100); + storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE); + + sut.addSource(storage); + + // Act + final Optional resource = sut.get(A); + + // Assert + assertThat(resource).isPresent(); + assertThat(resource.get()).usingRecursiveComparison().isEqualTo(new ResourceAmount(A, 50)); + assertThat(sut.findTrackedResourceByActorType(A, EmptyActor.class)).isEmpty(); + } + + @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") + void shouldBeAbleToRetrieveTrackedResource() { + // Arrange + final Storage storage = new TrackedStorageImpl( + new LimitedStorageImpl(100), + () -> 0L + ); + + sut.addSource(storage); + + // Act + sut.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE); + + // Assert + final Optional value = sut.get(A); + assertThat(value).isPresent(); + assertThat(value.get()).usingRecursiveComparison().isEqualTo(new ResourceAmount(A, 50)); + + assertThat(sut.findTrackedResourceByActorType(A, EmptyActor.class)) + .get() + .usingRecursiveComparison() + .isEqualTo(new TrackedResource("Empty", 0)); + } + + @Test + void shouldNotBeAbleToRetrieveNonExistentResource() { + // Arrange + sut.addSource(new LimitedStorageImpl(100)); + + // Act + final Optional resource = sut.get(A); + + // Assert + assertThat(resource).isEmpty(); + } + + @Test + void shouldSortSources() { + // Arrange + final PriorityStorage storage1 = PriorityStorage.of(new LimitedStorageImpl(10), 0); + final PriorityStorage storage2 = PriorityStorage.of(new LimitedStorageImpl(10), 0); + final PriorityStorage storage3 = PriorityStorage.of(new LimitedStorageImpl(10), 0); + + sut.addSource(storage1); + sut.addSource(storage2); + sut.addSource(storage3); + + storage1.setPriority(8); + storage2.setPriority(15); + storage3.setPriority(2); + + // Act + sut.sortSources(); + + sut.insert(A, 15, Action.EXECUTE, EmptyActor.INSTANCE); + + // Assert + assertThat(storage2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + new ResourceAmount(A, 10) + ); + assertThat(storage1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly( + new ResourceAmount(A, 5) + ); + assertThat(storage3.getAll()).isEmpty(); + } +} diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/tracked/TrackedStorageImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/tracked/TrackedStorageImplTest.java index 38820558d..c876a5500 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/tracked/TrackedStorageImplTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/tracked/TrackedStorageImplTest.java @@ -136,6 +136,7 @@ void shouldNotTrackResourceByInsertingToAlreadyFullStorage(final Action action) @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldTrackResourceByExtracting(final Action action) { // Arrange backed.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -172,6 +173,7 @@ void shouldNotTrackResourceByExtractingNothing(final Action action) { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldTrackMultipleResources() { // Act sut.insert(A, 1, Action.EXECUTE, FakeActors.FakeActor1.INSTANCE); @@ -193,6 +195,7 @@ void shouldTrackMultipleResources() { class UpdateTrackedResourceTest { @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldUpdateTrackedResourceByInserting(final Action action) { // Act sut.insert(A, 50, Action.EXECUTE, FakeActors.FakeActor1.INSTANCE); @@ -214,6 +217,7 @@ void shouldUpdateTrackedResourceByInserting(final Action action) { @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldNotUpdateTrackedResourceByInsertingToAnAlreadyFullStorage(final Action action) { // Act sut.insert(A, 100, Action.EXECUTE, FakeActors.FakeActor1.INSTANCE); @@ -228,6 +232,7 @@ void shouldNotUpdateTrackedResourceByInsertingToAnAlreadyFullStorage(final Actio @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldUpdateTrackedResourceByExtracting(final Action action) { // Arrange backed.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -252,6 +257,7 @@ void shouldUpdateTrackedResourceByExtracting(final Action action) { @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldNotUpdateTrackedResourceByExtractingNothing(final Action action) { // Arrange backed.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -268,6 +274,7 @@ void shouldNotUpdateTrackedResourceByExtractingNothing(final Action action) { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") void shouldBeAbleToUpdateMultipleTrackedResources() { // Act sut.insert(A, 1, Action.EXECUTE, FakeActors.FakeActor1.INSTANCE); diff --git a/settings.gradle.kts b/settings.gradle.kts index 19f3b009f..fb2b9aa5f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,7 +10,8 @@ dependencyResolutionManagement { } versionCatalogs { create("libs") { - from("com.refinedmods.refinedarchitect:refinedarchitect-versioning:0.16.4") + val refinedarchitectVersion: String by settings + from("com.refinedmods.refinedarchitect:refinedarchitect-versioning:${refinedarchitectVersion}") } } } @@ -30,17 +31,14 @@ pluginManagement { name = "Fabric" url = uri("https://maven.fabricmc.net/") } - maven { - name = "NeoForge" - url = uri("https://maven.neoforged.net/releases") - } } + val refinedarchitectVersion: String by settings plugins { - id("refinedarchitect.root").version("0.16.4") - id("refinedarchitect.base").version("0.16.4") - id("refinedarchitect.common").version("0.16.4") - id("refinedarchitect.neoforge").version("0.16.4") - id("refinedarchitect.fabric").version("0.16.4") + id("refinedarchitect.root").version(refinedarchitectVersion) + id("refinedarchitect.base").version(refinedarchitectVersion) + id("refinedarchitect.common").version(refinedarchitectVersion) + id("refinedarchitect.neoforge").version(refinedarchitectVersion) + id("refinedarchitect.fabric").version(refinedarchitectVersion) } } @@ -52,8 +50,10 @@ include("refinedstorage-query-parser") include("refinedstorage-grid-api") include("refinedstorage-network-api") include("refinedstorage-network") -include("refinedstorage-platform-api") -include("refinedstorage-platform-fabric") -include("refinedstorage-platform-neoforge") -include("refinedstorage-platform-common") +include("refinedstorage-common-api") +include("refinedstorage-common") +include("refinedstorage-fabric") +include("refinedstorage-fabric-api") +include("refinedstorage-neoforge") +include("refinedstorage-neoforge-api") include("refinedstorage-network-test")