diff --git a/CHANGELOG.md b/CHANGELOG.md index de77f5cc2..2ee7fb919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,20 +7,42 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [2.0.0-milestone.4.9] - 2024-11-01 + +### Added + +- Autocrafter Manager +- You can now configure the view type of the Autocrafter Manager: + - Visible (only show autocrafters that are configured to be visible to the Autocrafter Manager) + - Not full (only show autocrafters that are not full yet) + - All (show all autocrafters) + +### Changed + +- The search field in the Autocrafter Manager can now search in: + - Pattern inputs + - Pattern outputs + - Autocrafter names + - All of the above (by default) +- Due to technical limitations and the new filtering options listed above being client-side only, you can no longer shift-click patterns in the Autocrafter Manager. +- In the Autocrafter, you can now configure whether it is visible to the Autocrafter Manager (by default it's visible). + ## [2.0.0-milestone.4.8] - 2024-10-12 ### Added - Autocrafter + - Note: autocrafting itself hasn't been implemented yet. This is the in-game content, but not the autocrafting engine itself yet. - The Relay now has support for propagating autocrafting when not in pass-through mode. ### Changed +- The Crafter has been renamed to "Autocrafter". - Optimized memory usage and startup time of cable models. After updating, cables will appear disconnected, but this is only visual. Cause a block update to fix this. - Optimized performance of searching in the Grid. - Custom titles that overflow will now have a marquee effect instead, for every GUI. -- You can now define a priority in the Crafter. -- You can now change the name of a Crafter in the GUI. +- You can now define a priority in the Autocrafter. +- You can now change the name of a Autocrafter in the GUI. - Changed "Crafter mode" to "Locking mode" with following options: - Never - Lock until redstone pulse is received @@ -35,7 +57,6 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - The numbers on the crafting preview screen are now compacted with units. - When requesting autocrafting multiple resources at once, which can happen via a recipe mod, all the crafting requests are now listed on the side of the GUI. - You can now request autocrafting from the Storage Monitor if the resource count reaches zero. -- The Crafter has been renamed to "Autocrafter". ### Fixed @@ -775,7 +796,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.8...HEAD +[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.9...HEAD + +[2.0.0-milestone.4.9]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.8...v2.0.0-milestone.4.9 [2.0.0-milestone.4.8]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.7...v2.0.0-milestone.4.8 diff --git a/build.gradle.kts b/build.gradle.kts index 7ad772db3..e7891180d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,12 +21,3 @@ project.extensions.getByType().apply { ) } } - -allprojects { - apply(plugin = "publishing") - publishing { - repositories { - mavenLocal() - } - } -} diff --git a/refinedstorage-autocrafting-api/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/Pattern.java b/refinedstorage-autocrafting-api/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/Pattern.java index b4c84cf0d..ce80eeaa6 100644 --- a/refinedstorage-autocrafting-api/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/Pattern.java +++ b/refinedstorage-autocrafting-api/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/Pattern.java @@ -8,5 +8,7 @@ @API(status = API.Status.STABLE, since = "2.0.0-milestone.4.6") public interface Pattern { + Set getInputResources(); + Set getOutputResources(); } diff --git a/refinedstorage-autocrafting-api/src/test/java/com/refinedmods/refinedstorage/api/autocrafting/SimplePattern.java b/refinedstorage-autocrafting-api/src/test/java/com/refinedmods/refinedstorage/api/autocrafting/SimplePattern.java index c77a80e77..9f9a7c1eb 100644 --- a/refinedstorage-autocrafting-api/src/test/java/com/refinedmods/refinedstorage/api/autocrafting/SimplePattern.java +++ b/refinedstorage-autocrafting-api/src/test/java/com/refinedmods/refinedstorage/api/autocrafting/SimplePattern.java @@ -11,6 +11,11 @@ class SimplePattern implements Pattern { this.outputs = Set.of(outputs); } + @Override + public Set getInputResources() { + return Set.of(); + } + @Override public Set getOutputResources() { return outputs; diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/autocrafting/Autocrafter.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/autocrafting/Autocrafter.java new file mode 100644 index 000000000..0deca9609 --- /dev/null +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/autocrafting/Autocrafter.java @@ -0,0 +1,17 @@ +package com.refinedmods.refinedstorage.common.api.autocrafting; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.world.Container; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.9") +public interface Autocrafter { + Component getAutocrafterName(); + + Container getPatternContainer(); + + boolean isVisibleToTheAutocrafterManager(); + + BlockPos getLocalPosition(); +} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/autocrafting/PatternProviderItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/autocrafting/PatternProviderItem.java index 641fb5db2..a9382e04f 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/autocrafting/PatternProviderItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/autocrafting/PatternProviderItem.java @@ -12,6 +12,11 @@ @API(status = API.Status.STABLE, since = "2.0.0-milestone.4.6") public interface PatternProviderItem { + static boolean isValid(final ItemStack stack, final Level level) { + return stack.getItem() instanceof PatternProviderItem patternProviderItem + && patternProviderItem.getPattern(stack, level).isPresent(); + } + @Nullable UUID getId(ItemStack stack); diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/autocrafter_manager.json new file mode 100644 index 000000000..9f55b0a13 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/light_blue" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/light_blue", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_autocrafter_manager.json new file mode 100644 index 000000000..466d6130b --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/black_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/black", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/black", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/black", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/black", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/black", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/black" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/black", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/black", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/black", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/black", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/black", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/black", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_autocrafter_manager.json new file mode 100644 index 000000000..85f8e32e3 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/blue_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/blue" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/blue", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_autocrafter_manager.json new file mode 100644 index 000000000..a065672cd --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/brown_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/brown" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/brown", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_autocrafter_manager.json new file mode 100644 index 000000000..0d01eb2ae --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/cyan_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/cyan" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/cyan", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_autocrafter_manager.json new file mode 100644 index 000000000..fe3aac601 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/gray_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/gray" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/gray", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_autocrafter_manager.json new file mode 100644 index 000000000..7ee04d8e4 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/green_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/green", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/green", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/green", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/green", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/green", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/green" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/green", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/green", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/green", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/green", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/green", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/green", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_autocrafter_manager.json new file mode 100644 index 000000000..a69a2e2be --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/light_gray_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/light_gray" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/light_gray", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_autocrafter_manager.json new file mode 100644 index 000000000..16e4bece4 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/lime_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/lime" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/lime", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_autocrafter_manager.json new file mode 100644 index 000000000..ba9f345bd --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/magenta_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/magenta" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/magenta", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_autocrafter_manager.json new file mode 100644 index 000000000..0f3816d20 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/orange_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/orange" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/orange", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_autocrafter_manager.json new file mode 100644 index 000000000..ffd36dca1 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/pink_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/pink" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/pink", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_autocrafter_manager.json new file mode 100644 index 000000000..13bdb4b55 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/purple_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/purple" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/purple", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_autocrafter_manager.json new file mode 100644 index 000000000..6ba12bd88 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/red_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/red", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/red", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/red", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/red", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/red", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/red" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/red", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/red", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/red", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/red", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/red", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/red", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_autocrafter_manager.json new file mode 100644 index 000000000..ec13b6193 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/white_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/white", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/white", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/white", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/white", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/white", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/white" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/white", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/white", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/white", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/white", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/white", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/white", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_autocrafter_manager.json new file mode 100644 index 000000000..3e1c34025 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/blockstates/yellow_autocrafter_manager.json @@ -0,0 +1,110 @@ +{ + "variants": { + "active=false,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": -90 + }, + "active=false,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90 + }, + "active=false,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": 90, + "y": 90 + }, + "active=false,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 90 + }, + "active=false,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/inactive" + }, + "active=false,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 180 + }, + "active=false,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": -90 + }, + "active=false,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 180 + }, + "active=false,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90 + }, + "active=false,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "x": -90, + "y": 90 + }, + "active=false,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/inactive", + "y": 270 + }, + "active=true,direction=down_east": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "x": 90, + "y": -90 + }, + "active=true,direction=down_north": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "x": 90 + }, + "active=true,direction=down_south": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "x": 90, + "y": 180 + }, + "active=true,direction=down_west": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "x": 90, + "y": 90 + }, + "active=true,direction=east": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "y": 90 + }, + "active=true,direction=north": { + "model": "refinedstorage:block/autocrafter_manager/yellow" + }, + "active=true,direction=south": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "y": 180 + }, + "active=true,direction=up_east": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "x": -90, + "y": -90 + }, + "active=true,direction=up_north": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "x": -90, + "y": 180 + }, + "active=true,direction=up_south": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "x": -90 + }, + "active=true,direction=up_west": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "x": -90, + "y": 90 + }, + "active=true,direction=west": { + "model": "refinedstorage:block/autocrafter_manager/yellow", + "y": 270 + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/black.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/black.json new file mode 100644 index 000000000..6a0d37d8f --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/black.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/black", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/blue.json new file mode 100644 index 000000000..e62469428 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/blue.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/blue", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/brown.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/brown.json new file mode 100644 index 000000000..83f909ddd --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/brown.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/brown", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/cyan.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/cyan.json new file mode 100644 index 000000000..7df62a587 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/cyan.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/cyan", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/gray.json new file mode 100644 index 000000000..7ea072d5f --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/gray.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/gray", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/green.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/green.json new file mode 100644 index 000000000..e15704676 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/green.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/green", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/inactive.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/inactive.json new file mode 100644 index 000000000..2ffc2967b --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/inactive.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/inactive", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/light_blue.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/light_blue.json new file mode 100644 index 000000000..3825b534e --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/light_blue.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/light_blue", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/light_gray.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/light_gray.json new file mode 100644 index 000000000..116eb8074 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/light_gray.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/light_gray", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/lime.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/lime.json new file mode 100644 index 000000000..1f1f1c6bf --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/lime.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/lime", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/magenta.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/magenta.json new file mode 100644 index 000000000..8f861028e --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/magenta.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/magenta", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/orange.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/orange.json new file mode 100644 index 000000000..9e917fde9 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/orange.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/orange", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/pink.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/pink.json new file mode 100644 index 000000000..58bf54ae0 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/pink.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/pink", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/purple.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/purple.json new file mode 100644 index 000000000..4e8cb2920 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/purple.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/purple", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/red.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/red.json new file mode 100644 index 000000000..479e84319 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/red.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/red", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/white.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/white.json new file mode 100644 index 000000000..ac23a0530 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/white.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/white", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/yellow.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/yellow.json new file mode 100644 index 000000000..176f87ca8 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/block/autocrafter_manager/yellow.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/emissive_north_cutout", + "textures": { + "cutout": "refinedstorage:block/autocrafter_manager/cutouts/yellow", + "down": "refinedstorage:block/bottom", + "east": "refinedstorage:block/autocrafter_manager/right", + "north": "refinedstorage:block/autocrafter_manager/front", + "particle": "refinedstorage:block/autocrafter_manager/right", + "south": "refinedstorage:block/autocrafter_manager/back", + "up": "refinedstorage:block/autocrafter_manager/top", + "west": "refinedstorage:block/autocrafter_manager/left" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/autocrafter_manager.json new file mode 100644 index 000000000..b67ccc227 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/light_blue" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_autocrafter_manager.json new file mode 100644 index 000000000..666893c04 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/black_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/black" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_autocrafter_manager.json new file mode 100644 index 000000000..414f62a42 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/blue_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/blue" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_autocrafter_manager.json new file mode 100644 index 000000000..5f9201b07 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/brown_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/brown" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_autocrafter_manager.json new file mode 100644 index 000000000..59d8e8a38 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/cyan_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/cyan" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_autocrafter_manager.json new file mode 100644 index 000000000..3aed691f6 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/gray_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/gray" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_autocrafter_manager.json new file mode 100644 index 000000000..dcde0ae04 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/green_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/green" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_autocrafter_manager.json new file mode 100644 index 000000000..6508562b0 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/light_gray_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/light_gray" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_autocrafter_manager.json new file mode 100644 index 000000000..951836667 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/lime_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/lime" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_autocrafter_manager.json new file mode 100644 index 000000000..1ac4bf130 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/magenta_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/magenta" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_autocrafter_manager.json new file mode 100644 index 000000000..02093b5a4 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/orange_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/orange" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_autocrafter_manager.json new file mode 100644 index 000000000..dd2d03e46 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/pink_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/pink" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_autocrafter_manager.json new file mode 100644 index 000000000..8d1da2933 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/purple_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/purple" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_autocrafter_manager.json new file mode 100644 index 000000000..1bb2be211 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/red_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/red" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_autocrafter_manager.json new file mode 100644 index 000000000..b463c5d1f --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/white_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/white" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_autocrafter_manager.json new file mode 100644 index 000000000..117fe30a4 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/assets/refinedstorage/models/item/yellow_autocrafter_manager.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/autocrafter_manager/yellow" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_autocrafter_manager.json new file mode 100644 index 000000000..f4fb13766 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/black_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/black_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/black_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_autocrafter_manager.json new file mode 100644 index 000000000..30e2f0c40 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/blue_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/blue_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/blue_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_autocrafter_manager.json new file mode 100644 index 000000000..81b6a63db --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/brown_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/brown_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/brown_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_autocrafter_manager.json new file mode 100644 index 000000000..10f89f732 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/cyan_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/cyan_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/cyan_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_autocrafter_manager.json new file mode 100644 index 000000000..575754797 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/gray_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/gray_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/gray_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_autocrafter_manager.json new file mode 100644 index 000000000..a2eb0c10b --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/green_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/green_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/green_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_autocrafter_manager.json new file mode 100644 index 000000000..db6454af9 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_blue_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/light_blue_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/light_blue_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_autocrafter_manager.json new file mode 100644 index 000000000..da0b03028 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/light_gray_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/light_gray_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/light_gray_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_autocrafter_manager.json new file mode 100644 index 000000000..3fb336d49 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/lime_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/lime_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/lime_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_autocrafter_manager.json new file mode 100644 index 000000000..e67e14829 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/magenta_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/magenta_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/magenta_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_autocrafter_manager.json new file mode 100644 index 000000000..e6eb48703 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/orange_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/orange_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/orange_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_autocrafter_manager.json new file mode 100644 index 000000000..a62f81935 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/pink_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/pink_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/pink_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_autocrafter_manager.json new file mode 100644 index 000000000..086c93ce5 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/purple_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/purple_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/purple_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_autocrafter_manager.json new file mode 100644 index 000000000..4429ac710 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/red_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/red_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/red_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_autocrafter_manager.json new file mode 100644 index 000000000..5ed020636 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/white_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/white_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/white_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_autocrafter_manager.json new file mode 100644 index 000000000..e52711be8 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/advancement/recipes/misc/coloring/yellow_autocrafter_manager.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_autocrafter_managers": { + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage:coloring/yellow_autocrafter_manager" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_autocrafter_managers" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage:coloring/yellow_autocrafter_manager" + ] + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/autocrafter_manager.json new file mode 100644 index 000000000..a3ed4210b --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_autocrafter_manager.json new file mode 100644 index 000000000..311d9e14d --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:black_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/black_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_autocrafter_manager.json new file mode 100644 index 000000000..fff056fff --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:blue_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/blue_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_autocrafter_manager.json new file mode 100644 index 000000000..5772b62ae --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:brown_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/brown_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_autocrafter_manager.json new file mode 100644 index 000000000..523e1adca --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:cyan_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/cyan_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_autocrafter_manager.json new file mode 100644 index 000000000..907bdf7f1 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:gray_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/gray_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_autocrafter_manager.json new file mode 100644 index 000000000..a4b5d9790 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:green_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/green_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_autocrafter_manager.json new file mode 100644 index 000000000..fde016b4a --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:light_gray_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/light_gray_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_autocrafter_manager.json new file mode 100644 index 000000000..f6f5cb187 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:lime_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/lime_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_autocrafter_manager.json new file mode 100644 index 000000000..61f860acd --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:magenta_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/magenta_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_autocrafter_manager.json new file mode 100644 index 000000000..4b05ec833 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:orange_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/orange_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_autocrafter_manager.json new file mode 100644 index 000000000..0a889d982 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:pink_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/pink_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_autocrafter_manager.json new file mode 100644 index 000000000..80dd54c2a --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:purple_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/purple_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_autocrafter_manager.json new file mode 100644 index 000000000..7495e57fe --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:red_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/red_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_autocrafter_manager.json new file mode 100644 index 000000000..746f1640a --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:white_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/white_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_autocrafter_manager.json new file mode 100644 index 000000000..609d9f149 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_autocrafter_manager.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage:yellow_autocrafter_manager" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage:blocks/yellow_autocrafter_manager" +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_autocrafter_manager.json new file mode 100644 index 000000000..f7f36235c --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/black_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/black" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:black_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_autocrafter_manager.json new file mode 100644 index 000000000..3e849bf79 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/blue_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/blue" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:blue_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_autocrafter_manager.json new file mode 100644 index 000000000..00c31120a --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/brown_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/brown" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:brown_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_autocrafter_manager.json new file mode 100644 index 000000000..7361a3205 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/cyan_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/cyan" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:cyan_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_autocrafter_manager.json new file mode 100644 index 000000000..7c57a97e7 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/gray_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/gray" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:gray_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_autocrafter_manager.json new file mode 100644 index 000000000..7d3ad45e9 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/green_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/green" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:green_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_autocrafter_manager.json new file mode 100644 index 000000000..5e8d96831 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_blue_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/light_blue" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_autocrafter_manager.json new file mode 100644 index 000000000..6cc9b362b --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/light_gray_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/light_gray" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:light_gray_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_autocrafter_manager.json new file mode 100644 index 000000000..238681743 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/lime_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/lime" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:lime_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_autocrafter_manager.json new file mode 100644 index 000000000..062d4b373 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/magenta_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/magenta" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:magenta_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_autocrafter_manager.json new file mode 100644 index 000000000..9eefd8431 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/orange_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/orange" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:orange_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_autocrafter_manager.json new file mode 100644 index 000000000..91b40b096 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/pink_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/pink" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:pink_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_autocrafter_manager.json new file mode 100644 index 000000000..ac0f70b90 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/purple_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/purple" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:purple_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_autocrafter_manager.json new file mode 100644 index 000000000..c7df37ce7 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/red_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/red" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:red_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_autocrafter_manager.json new file mode 100644 index 000000000..675dd6183 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/white_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/white" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:white_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_autocrafter_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_autocrafter_manager.json new file mode 100644 index 000000000..64c0ab243 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/recipe/coloring/yellow_autocrafter_manager.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage:autocrafter_managers" + }, + { + "tag": "c:dyes/yellow" + } + ], + "result": { + "count": 1, + "id": "refinedstorage:yellow_autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/autocrafter_managers.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/autocrafter_managers.json new file mode 100644 index 000000000..3a4daa615 --- /dev/null +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/tags/item/autocrafter_managers.json @@ -0,0 +1,20 @@ +{ + "values": [ + "refinedstorage:white_autocrafter_manager", + "refinedstorage:orange_autocrafter_manager", + "refinedstorage:magenta_autocrafter_manager", + "refinedstorage:autocrafter_manager", + "refinedstorage:yellow_autocrafter_manager", + "refinedstorage:lime_autocrafter_manager", + "refinedstorage:pink_autocrafter_manager", + "refinedstorage:gray_autocrafter_manager", + "refinedstorage:light_gray_autocrafter_manager", + "refinedstorage:cyan_autocrafter_manager", + "refinedstorage:purple_autocrafter_manager", + "refinedstorage:blue_autocrafter_manager", + "refinedstorage:brown_autocrafter_manager", + "refinedstorage:green_autocrafter_manager", + "refinedstorage:red_autocrafter_manager", + "refinedstorage:black_autocrafter_manager" + ] +} \ No newline at end of file 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 index 8526ff4ca..58ee5dd10 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java @@ -3,8 +3,9 @@ import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeMapping; -import com.refinedmods.refinedstorage.common.autocrafting.AutocrafterScreen; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridScreen; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterScreen; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerScreen; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen; import com.refinedmods.refinedstorage.common.autocrafting.preview.AutocraftingPreviewContainerMenu; import com.refinedmods.refinedstorage.common.autocrafting.preview.AutocraftingPreviewScreen; import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorScreen; @@ -104,6 +105,7 @@ public AutocraftingPreviewScreen create(final AutocraftingPreviewContainerMenu m return new AutocraftingPreviewScreen(menu, inventory, title); } }); + registration.register(Menus.INSTANCE.getAutocrafterManager(), AutocrafterManagerScreen::new); } protected static void registerAlternativeGridHints() { 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 index c67803c40..848a97e24 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java @@ -13,18 +13,21 @@ 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.autocrafting.AutocrafterBlockEntity; -import com.refinedmods.refinedstorage.common.autocrafting.AutocrafterContainerMenu; -import com.refinedmods.refinedstorage.common.autocrafting.AutocrafterData; import com.refinedmods.refinedstorage.common.autocrafting.CraftingPatternState; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridBlockEntity; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridData; import com.refinedmods.refinedstorage.common.autocrafting.PatternItem; import com.refinedmods.refinedstorage.common.autocrafting.PatternState; import com.refinedmods.refinedstorage.common.autocrafting.ProcessingPatternState; import com.refinedmods.refinedstorage.common.autocrafting.SmithingTablePatternState; import com.refinedmods.refinedstorage.common.autocrafting.StonecutterPatternState; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterBlockEntity; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterData; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerBlockEntity; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerData; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridBlockEntity; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridData; import com.refinedmods.refinedstorage.common.configurationcard.ConfigurationCardItem; import com.refinedmods.refinedstorage.common.configurationcard.ConfigurationCardState; import com.refinedmods.refinedstorage.common.constructordestructor.BlockBreakDestructorStrategyFactory; @@ -343,6 +346,7 @@ protected final void registerBlocks(final RegistryCallback callback, Blocks.INSTANCE.getRelay().registerBlocks(callback); Blocks.INSTANCE.setDiskInterface(blockEntityProviders.diskInterface()).registerBlocks(callback); Blocks.INSTANCE.getAutocrafter().registerBlocks(callback); + Blocks.INSTANCE.getAutocrafterManager().registerBlocks(callback); } protected final void registerItems(final RegistryCallback callback) { @@ -366,6 +370,7 @@ protected final void registerItems(final RegistryCallback callback) { Blocks.INSTANCE.getRelay().registerItems(callback, Items.INSTANCE::addRelay); Blocks.INSTANCE.getDiskInterface().registerItems(callback, Items.INSTANCE::addDiskInterface); Blocks.INSTANCE.getAutocrafter().registerItems(callback, Items.INSTANCE::addAutocrafter); + Blocks.INSTANCE.getAutocrafterManager().registerItems(callback, Items.INSTANCE::addAutocrafterManager); registerStorageItems(callback); registerUpgrades(callback); } @@ -668,6 +673,11 @@ protected final void registerBlockEntities( ContentIds.AUTOCRAFTER, () -> typeFactory.create(AutocrafterBlockEntity::new, Blocks.INSTANCE.getAutocrafter().toArray()) )); + BlockEntities.INSTANCE.setAutocrafterManager(callback.register( + ContentIds.AUTOCRAFTER_MANAGER, + () -> typeFactory.create(AutocrafterManagerBlockEntity::new, + Blocks.INSTANCE.getAutocrafterManager().toArray()) + )); } protected final void registerMenus(final RegistryCallback> callback, @@ -791,6 +801,13 @@ protected final void registerMenus(final RegistryCallback> callback, ContentIds.AUTOCRAFTER, () -> extendedMenuTypeFactory.create(AutocrafterContainerMenu::new, AutocrafterData.STREAM_CODEC) )); + Menus.INSTANCE.setAutocrafterManager(callback.register( + ContentIds.AUTOCRAFTER_MANAGER, + () -> extendedMenuTypeFactory.create( + AutocrafterManagerContainerMenu::new, + AutocrafterManagerData.STREAM_CODEC + ) + )); } protected final void registerLootFunctions(final RegistryCallback> callback) { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java index 3daa6a815..f91ffc40e 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java @@ -1,6 +1,8 @@ package com.refinedmods.refinedstorage.common; import com.refinedmods.refinedstorage.api.grid.view.GridSortingDirection; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerSearchMode; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerViewType; import com.refinedmods.refinedstorage.common.grid.CraftingGridMatrixCloseBehavior; import com.refinedmods.refinedstorage.common.grid.GridSortingTypes; import com.refinedmods.refinedstorage.common.grid.GridViewType; @@ -75,6 +77,8 @@ public interface Config { AutocrafterEntry getAutocrafter(); + AutocrafterManagerEntry getAutocrafterManager(); + interface SimpleEnergyUsageEntry { long getEnergyUsage(); } @@ -212,4 +216,14 @@ interface RelayEntry { interface AutocrafterEntry extends SimpleEnergyUsageEntry { long getEnergyUsagePerPattern(); } + + interface AutocrafterManagerEntry extends SimpleEnergyUsageEntry { + void setSearchMode(AutocrafterManagerSearchMode searchMode); + + AutocrafterManagerSearchMode getSearchMode(); + + void setViewType(AutocrafterManagerViewType viewType); + + AutocrafterManagerViewType getViewType(); + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPattern.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPattern.java index b4e705e0d..46513896c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPattern.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPattern.java @@ -9,12 +9,14 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import java.util.stream.Collectors; class CraftingPattern implements Pattern { private final UUID id; private final List> inputs; private final ResourceAmount output; private final List byproducts; + private final Set inputResources; private final Set outputResources; CraftingPattern(final UUID id, @@ -24,6 +26,7 @@ class CraftingPattern implements Pattern { this.id = id; this.inputs = inputs; this.output = output; + this.inputResources = inputs.stream().flatMap(List::stream).collect(Collectors.toSet()); this.outputResources = Set.of(output.resource()); this.byproducts = byproducts; } @@ -33,6 +36,11 @@ public Set getOutputResources() { return outputResources; } + @Override + public Set getInputResources() { + return inputResources; + } + List> getInputs() { return inputs; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternInventory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternInventory.java index cbb2cfcc7..78510f38d 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternInventory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternInventory.java @@ -11,19 +11,20 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import static com.refinedmods.refinedstorage.common.autocrafting.AutocrafterBlockEntity.PATTERNS; -import static com.refinedmods.refinedstorage.common.autocrafting.AutocrafterBlockEntity.isValidPattern; +import static com.refinedmods.refinedstorage.common.api.autocrafting.PatternProviderItem.isValid; -class PatternInventory extends FilteredContainer { +public class PatternInventory extends FilteredContainer { @Nullable private Listener listener; - PatternInventory(final Supplier<@NullableType Level> levelSupplier) { - super(PATTERNS, - stack -> Optional.ofNullable(levelSupplier.get()).map(level -> isValidPattern(stack, level)).orElse(false)); + public PatternInventory(final int patterns, final Supplier<@NullableType Level> levelSupplier) { + super( + patterns, + stack -> Optional.ofNullable(levelSupplier.get()).map(level -> isValid(stack, level)).orElse(false) + ); } - void setListener(@Nullable final Listener listener) { + public void setListener(@Nullable final Listener listener) { this.listener = listener; } @@ -45,7 +46,7 @@ public void setItem(final int slot, final ItemStack stack) { } } - long getEnergyUsage() { + public long getEnergyUsage() { long patterns = 0; for (int i = 0; i < getContainerSize(); i++) { final ItemStack stack = getItem(i); @@ -56,7 +57,17 @@ long getEnergyUsage() { return patterns * Platform.INSTANCE.getConfig().getAutocrafter().getEnergyUsagePerPattern(); } - interface Listener { + @Override + public int getMaxStackSize() { + return 1; + } + + @Override + public int getMaxStackSize(final ItemStack stack) { + return 1; + } + + public interface Listener { void patternChanged(int slot); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternItem.java index f29f1e38e..34bb97c5d 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternItem.java @@ -76,7 +76,7 @@ public void appendHoverText(final ItemStack stack, } } - boolean hasMapping(final ItemStack stack) { + public boolean hasMapping(final ItemStack stack) { return stack.has(DataComponents.INSTANCE.getPatternState()); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternRendering.java index 5310342e1..5d0d4d124 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternRendering.java @@ -2,6 +2,9 @@ import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.autocrafting.PatternProviderItem; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterScreen; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerScreen; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; @@ -31,6 +34,8 @@ private static boolean canDisplayOutputInScreen(final ItemStack stack) { return switch (screen) { case PatternGridScreen patternGridScreen -> patternGridScreen.getMenu().isPatternInOutput(stack); case AutocrafterScreen autocrafterScreen -> autocrafterScreen.getMenu().containsPattern(stack); + case AutocrafterManagerScreen autocrafterManagerScreen -> + autocrafterManagerScreen.getMenu().containsPattern(stack); case null, default -> false; }; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternSlot.java index ab24426be..fdb3c1b86 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternSlot.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternSlot.java @@ -1,12 +1,13 @@ package com.refinedmods.refinedstorage.common.autocrafting; +import com.refinedmods.refinedstorage.common.api.autocrafting.PatternProviderItem; import com.refinedmods.refinedstorage.common.support.containermenu.ValidatedSlot; import net.minecraft.world.Container; import net.minecraft.world.level.Level; -class PatternSlot extends ValidatedSlot { - PatternSlot(final Container container, final int index, final int x, final int y, final Level level) { - super(container, index, x, y, stack -> AutocrafterBlockEntity.isValidPattern(stack, level)); +public class PatternSlot extends ValidatedSlot { + public PatternSlot(final Container container, final int index, final int x, final int y, final Level level) { + super(container, index, x, y, stack -> PatternProviderItem.isValid(stack, level)); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternState.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternState.java index 73b9d0032..49cd3735a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternState.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternState.java @@ -1,5 +1,6 @@ package com.refinedmods.refinedstorage.common.autocrafting; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternType; import com.refinedmods.refinedstorage.common.util.PlatformUtil; import java.util.UUID; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPattern.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPattern.java index 3240d43d8..c1784e076 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPattern.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPattern.java @@ -14,12 +14,14 @@ class ProcessingPattern implements Pattern { private final UUID id; private final List inputs; private final List outputs; + private final Set inputResources; private final Set outputResources; ProcessingPattern(final UUID id, final List inputs, final List outputs) { this.id = id; this.inputs = inputs; this.outputs = outputs; + this.inputResources = inputs.stream().map(ResourceAmount::resource).collect(Collectors.toSet()); this.outputResources = outputs.stream().map(ResourceAmount::resource).collect(Collectors.toSet()); } @@ -28,6 +30,11 @@ public Set getOutputResources() { return outputResources; } + @Override + public Set getInputResources() { + return inputResources; + } + List getOutputs() { return outputs; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePattern.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePattern.java index 602a187a7..fb7d0bc0c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePattern.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePattern.java @@ -14,6 +14,7 @@ class SmithingTablePattern implements Pattern { private final ItemResource base; private final ItemResource addition; private final ItemResource output; + private final Set inputResources; private final Set outputResources; SmithingTablePattern(final UUID id, @@ -26,6 +27,7 @@ class SmithingTablePattern implements Pattern { this.base = base; this.addition = addition; this.output = output; + this.inputResources = Set.of(template, base, addition); this.outputResources = Set.of(output); } @@ -34,6 +36,11 @@ public Set getOutputResources() { return outputResources; } + @Override + public Set getInputResources() { + return inputResources; + } + ItemResource getTemplate() { return template; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPattern.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPattern.java index 181c81443..c87d99454 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPattern.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPattern.java @@ -12,12 +12,14 @@ class StonecutterPattern implements Pattern { private final UUID id; private final ItemResource input; private final ItemResource output; + private final Set inputResources; private final Set outputResources; StonecutterPattern(final UUID id, final ItemResource input, final ItemResource output) { this.id = id; this.input = input; this.output = output; + this.inputResources = Set.of(input); this.outputResources = Set.of(output); } @@ -26,6 +28,11 @@ public Set getOutputResources() { return outputResources; } + @Override + public Set getInputResources() { + return inputResources; + } + ItemResource getInput() { return input; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/VanillaConstants.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/VanillaConstants.java index fcb7b4a36..df8751d4b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/VanillaConstants.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/VanillaConstants.java @@ -7,28 +7,28 @@ import org.joml.Quaternionf; import org.joml.Vector3f; -class VanillaConstants { - static final ResourceLocation EMPTY_SLOT_SMITHING_TEMPLATE_ARMOR_TRIM = +public final class VanillaConstants { + public static final ResourceLocation EMPTY_SLOT_SMITHING_TEMPLATE_ARMOR_TRIM = ResourceLocation.withDefaultNamespace("item/empty_slot_smithing_template_armor_trim"); - static final ResourceLocation EMPTY_SLOT_SMITHING_TEMPLATE_NETHERITE_UPGRADE = + public static final ResourceLocation EMPTY_SLOT_SMITHING_TEMPLATE_NETHERITE_UPGRADE = ResourceLocation.withDefaultNamespace("item/empty_slot_smithing_template_netherite_upgrade"); - static final List EMPTY_SLOT_SMITHING_TEMPLATES = + public static final List EMPTY_SLOT_SMITHING_TEMPLATES = List.of(EMPTY_SLOT_SMITHING_TEMPLATE_ARMOR_TRIM, EMPTY_SLOT_SMITHING_TEMPLATE_NETHERITE_UPGRADE); - static final Component MISSING_SMITHING_TEMPLATE_TOOLTIP = + public static final Component MISSING_SMITHING_TEMPLATE_TOOLTIP = Component.translatable("container.upgrade.missing_template_tooltip"); - static final ResourceLocation STONECUTTER_RECIPE_SELECTED_SPRITE = ResourceLocation.withDefaultNamespace( + public static final ResourceLocation STONECUTTER_RECIPE_SELECTED_SPRITE = ResourceLocation.withDefaultNamespace( "container/stonecutter/recipe_selected" ); - static final ResourceLocation STONECUTTER_RECIPE_HIGHLIGHTED_SPRITE = ResourceLocation.withDefaultNamespace( + public static final ResourceLocation STONECUTTER_RECIPE_HIGHLIGHTED_SPRITE = ResourceLocation.withDefaultNamespace( "container/stonecutter/recipe_highlighted" ); - static final ResourceLocation STONECUTTER_RECIPE_SPRITE = ResourceLocation.withDefaultNamespace( + public static final ResourceLocation STONECUTTER_RECIPE_SPRITE = ResourceLocation.withDefaultNamespace( "container/stonecutter/recipe" ); - static final Vector3f ARMOR_STAND_TRANSLATION = new Vector3f(); - static final Quaternionf ARMOR_STAND_ANGLE = (new Quaternionf()).rotationXYZ(0.43633232F, 0.0F, 3.1415927F); - static final int STONECUTTER_RECIPES_PER_ROW = 4; - static final int STONECUTTER_ROWS_VISIBLE = 3; + public static final Vector3f ARMOR_STAND_TRANSLATION = new Vector3f(); + public static final Quaternionf ARMOR_STAND_ANGLE = (new Quaternionf()).rotationXYZ(0.43633232F, 0.0F, 3.1415927F); + public static final int STONECUTTER_RECIPES_PER_ROW = 4; + public static final int STONECUTTER_ROWS_VISIBLE = 3; private VanillaConstants() { } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterBlock.java similarity index 97% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterBlock.java index 5b1311324..c0bd1e85b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterBlock.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; import com.refinedmods.refinedstorage.common.content.BlockColorMap; import com.refinedmods.refinedstorage.common.content.BlockConstants; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterBlockEntity.java similarity index 90% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterBlockEntity.java index a0c59c865..67eb5e339 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterBlockEntity.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; import com.refinedmods.refinedstorage.api.autocrafting.Pattern; import com.refinedmods.refinedstorage.api.network.impl.node.patternprovider.PatternProviderNetworkNode; import com.refinedmods.refinedstorage.common.Platform; import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; -import com.refinedmods.refinedstorage.common.api.autocrafting.PatternProviderItem; import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; +import com.refinedmods.refinedstorage.common.autocrafting.PatternInventory; import com.refinedmods.refinedstorage.common.content.BlockEntities; import com.refinedmods.refinedstorage.common.content.ContentNames; import com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock; @@ -48,11 +48,13 @@ public class AutocrafterBlockEntity extends AbstractBaseNetworkNodeContainerBloc private static final String TAG_PATTERNS = "patterns"; private static final String TAG_LOCK_MODE = "lm"; private static final String TAG_PRIORITY = "pri"; + private static final String TAG_VISIBLE_TO_THE_AUTOCRAFTER_MANAGER = "vaum"; - private final PatternInventory patternContainer = new PatternInventory(this::getLevel); + private final PatternInventory patternContainer = new PatternInventory(PATTERNS, this::getLevel); private final UpgradeContainer upgradeContainer; private LockMode lockMode = LockMode.NEVER; private int priority; + private boolean visibleToTheAutocrafterManager = true; public AutocrafterBlockEntity(final BlockPos pos, final BlockState state) { super( @@ -79,9 +81,12 @@ public AutocrafterBlockEntity(final BlockPos pos, final BlockState state) { @Override protected InWorldNetworkNodeContainer createMainContainer(final PatternProviderNetworkNode networkNode) { - return RefinedStorageApi.INSTANCE.createNetworkNodeContainer(this, networkNode) - .connectionStrategy(new AutocrafterConnectionStrategy(this::getBlockState, getBlockPos())) - .build(); + return new AutocrafterNetworkNodeContainer( + this, + networkNode, + "main", + new AutocrafterConnectionStrategy(this::getBlockState, getBlockPos()) + ); } FilteredContainer getPatternContainer() { @@ -199,6 +204,7 @@ public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provide super.writeConfiguration(tag, provider); tag.putInt(TAG_LOCK_MODE, LockModeSettings.getLockMode(lockMode)); tag.putInt(TAG_PRIORITY, priority); + tag.putBoolean(TAG_VISIBLE_TO_THE_AUTOCRAFTER_MANAGER, visibleToTheAutocrafterManager); } @Override @@ -221,6 +227,9 @@ public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider if (tag.contains(TAG_PRIORITY)) { priority = tag.getInt(TAG_PRIORITY); } + if (tag.contains(TAG_VISIBLE_TO_THE_AUTOCRAFTER_MANAGER)) { + visibleToTheAutocrafterManager = tag.getBoolean(TAG_VISIBLE_TO_THE_AUTOCRAFTER_MANAGER); + } } @Override @@ -230,12 +239,12 @@ protected boolean hasRedstoneMode() { @Override public List getUpgrades() { - return upgradeContainer.getUpgradeItems(); + return upgradeContainer.getUpgrades(); } @Override public boolean addUpgrade(final ItemStack upgradeStack) { - return upgradeContainer.addUpgradeItem(upgradeStack); + return upgradeContainer.addUpgrade(upgradeStack); } @Override @@ -274,6 +283,15 @@ void setPriority(final int priority) { setChanged(); } + boolean isVisibleToTheAutocrafterManager() { + return visibleToTheAutocrafterManager; + } + + void setVisibleToTheAutocrafterManager(final boolean visibleToTheAutocrafterManager) { + this.visibleToTheAutocrafterManager = visibleToTheAutocrafterManager; + setChanged(); + } + @Override public void setLevel(final Level level) { super.setLevel(level); @@ -300,9 +318,4 @@ protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState final BlockState newBlockState) { return AbstractDirectionalBlock.didDirectionChange(oldBlockState, newBlockState); } - - static boolean isValidPattern(final ItemStack stack, final Level level) { - return stack.getItem() instanceof PatternProviderItem patternProviderItem - && patternProviderItem.getPattern(stack, level).isPresent(); - } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterConnectionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterConnectionStrategy.java similarity index 93% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterConnectionStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterConnectionStrategy.java index 12e7161db..575abdf3b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterConnectionStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterConnectionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; import com.refinedmods.refinedstorage.common.support.network.ColoredConnectionStrategy; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterContainerMenu.java similarity index 88% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterContainerMenu.java index 3619372df..4f2307a70 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterContainerMenu.java @@ -1,5 +1,7 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; +import com.refinedmods.refinedstorage.common.autocrafting.PatternInventory; +import com.refinedmods.refinedstorage.common.autocrafting.PatternSlot; import com.refinedmods.refinedstorage.common.content.Menus; import com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu; import com.refinedmods.refinedstorage.common.support.FilteredContainer; @@ -22,6 +24,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; +import static com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterBlockEntity.PATTERNS; + public class AutocrafterContainerMenu extends AbstractBaseContainerMenu { private static final int PATTERN_SLOT_X = 8; private static final int PATTERN_SLOT_Y = 20; @@ -42,8 +46,9 @@ public AutocrafterContainerMenu(final int syncId, final Inventory playerInventor this.player = playerInventory.player; registerProperty(new ClientProperty<>(AutocrafterPropertyTypes.LOCK_MODE, LockMode.NEVER)); registerProperty(new ClientProperty<>(AutocrafterPropertyTypes.PRIORITY, 0)); + registerProperty(new ClientProperty<>(AutocrafterPropertyTypes.VISIBLE_TO_THE_AUTOCRAFTER_MANAGER, true)); addSlots( - new PatternInventory(playerInventory.player::level), + new PatternInventory(PATTERNS, playerInventory.player::level), new UpgradeContainer(UpgradeDestinations.AUTOCRAFTER) ); this.name = Component.empty(); @@ -70,6 +75,11 @@ public AutocrafterContainerMenu(final int syncId, autocrafter::getPriority, autocrafter::setPriority )); + registerProperty(new ServerProperty<>( + AutocrafterPropertyTypes.VISIBLE_TO_THE_AUTOCRAFTER_MANAGER, + autocrafter::isVisibleToTheAutocrafterManager, + autocrafter::setVisibleToTheAutocrafterManager + )); addSlots(autocrafter.getPatternContainer(), autocrafter.getUpgradeContainer()); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterData.java similarity index 87% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterData.java index 6cb7995df..8d22266ba 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterData.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterNetworkNodeContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterNetworkNodeContainer.java new file mode 100644 index 000000000..9a27c9b3c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterNetworkNodeContainer.java @@ -0,0 +1,36 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; + +import com.refinedmods.refinedstorage.api.network.node.NetworkNode; +import com.refinedmods.refinedstorage.common.api.autocrafting.Autocrafter; +import com.refinedmods.refinedstorage.common.api.support.network.ConnectionStrategy; +import com.refinedmods.refinedstorage.common.support.network.InWorldNetworkNodeContainerImpl; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.Container; + +class AutocrafterNetworkNodeContainer extends InWorldNetworkNodeContainerImpl implements Autocrafter { + private final AutocrafterBlockEntity blockEntity; + + AutocrafterNetworkNodeContainer(final AutocrafterBlockEntity blockEntity, + final NetworkNode node, + final String name, + final ConnectionStrategy connectionStrategy) { + super(blockEntity, node, name, 0, connectionStrategy, null); + this.blockEntity = blockEntity; + } + + @Override + public Component getAutocrafterName() { + return blockEntity.getName(); + } + + @Override + public Container getPatternContainer() { + return blockEntity.getPatternContainer(); + } + + @Override + public boolean isVisibleToTheAutocrafterManager() { + return blockEntity.isVisibleToTheAutocrafterManager(); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterPropertyTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterPropertyTypes.java similarity index 72% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterPropertyTypes.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterPropertyTypes.java index 3d7aca144..fdfbb3808 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterPropertyTypes.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterPropertyTypes.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; import com.refinedmods.refinedstorage.common.support.containermenu.PropertyType; import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; @@ -16,6 +16,10 @@ final class AutocrafterPropertyTypes { createIdentifier("crafter_priority") ); + static final PropertyType VISIBLE_TO_THE_AUTOCRAFTER_MANAGER = PropertyTypes.createBooleanProperty( + createIdentifier("visible_to_the_autocrafter_manager") + ); + private AutocrafterPropertyTypes() { } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterScreen.java similarity index 96% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterScreen.java index 913f464e6..ac8e67b6a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/AutocrafterScreen.java @@ -1,6 +1,7 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.autocrafting.PatternSlot; import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; import com.refinedmods.refinedstorage.common.support.AbstractFilterScreen; import com.refinedmods.refinedstorage.common.support.tooltip.HelpClientTooltipComponent; @@ -112,6 +113,9 @@ protected void init() { playerInventory, this )); + addSideButton(new VisibleToTheAutocrafterManagerSideButtonWidget( + getMenu().getProperty(AutocrafterPropertyTypes.VISIBLE_TO_THE_AUTOCRAFTER_MANAGER) + )); nameField = new SearchFieldWidget( font, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/LockMode.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/LockMode.java similarity index 91% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/LockMode.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/LockMode.java index 85bc748d5..f1059d83b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/LockMode.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/LockMode.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; public enum LockMode { NEVER, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/LockModeSettings.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/LockModeSettings.java similarity index 95% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/LockModeSettings.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/LockModeSettings.java index 0b9c8518b..951339e2a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/LockModeSettings.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/LockModeSettings.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; class LockModeSettings { private static final int NEVER = 0; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/LockModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/LockModeSideButtonWidget.java similarity index 90% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/LockModeSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/LockModeSideButtonWidget.java index 8253d98ba..77bea2ee8 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/LockModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/LockModeSideButtonWidget.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; @@ -13,21 +13,21 @@ class LockModeSideButtonWidget extends AbstractSideButtonWidget { private static final String PREFIX = "autocrafter.lock_mode"; private static final MutableComponent TITLE = createTranslation("gui", PREFIX); - private static final ResourceLocation NEVER = createIdentifier("widget/side_button/autocrafter_lock_mode/never"); + private static final ResourceLocation NEVER = createIdentifier("widget/side_button/autocrafter/lock_mode/never"); private static final ResourceLocation LOCK_UNTIL_REDSTONE_PULSE_RECEIVED = createIdentifier( - "widget/side_button/autocrafter_lock_mode/lock_until_redstone_pulse_is_received" + "widget/side_button/autocrafter/lock_mode/lock_until_redstone_pulse_is_received" ); private static final ResourceLocation LOCK_UNTIL_CONNECTED_MACHINE_IS_EMPTY = createIdentifier( - "widget/side_button/autocrafter_lock_mode/lock_until_connected_machine_is_empty" + "widget/side_button/autocrafter/lock_mode/lock_until_connected_machine_is_empty" ); private static final ResourceLocation LOCK_UNTIL_ALL_OUTPUTS_ARE_RECEIVED = createIdentifier( - "widget/side_button/autocrafter_lock_mode/lock_until_all_outputs_are_received" + "widget/side_button/autocrafter/lock_mode/lock_until_all_outputs_are_received" ); private static final ResourceLocation LOCK_UNTIL_HIGH_REDSTONE_SIGNAL = createIdentifier( - "widget/side_button/autocrafter_lock_mode/lock_until_high_redstone_signal" + "widget/side_button/autocrafter/lock_mode/lock_until_high_redstone_signal" ); private static final ResourceLocation LOCK_UNTIL_LOW_REDSTONE_SIGNAL = createIdentifier( - "widget/side_button/autocrafter_lock_mode/lock_until_low_redstone_signal" + "widget/side_button/autocrafter/lock_mode/lock_until_low_redstone_signal" ); private static final MutableComponent NEVER_TITLE = createTranslation("gui", PREFIX + ".never"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/VisibleToTheAutocrafterManagerSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/VisibleToTheAutocrafterManagerSideButtonWidget.java new file mode 100644 index 000000000..ef6d4f2d9 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/VisibleToTheAutocrafterManagerSideButtonWidget.java @@ -0,0 +1,34 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; + +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 net.minecraft.resources.ResourceLocation; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class VisibleToTheAutocrafterManagerSideButtonWidget extends AbstractYesNoSideButtonWidget { + private static final MutableComponent TITLE = + createTranslation("gui", "autocrafter.visible_to_the_autocrafter_manager"); + private static final MutableComponent HELP = + createTranslation("gui", "autocrafter.visible_to_the_autocrafter_manager.help"); + private static final ResourceLocation YES = + createIdentifier("widget/side_button/autocrafter/visible_to_the_autocrafter_manager/yes"); + private static final ResourceLocation NO = + createIdentifier("widget/side_button/autocrafter/visible_to_the_autocrafter_manager/no"); + + VisibleToTheAutocrafterManagerSideButtonWidget(final ClientProperty property) { + super(property, TITLE, YES, NO); + } + + @Nullable + @Override + protected Component getHelpText() { + return HELP; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/package-info.java new file mode 100644 index 000000000..29c29de66 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocrafter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.autocrafting.autocrafter; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerBlock.java new file mode 100644 index 000000000..9c9b88c2c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerBlock.java @@ -0,0 +1,76 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +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.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; + +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 AutocrafterManagerBlock + extends AbstractActiveColoredDirectionalBlock + implements BlockItemProvider, EntityBlock { + private static final Component HELP = createTranslation("item", "autocrafter_manager.help"); + private static final AbstractBlockEntityTicker TICKER = + new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getAutocrafterManager, ACTIVE); + + public AutocrafterManagerBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES, color, name); + } + + @Override + protected DirectionType getDirectionType() { + return BiDirectionType.INSTANCE; + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getAutocrafterManager(); + } + + @Override + public boolean canAlwaysConnect() { + return true; + } + + @Override + public BaseBlockItem createBlockItem() { + return new NetworkNodeBlockItem(this, HELP); + } + + @Override + @Nullable + public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { + return new AutocrafterManagerBlockEntity(blockPos, blockState); + } + + @Override + @Nullable + public BlockEntityTicker getTicker(final Level level, + final BlockState state, + final BlockEntityType type) { + return TICKER.get(level, type); + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerBlockEntity.java new file mode 100644 index 000000000..7fed80dc0 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerBlockEntity.java @@ -0,0 +1,133 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +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.common.Platform; +import com.refinedmods.refinedstorage.common.api.autocrafting.Autocrafter; +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.containermenu.NetworkNodeExtendedMenuProvider; +import com.refinedmods.refinedstorage.common.support.network.AbstractBaseNetworkNodeContainerBlockEntity; + +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.network.codec.StreamEncoder; +import net.minecraft.world.Container; +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; + +public class AutocrafterManagerBlockEntity extends AbstractBaseNetworkNodeContainerBlockEntity + implements NetworkNodeExtendedMenuProvider { + private final Set watchers = new HashSet<>(); + + public AutocrafterManagerBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getAutocrafterManager(), pos, state, new SimpleNetworkNode( + Platform.INSTANCE.getConfig().getAutocrafterManager().getEnergyUsage() + )); + } + + void addWatcher(final AutocrafterManagerWatcher watcher) { + watchers.add(watcher); + } + + void removeWatcher(final AutocrafterManagerWatcher watcher) { + watchers.remove(watcher); + } + + @Override + protected void activenessChanged(final boolean newActive) { + super.activenessChanged(newActive); + watchers.forEach(watcher -> watcher.activeChanged(newActive)); + } + + @Override + public Component getName() { + return ContentNames.AUTOCRAFTER_MANAGER; + } + + @Override + protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, + final BlockState newBlockState) { + return AbstractDirectionalBlock.didDirectionChange(oldBlockState, newBlockState); + } + + @Override + public AutocrafterManagerData getMenuData() { + return new AutocrafterManagerData( + getGroups().stream().map(AutocrafterManagerData.Group::of).toList(), + mainNetworkNode.isActive() + ); + } + + @Override + public StreamEncoder getMenuCodec() { + return AutocrafterManagerData.STREAM_CODEC; + } + + @Override + @Nullable + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new AutocrafterManagerContainerMenu(syncId, inventory, this, getGroups()); + } + + private Stream getAutocrafters() { + final Network mainNetwork = mainNetworkNode.getNetwork(); + if (mainNetwork == null) { + return Stream.empty(); + } + return mainNetwork.getComponent(GraphNetworkComponent.class) + .getContainers(Autocrafter.class) + .stream() + .sorted(Comparator.comparing(Autocrafter::getLocalPosition)); + } + + private List getGroups() { + return getAutocrafters() + .collect(Collectors.groupingBy(a -> a.getAutocrafterName().getString())) + .entrySet() + .stream() + .map(entry -> new Group( + entry.getKey(), + entry.getValue() + .stream() + .sorted(Comparator.comparing(Autocrafter::getLocalPosition)) + .map(SubGroup::of) + .toList() + )) + .sorted(Comparator.comparing(group -> group.name)) + .toList(); + } + + record Group(String name, List subGroups) { + } + + record SubGroup(Container container, boolean visibleToTheAutocrafterManager, boolean full) { + private static SubGroup of(final Autocrafter autocrafter) { + final Container container = autocrafter.getPatternContainer(); + final boolean full = isFull(container); + return new SubGroup(container, autocrafter.isVisibleToTheAutocrafterManager(), full); + } + + private static boolean isFull(final Container container) { + for (int i = 0; i < container.getContainerSize(); ++i) { + if (container.getItem(i).isEmpty()) { + return false; + } + } + return true; + } + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerContainerMenu.java new file mode 100644 index 000000000..869eb7e2d --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerContainerMenu.java @@ -0,0 +1,337 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +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.autocrafting.PatternInventory; +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.support.stretching.ScreenSizeListener; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import javax.annotation.Nullable; + +import it.unimi.dsi.fastutil.ints.IntIntPair; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.Container; +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 net.minecraft.world.level.Level; + +public class AutocrafterManagerContainerMenu extends AbstractBaseContainerMenu implements ScreenSizeListener, + AutocrafterManagerWatcher { + private final Inventory playerInventory; + private final List groups; + private final List autocrafterSlots = new ArrayList<>(); + + @Nullable + private AutocrafterManagerListener listener; + @Nullable + private AutocrafterManagerBlockEntity autocrafterManager; + private String query = ""; + private boolean active; + + public AutocrafterManagerContainerMenu(final int syncId, + final Inventory playerInventory, + final AutocrafterManagerData data) { + super(Menus.INSTANCE.getAutocrafterManager(), syncId); + this.playerInventory = playerInventory; + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + this.groups = data.groups().stream().map(g -> ViewGroup.from(playerInventory.player.level(), g)).toList(); + this.active = data.active(); + resized(0, 0, 0); + } + + AutocrafterManagerContainerMenu(final int syncId, + final Inventory playerInventory, + final AutocrafterManagerBlockEntity autocrafterManager, + final List groups) { + super(Menus.INSTANCE.getAutocrafterManager(), syncId); + this.playerInventory = playerInventory; + this.autocrafterManager = autocrafterManager; + this.autocrafterManager.addWatcher(this); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + autocrafterManager::getRedstoneMode, + autocrafterManager::setRedstoneMode + )); + this.groups = Collections.emptyList(); + addServerSideSlots(groups); + } + + @Override + public void removed(final Player playerEntity) { + super.removed(playerEntity); + if (autocrafterManager != null) { + autocrafterManager.removeWatcher(this); + } + } + + void setListener(final AutocrafterManagerListener listener) { + this.listener = listener; + } + + void setQuery(final String query) { + this.query = query; + notifyListener(); + } + + private void notifyListener() { + if (listener != null) { + listener.slotsChanged(); + } + } + + private void addServerSideSlots(final List serverGroups) { + for (final AutocrafterManagerBlockEntity.Group group : serverGroups) { + addServerSideSlots(group); + } + addPlayerInventory(playerInventory, 0, 0); + } + + private void addServerSideSlots(final AutocrafterManagerBlockEntity.Group group) { + for (final AutocrafterManagerBlockEntity.SubGroup subGroup : group.subGroups()) { + final Container container = subGroup.container(); + for (int i = 0; i < container.getContainerSize(); i++) { + addSlot(new Slot(container, i, 0, 0)); + } + } + } + + public boolean containsPattern(final ItemStack stack) { + for (final Slot slot : autocrafterSlots) { + if (slot.getItem() == stack) { + return true; + } + } + return false; + } + + @Override + public void resized(final int playerInventoryY, final int topYStart, final int topYEnd) { + initializeGroups(playerInventoryY, topYStart, topYEnd); + } + + private void initializeGroups(final int playerInventoryY, final int topYStart, final int topYEnd) { + resetSlots(); + autocrafterSlots.clear(); + final int rowX = 7 + 1; + final int startY = topYStart - 18; + int rowY = topYStart; + for (final ViewGroup group : groups) { + rowY += initializeGroup(group, rowX, rowY, startY, topYEnd); + } + addPlayerInventory(playerInventory, 8, playerInventoryY); + } + + private int initializeGroup(final ViewGroup group, + final int rowX, + final int rowY, + final int startY, + final int topYEnd) { + int slotsWithinGroup = 0; + for (final SubViewGroup subGroup : group.subViewGroups) { + int slotsWithinSubGroup = 0; + final boolean visible = active && isVisible(subGroup); + for (int i = 0; i < subGroup.backingInventory.getContainerSize(); i++) { + final int slotX = rowX + ((slotsWithinGroup % 9) * 18); + final int slotY = rowY + 18 + ((slotsWithinGroup / 9) * 18); + final boolean slotVisible = visible && isSlotVisible(playerInventory.player.level(), group, i); + final AutocrafterManagerSlot slot = new AutocrafterManagerSlot( + subGroup.backingInventory, + playerInventory.player.level(), + i, + slotX, + slotY, + IntIntPair.of(startY, topYEnd), + slotVisible + ); + addSlot(slot); + if (slotVisible) { + autocrafterSlots.add(slot); + ++slotsWithinGroup; + ++slotsWithinSubGroup; + } + } + subGroup.visibleSlots = slotsWithinSubGroup; + } + group.visibleSlots = slotsWithinGroup; + if (slotsWithinGroup == 0) { + return 0; + } + return (group.getVisibleRows() + 1) * 18; + } + + private boolean isVisible(final SubViewGroup subGroup) { + return switch (getViewType()) { + case VISIBLE -> subGroup.visibleToTheAutocrafterManager; + case NOT_FULL -> !subGroup.full; + case ALL -> true; + }; + } + + private boolean isSlotVisible(final Level level, final ViewGroup group, final int index) { + final String normalizedQuery = query.trim().toLowerCase(Locale.ROOT); + if (normalizedQuery.isEmpty()) { + return true; + } + return getSearchMode().isSlotVisible(group, level, normalizedQuery, index); + } + + List getGroups() { + return groups; + } + + List getAutocrafterSlots() { + return autocrafterSlots; + } + + AutocrafterManagerSearchMode getSearchMode() { + return Platform.INSTANCE.getConfig().getAutocrafterManager().getSearchMode(); + } + + void setSearchMode(final AutocrafterManagerSearchMode searchMode) { + Platform.INSTANCE.getConfig().getAutocrafterManager().setSearchMode(searchMode); + notifyListener(); + } + + AutocrafterManagerViewType getViewType() { + return Platform.INSTANCE.getConfig().getAutocrafterManager().getViewType(); + } + + void setViewType(final AutocrafterManagerViewType toggle) { + Platform.INSTANCE.getConfig().getAutocrafterManager().setViewType(toggle); + notifyListener(); + } + + public void setActive(final boolean active) { + this.active = active; + notifyListener(); + } + + boolean isActive() { + return active; + } + + @Override + public void activeChanged(final boolean newActive) { + if (playerInventory.player instanceof ServerPlayer serverPlayerEntity) { + S2CPackets.sendAutocrafterManagerActive(serverPlayerEntity, newActive); + } + } + + static class SubViewGroup { + private final boolean visibleToTheAutocrafterManager; + private final Container backingInventory; + private final boolean full; + private int visibleSlots; + + private SubViewGroup(final boolean visibleToTheAutocrafterManager, + final Container backingInventory, + final boolean full) { + this.visibleToTheAutocrafterManager = visibleToTheAutocrafterManager; + this.backingInventory = backingInventory; + this.full = full; + } + + private static SubViewGroup from(final AutocrafterManagerData.SubGroup subGroup, final Level level) { + final PatternInventory backingInventory = new PatternInventory(subGroup.slotCount(), () -> level); + return new SubViewGroup( + subGroup.visibleToTheAutocrafterManager(), + backingInventory, + subGroup.full() + ); + } + + int getVisibleSlots() { + return visibleSlots; + } + + boolean hasPatternInput(final Level level, final String normalizedQuery, final int index) { + final ItemStack patternStack = backingInventory.getItem(index); + return RefinedStorageApi.INSTANCE.getPattern(patternStack, level).map( + pattern -> hasResource(pattern.getInputResources(), normalizedQuery) + ).orElse(false); + } + + boolean hasPatternOutput(final Level level, final String normalizedQuery, final int index) { + final ItemStack patternStack = backingInventory.getItem(index); + return RefinedStorageApi.INSTANCE.getPattern(patternStack, level).map( + pattern -> hasResource(pattern.getOutputResources(), normalizedQuery) + ).orElse(false); + } + + private static boolean hasResource(final Set resources, final String normalizedQuery) { + return resources.stream().anyMatch(key -> + RefinedStorageApi.INSTANCE.getResourceRendering(key.getClass()) + .getDisplayName(key) + .getString() + .toLowerCase(Locale.ROOT) + .trim() + .contains(normalizedQuery)); + } + } + + static class ViewGroup { + private final String name; + private final List subViewGroups; + private final List subViewGroupsView; + private int visibleSlots; + + private ViewGroup(final String name, final List subViewGroups) { + this.name = name; + this.subViewGroups = subViewGroups; + this.subViewGroupsView = Collections.unmodifiableList(subViewGroups); + } + + private static ViewGroup from(final Level level, final AutocrafterManagerData.Group group) { + return new ViewGroup( + group.name(), + group.subGroups().stream().map(subGroup -> SubViewGroup.from(subGroup, level)).toList() + ); + } + + String getName() { + return name; + } + + List getSubViewGroups() { + return subViewGroupsView; + } + + boolean isVisible() { + return visibleSlots > 0; + } + + int getVisibleRows() { + return Math.ceilDiv(visibleSlots, 9); + } + + boolean nameContains(final String normalizedQuery) { + return name.toLowerCase(Locale.ROOT).trim().contains(normalizedQuery); + } + + boolean hasPatternInput(final Level level, final String normalizedQuery, final int index) { + return subViewGroups.stream().anyMatch( + subGroup -> subGroup.hasPatternInput(level, normalizedQuery, index) + ); + } + + boolean hasPatternOutput(final Level level, final String normalizedQuery, final int index) { + return subViewGroups.stream().anyMatch( + subGroup -> subGroup.hasPatternOutput(level, normalizedQuery, index) + ); + } + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerData.java new file mode 100644 index 000000000..802276832 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerData.java @@ -0,0 +1,44 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +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 AutocrafterManagerData(List groups, boolean active) { + private static final StreamCodec SUB_GROUP_STREAM_CODEC = StreamCodec.composite( + ByteBufCodecs.INT, SubGroup::slotCount, + ByteBufCodecs.BOOL, SubGroup::visibleToTheAutocrafterManager, + ByteBufCodecs.BOOL, SubGroup::full, + SubGroup::new + ); + private static final StreamCodec GROUP_STREAM_CODEC = StreamCodec.composite( + ByteBufCodecs.STRING_UTF8, Group::name, + ByteBufCodecs.collection(ArrayList::new, SUB_GROUP_STREAM_CODEC), Group::subGroups, + Group::new + ); + public static final StreamCodec STREAM_CODEC = StreamCodec + .composite( + ByteBufCodecs.collection(ArrayList::new, GROUP_STREAM_CODEC), AutocrafterManagerData::groups, + ByteBufCodecs.BOOL, AutocrafterManagerData::active, + AutocrafterManagerData::new + ); + + public record Group(String name, List subGroups) { + static Group of(final AutocrafterManagerBlockEntity.Group group) { + return new Group(group.name(), group.subGroups().stream().map(SubGroup::of).toList()); + } + } + + public record SubGroup(int slotCount, boolean visibleToTheAutocrafterManager, boolean full) { + private static SubGroup of(final AutocrafterManagerBlockEntity.SubGroup subGroup) { + return new SubGroup( + subGroup.container().getContainerSize(), + subGroup.visibleToTheAutocrafterManager(), + subGroup.full() + ); + } + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerListener.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerListener.java new file mode 100644 index 000000000..fe7c7213c --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerListener.java @@ -0,0 +1,6 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +@FunctionalInterface +interface AutocrafterManagerListener { + void slotsChanged(); +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerScreen.java new file mode 100644 index 000000000..ab9b00465 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerScreen.java @@ -0,0 +1,251 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.support.Sprites; +import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage.common.support.stretching.AbstractStretchingScreen; +import com.refinedmods.refinedstorage.common.support.widget.History; +import com.refinedmods.refinedstorage.common.support.widget.RedstoneModeSideButtonWidget; +import com.refinedmods.refinedstorage.common.support.widget.SearchFieldWidget; +import com.refinedmods.refinedstorage.common.support.widget.TextMarquee; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nullable; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.inventory.Slot; + +import static com.refinedmods.refinedstorage.common.support.Sprites.SEARCH_SIZE; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public class AutocrafterManagerScreen extends AbstractStretchingScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/autocrafter_manager.png"); + private static final List SEARCH_FIELD_HISTORY = new ArrayList<>(); + private static final ResourceLocation AUTOCRAFTER_NAME = createIdentifier("autocrafter_manager/autocrafter_name"); + private static final int COLUMNS = 9; + private static final int INACTIVE_COLOR = 0xFF5B5B5B; + + @Nullable + private SearchFieldWidget searchField; + + public AutocrafterManagerScreen(final AutocrafterManagerContainerMenu menu, + final Inventory playerInventory, + final Component title) { + super(menu, playerInventory, new TextMarquee(title, 70)); + this.inventoryLabelY = 75; + this.imageWidth = 193; + this.imageHeight = 176; + getMenu().setListener(() -> { + resize(); + updateScrollbar(); + }); + } + + @Override + protected void init(final int rows) { + super.init(rows); + + if (searchField == null) { + searchField = new SearchFieldWidget( + font, + leftPos + 94 + 1, + topPos + 6 + 1, + 73 - 6, + new History(SEARCH_FIELD_HISTORY) + ); + } else { + searchField.setX(leftPos + 94 + 1); + searchField.setY(topPos + 6 + 1); + } + updateScrollbar(); + + addWidget(searchField); + searchField.setResponder(value -> getMenu().setQuery(value)); + + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + addSideButton(new ViewTypeSideButtonWidget(getMenu())); + addSideButton(new SearchModeSideButtonWidget(getMenu())); + } + + private void updateScrollbar() { + final int totalRows = menu.getGroups() + .stream() + .map(group -> group.isVisible() ? group.getVisibleRows() + 1 : 0) + .reduce(0, Integer::sum); + updateScrollbar(totalRows); + } + + @Override + protected void scrollbarChanged(final int rows) { + super.scrollbarChanged(rows); + final int scrollbarOffset = getScrollbarOffset(); + for (int i = 0; i < menu.getAutocrafterSlots().size(); ++i) { + final AutocrafterManagerSlot slot = menu.getAutocrafterSlots().get(i); + Platform.INSTANCE.setSlotY(slot, slot.getOriginalY() - scrollbarOffset); + } + } + + @Override + protected void renderBg(final GuiGraphics graphics, final float delta, final int mouseX, final int mouseY) { + super.renderBg(graphics, delta, mouseX, mouseY); + graphics.blitSprite(Sprites.SEARCH, leftPos + 79, topPos + 5, SEARCH_SIZE, SEARCH_SIZE); + } + + @Override + public void render(final GuiGraphics graphics, final int mouseX, final int mouseY, final float partialTicks) { + super.render(graphics, mouseX, mouseY, partialTicks); + if (searchField != null) { + searchField.render(graphics, 0, 0, 0); + } + } + + @Override + public boolean charTyped(final char unknown1, final int unknown2) { + return (searchField != null && searchField.charTyped(unknown1, unknown2)) + || super.charTyped(unknown1, unknown2); + } + + @Override + public boolean keyPressed(final int key, final int scanCode, final int modifiers) { + if (searchField != null && searchField.keyPressed(key, scanCode, modifiers)) { + return true; + } + return super.keyPressed(key, scanCode, modifiers); + } + + @Override + protected void renderRows(final GuiGraphics graphics, + final int x, + final int y, + final int topHeight, + final int rows, + final int mouseX, + final int mouseY) { + if (!menu.isActive()) { + graphics.fill( + RenderType.guiOverlay(), + x + 7 + 1, + y + TOP_HEIGHT + 1, + x + 7 + (ROW_SIZE * COLUMNS) - 1, + y + TOP_HEIGHT + 1 + (ROW_SIZE * rows) - 2, + INACTIVE_COLOR + ); + return; + } + renderGroups(graphics, x, y, topHeight, rows); + renderSlotContents(graphics, mouseX, mouseY, y, topHeight, rows); + } + + private void renderGroups(final GuiGraphics graphics, + final int x, + final int y, + final int topHeight, + final int rows) { + final int rowX = x + 7; + int rowY = y + topHeight - getScrollbarOffset(); + for (final AutocrafterManagerContainerMenu.ViewGroup group : menu.getGroups()) { + if (!group.isVisible()) { + continue; + } + if (!isOutOfFrame(y, topHeight, rows, rowY)) { + graphics.blitSprite(AUTOCRAFTER_NAME, rowX, rowY, 162, ROW_SIZE); + graphics.drawString(font, group.getName(), rowX + 4, rowY + 6, 4210752, false); + } + renderGroup(graphics, y, topHeight, rows, group, rowX, rowY); + rowY += (group.getVisibleRows() + 1) * ROW_SIZE; + } + } + + private static void renderGroup(final GuiGraphics graphics, + final int y, + final int topHeight, + final int rows, + final AutocrafterManagerContainerMenu.ViewGroup group, + final int rowX, + final int rowY) { + int j = 0; + for (final AutocrafterManagerContainerMenu.SubViewGroup subGroup : group.getSubViewGroups()) { + for (int i = 0; i < subGroup.getVisibleSlots(); i++) { + final int slotX = rowX + ((j % COLUMNS) * 18); + final int slotY = rowY + 18 + ((j / COLUMNS) * 18); + if (!isOutOfFrame(y, topHeight, rows, slotY)) { + graphics.blitSprite(Sprites.SLOT, slotX, slotY, 18, 18); + } + ++j; + } + } + } + + private void renderSlotContents(final GuiGraphics graphics, + final int mouseX, + final int mouseY, + final int y, + final int topHeight, + final int rows) { + graphics.pose().pushPose(); + graphics.pose().translate(leftPos, topPos, 0); + for (final Slot slot : menu.getAutocrafterSlots()) { + if (isOutOfFrame(y, topHeight, rows, topPos + slot.y)) { + continue; + } + super.renderSlot(graphics, slot); + final boolean hovering = mouseX >= slot.x + leftPos + && mouseX < slot.x + leftPos + 16 + && mouseY >= slot.y + topPos + && mouseY < slot.y + topPos + 16; + if (slot.isActive() && hovering) { + renderSlotHighlight(graphics, slot.x, slot.y, 0); + } + } + graphics.pose().popPose(); + } + + @Override + protected void renderSlot(final GuiGraphics guiGraphics, final Slot slot) { + if (slot instanceof AutocrafterManagerSlot) { + return; + } + super.renderSlot(guiGraphics, slot); + } + + private static boolean isOutOfFrame(final int y, + final int topHeight, + final int rows, + final int rowY) { + return (rowY < y + topHeight - ROW_SIZE) + || (rowY > y + topHeight + (ROW_SIZE * rows)); + } + + @Override + protected void renderStretchingBackground(final GuiGraphics graphics, final int x, final int y, final int rows) { + for (int row = 0; row < rows; ++row) { + int textureY = 37; + if (row == 0) { + textureY = 19; + } else if (row == rows - 1) { + textureY = 55; + } + graphics.blit(getTexture(), x, y + (ROW_SIZE * row), 0, textureY, imageWidth, ROW_SIZE); + } + } + + @Override + protected int getBottomHeight() { + return 99; + } + + @Override + protected int getBottomV() { + return 73; + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerSearchMode.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerSearchMode.java new file mode 100644 index 000000000..31483d572 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerSearchMode.java @@ -0,0 +1,33 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +import net.minecraft.world.level.Level; + +public enum AutocrafterManagerSearchMode { + ALL, + PATTERN_INPUTS, + PATTERN_OUTPUTS, + AUTOCRAFTER_NAMES; + + AutocrafterManagerSearchMode toggle() { + return switch (this) { + case ALL -> PATTERN_INPUTS; + case PATTERN_INPUTS -> PATTERN_OUTPUTS; + case PATTERN_OUTPUTS -> AUTOCRAFTER_NAMES; + case AUTOCRAFTER_NAMES -> ALL; + }; + } + + boolean isSlotVisible(final AutocrafterManagerContainerMenu.ViewGroup group, + final Level level, + final String normalizedQuery, + final int index) { + return switch (this) { + case ALL -> group.nameContains(normalizedQuery) + || group.hasPatternInput(level, normalizedQuery, index) + || group.hasPatternOutput(level, normalizedQuery, index); + case PATTERN_INPUTS -> group.hasPatternInput(level, normalizedQuery, index); + case PATTERN_OUTPUTS -> group.hasPatternOutput(level, normalizedQuery, index); + case AUTOCRAFTER_NAMES -> group.nameContains(normalizedQuery); + }; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerSlot.java new file mode 100644 index 000000000..2be85d099 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerSlot.java @@ -0,0 +1,42 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +import com.refinedmods.refinedstorage.common.autocrafting.PatternSlot; + +import it.unimi.dsi.fastutil.ints.IntIntPair; +import net.minecraft.world.Container; +import net.minecraft.world.level.Level; + +class AutocrafterManagerSlot extends PatternSlot { + private final int originalY; + private final int startY; + private final int endY; + private final boolean active; + + AutocrafterManagerSlot(final Container container, + final Level level, + final int slot, + final int x, + final int y, + final IntIntPair startEndY, + final boolean active) { + super(container, slot, x, y, level); + this.originalY = y; + this.startY = startEndY.firstInt(); + this.endY = startEndY.secondInt(); + this.active = active; + } + + int getOriginalY() { + return originalY; + } + + @Override + public boolean isActive() { + return y >= startY && y < endY && active; + } + + @Override + public boolean isHighlightable() { + return false; // we render the highlight in the scissor render + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerViewType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerViewType.java new file mode 100644 index 000000000..926f49901 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerViewType.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +public enum AutocrafterManagerViewType { + VISIBLE, + NOT_FULL, + ALL; + + AutocrafterManagerViewType toggle() { + return switch (this) { + case VISIBLE -> NOT_FULL; + case NOT_FULL -> ALL; + case ALL -> VISIBLE; + }; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerWatcher.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerWatcher.java new file mode 100644 index 000000000..c0a82698b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/AutocrafterManagerWatcher.java @@ -0,0 +1,6 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +@FunctionalInterface +interface AutocrafterManagerWatcher { + void activeChanged(boolean active); +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/SearchModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/SearchModeSideButtonWidget.java new file mode 100644 index 000000000..346f56af7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/SearchModeSideButtonWidget.java @@ -0,0 +1,83 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +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.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class SearchModeSideButtonWidget extends AbstractSideButtonWidget { + private static final MutableComponent TITLE = createTranslation("gui", "autocrafter_manager.search_mode"); + private static final MutableComponent SUBTEXT_ALL = createTranslation("gui", "autocrafter_manager.search_mode.all"); + private static final MutableComponent HELP_ALL = + createTranslation("gui", "autocrafter_manager.search_mode.all.help"); + private static final MutableComponent SUBTEXT_PATTERN_INPUTS = + createTranslation("gui", "autocrafter_manager.search_mode.pattern_inputs"); + private static final MutableComponent HELP_PATTERN_INPUTS = + createTranslation("gui", "autocrafter_manager.search_mode.pattern_inputs.help"); + private static final MutableComponent SUBTEXT_PATTERN_OUTPUTS = + createTranslation("gui", "autocrafter_manager.search_mode.pattern_outputs"); + private static final MutableComponent HELP_PATTERN_OUTPUTS = + createTranslation("gui", "autocrafter_manager.search_mode.pattern_outputs.help"); + private static final MutableComponent SUBTEXT_AUTOCRAFTER_NAMES = + createTranslation("gui", "autocrafter_manager.search_mode.autocrafter_names"); + private static final MutableComponent HELP_AUTOCRAFTER_NAMES = + createTranslation("gui", "autocrafter_manager.search_mode.autocrafter_names.help"); + private static final ResourceLocation SPRITE_ALL = + createIdentifier("widget/side_button/autocrafter_manager/search_mode/all"); + private static final ResourceLocation SPRITE_PATTERN_INPUTS = + createIdentifier("widget/side_button/autocrafter_manager/search_mode/pattern_inputs"); + private static final ResourceLocation SPRITE_PATTERN_OUTPUTS = + createIdentifier("widget/side_button/autocrafter_manager/search_mode/pattern_outputs"); + private static final ResourceLocation SPRITE_AUTOCRAFTER_NAMES = + createIdentifier("widget/side_button/autocrafter_manager/search_mode/autocrafter_names"); + + private final AutocrafterManagerContainerMenu containerMenu; + + SearchModeSideButtonWidget(final AutocrafterManagerContainerMenu containerMenu) { + super(createPressAction(containerMenu)); + this.containerMenu = containerMenu; + } + + private static OnPress createPressAction(final AutocrafterManagerContainerMenu containerMenu) { + return btn -> containerMenu.setSearchMode(containerMenu.getSearchMode().toggle()); + } + + @Override + protected ResourceLocation getSprite() { + return switch (containerMenu.getSearchMode()) { + case ALL -> SPRITE_ALL; + case PATTERN_INPUTS -> SPRITE_PATTERN_INPUTS; + case PATTERN_OUTPUTS -> SPRITE_PATTERN_OUTPUTS; + case AUTOCRAFTER_NAMES -> SPRITE_AUTOCRAFTER_NAMES; + }; + } + + @Override + protected MutableComponent getTitle() { + return TITLE; + } + + @Override + protected MutableComponent getSubText() { + return switch (containerMenu.getSearchMode()) { + case ALL -> SUBTEXT_ALL; + case PATTERN_INPUTS -> SUBTEXT_PATTERN_INPUTS; + case PATTERN_OUTPUTS -> SUBTEXT_PATTERN_OUTPUTS; + case AUTOCRAFTER_NAMES -> SUBTEXT_AUTOCRAFTER_NAMES; + }; + } + + @Override + protected Component getHelpText() { + return switch (containerMenu.getSearchMode()) { + case ALL -> HELP_ALL; + case PATTERN_INPUTS -> HELP_PATTERN_INPUTS; + case PATTERN_OUTPUTS -> HELP_PATTERN_OUTPUTS; + case AUTOCRAFTER_NAMES -> HELP_AUTOCRAFTER_NAMES; + }; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/ViewTypeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/ViewTypeSideButtonWidget.java new file mode 100644 index 000000000..9cf4c022a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/ViewTypeSideButtonWidget.java @@ -0,0 +1,75 @@ +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +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.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; + +class ViewTypeSideButtonWidget extends AbstractSideButtonWidget { + private static final MutableComponent TITLE = createTranslation("gui", "autocrafter_manager.view_type"); + private static final MutableComponent SUBTEXT_VISIBLE = + createTranslation("gui", "autocrafter_manager.view_type.visible"); + private static final MutableComponent HELP_VISIBLE = + createTranslation("gui", "autocrafter_manager.view_type.visible.help"); + private static final MutableComponent SUBTEXT_NOT_FULL = + createTranslation("gui", "autocrafter_manager.view_type.not_full"); + private static final MutableComponent HELP_NOT_FULL = + createTranslation("gui", "autocrafter_manager.view_type.not_full.help"); + private static final MutableComponent SUBTEXT_ALL = + createTranslation("gui", "autocrafter_manager.view_type.all"); + private static final MutableComponent HELP_ALL = + createTranslation("gui", "autocrafter_manager.view_type.all.help"); + private static final ResourceLocation SPRITE_VISIBLE = + createIdentifier("widget/side_button/autocrafter_manager/view_type/visible"); + private static final ResourceLocation SPRITE_NOT_FULL = + createIdentifier("widget/side_button/autocrafter_manager/view_type/not_full"); + private static final ResourceLocation SPRITE_ALL = + createIdentifier("widget/side_button/autocrafter_manager/view_type/all"); + + private final AutocrafterManagerContainerMenu containerMenu; + + ViewTypeSideButtonWidget(final AutocrafterManagerContainerMenu containerMenu) { + super(createPressAction(containerMenu)); + this.containerMenu = containerMenu; + } + + private static OnPress createPressAction(final AutocrafterManagerContainerMenu containerMenu) { + return btn -> containerMenu.setViewType(containerMenu.getViewType().toggle()); + } + + @Override + protected ResourceLocation getSprite() { + return switch (containerMenu.getViewType()) { + case VISIBLE -> SPRITE_VISIBLE; + case NOT_FULL -> SPRITE_NOT_FULL; + case ALL -> SPRITE_ALL; + }; + } + + @Override + protected MutableComponent getTitle() { + return TITLE; + } + + @Override + protected MutableComponent getSubText() { + return switch (containerMenu.getViewType()) { + case VISIBLE -> SUBTEXT_VISIBLE; + case NOT_FULL -> SUBTEXT_NOT_FULL; + case ALL -> SUBTEXT_ALL; + }; + } + + @Override + protected Component getHelpText() { + return switch (containerMenu.getViewType()) { + case VISIBLE -> HELP_VISIBLE; + case NOT_FULL -> HELP_NOT_FULL; + case ALL -> HELP_ALL; + }; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/package-info.java new file mode 100644 index 000000000..03b41dc3f --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/autocraftermanager/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/Alternative.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/Alternative.java similarity index 97% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/Alternative.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/Alternative.java index 3dd18a5a1..88dca65b5 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/Alternative.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/Alternative.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativeContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/AlternativeContainerMenu.java similarity index 95% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativeContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/AlternativeContainerMenu.java index b17189322..acd7bf39f 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativeContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/AlternativeContainerMenu.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; @@ -18,8 +18,8 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import static com.refinedmods.refinedstorage.common.autocrafting.AlternativesScreen.ALTERNATIVE_HEIGHT; -import static com.refinedmods.refinedstorage.common.autocrafting.AlternativesScreen.ALTERNATIVE_ROW_HEIGHT; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.AlternativesScreen.ALTERNATIVE_HEIGHT; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.AlternativesScreen.ALTERNATIVE_ROW_HEIGHT; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.getTagTranslationKey; class AlternativeContainerMenu extends AbstractResourceContainerMenu { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativeSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/AlternativeSlot.java similarity index 92% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativeSlot.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/AlternativeSlot.java index 548002c9d..0c440eb71 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativeSlot.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/AlternativeSlot.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage.common.support.containermenu.DisabledResourceSlot; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativesScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/AlternativesScreen.java similarity index 99% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativesScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/AlternativesScreen.java index 743e92a7d..cbfeacfc6 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativesScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/AlternativesScreen.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.Platform; import com.refinedmods.refinedstorage.common.support.ResourceSlotRendering; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternGridRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/CraftingPatternGridRenderer.java similarity index 96% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternGridRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/CraftingPatternGridRenderer.java index 8b94a7b49..4ea66d026 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternGridRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/CraftingPatternGridRenderer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.support.widget.CustomCheckboxWidget; @@ -12,7 +12,7 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; -import static com.refinedmods.refinedstorage.common.autocrafting.PatternGridScreen.INSET_PADDING; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen.INSET_PADDING; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridBlock.java similarity index 97% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridBlock.java index 1315e9909..2a5af3cab 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridBlock.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.content.BlockColorMap; import com.refinedmods.refinedstorage.common.content.BlockEntities; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridBlockEntity.java similarity index 97% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridBlockEntity.java index 6176e43b4..b687d4b77 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; @@ -6,6 +6,12 @@ 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.autocrafting.CraftingPatternState; +import com.refinedmods.refinedstorage.common.autocrafting.PatternItem; +import com.refinedmods.refinedstorage.common.autocrafting.PatternState; +import com.refinedmods.refinedstorage.common.autocrafting.ProcessingPatternState; +import com.refinedmods.refinedstorage.common.autocrafting.SmithingTablePatternState; +import com.refinedmods.refinedstorage.common.autocrafting.StonecutterPatternState; import com.refinedmods.refinedstorage.common.content.BlockEntities; import com.refinedmods.refinedstorage.common.content.ContentNames; import com.refinedmods.refinedstorage.common.content.DataComponents; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridContainerMenu.java similarity index 98% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridContainerMenu.java index 9216ba40a..09e2f9b55 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridContainerMenu.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; @@ -83,7 +83,7 @@ public PatternGridContainerMenu(final int syncId, this.smithingTableResult = new ResultContainer(); this.smithingTableRecipes = playerInventory.player.level().getRecipeManager() .getAllRecipesFor(RecipeType.SMITHING); - onScreenReady(0); + resized(0, 0, 0); registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); registerProperty(new ClientProperty<>(PatternGridPropertyTypes.PATTERN_TYPE, patternGridData.patternType()) { @Override @@ -125,7 +125,7 @@ protected void onChangedOnClient(final Boolean newValue) { this.smithingTableRecipes = playerInventory.player.level().getRecipeManager() .getAllRecipesFor(RecipeType.SMITHING); this.patternGrid = grid; - onScreenReady(0); + resized(0, 0, 0); registerProperty(new ServerProperty<>( PropertyTypes.REDSTONE_MODE, grid::getRedstoneMode, @@ -181,8 +181,8 @@ boolean canCreatePattern() { } @Override - public void onScreenReady(final int playerInventoryY) { - super.onScreenReady(playerInventoryY); + public void resized(final int playerInventoryY, final int topYStart, final int topYEnd) { + super.resized(playerInventoryY, topYStart, topYEnd); transferManager.clear(); addSmithingTableSlots(playerInventoryY); // these must be always first for the smithing table helpers addPatternSlots(playerInventoryY); @@ -229,7 +229,7 @@ public void set(final ItemStack stack) { transferManager.addTransfer(patternOutput, playerInventory); } - boolean isPatternInOutput(final ItemStack stack) { + public boolean isPatternInOutput(final ItemStack stack) { return patternOutputSlot != null && patternOutputSlot.getItem() == stack; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridData.java similarity index 94% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridData.java index e4330475e..e54504c29 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridData.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.grid.GridData; import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridPropertyTypes.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridPropertyTypes.java similarity index 91% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridPropertyTypes.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridPropertyTypes.java index d2f7a96c4..4f364caf5 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridPropertyTypes.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridPropertyTypes.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.support.containermenu.PropertyType; import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridRenderer.java similarity index 96% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridRenderer.java index e8222e533..4c7f81039 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridRenderer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridScreen.java similarity index 99% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridScreen.java index f8f76f606..ddfe7cdf8 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternGridScreen.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; import com.refinedmods.refinedstorage.common.grid.screen.AbstractGridScreen; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternOutputContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternOutputContainer.java similarity index 79% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternOutputContainer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternOutputContainer.java index 8a83d878a..ff04d4e01 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternOutputContainer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternOutputContainer.java @@ -1,5 +1,6 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; +import com.refinedmods.refinedstorage.common.autocrafting.PatternItem; import com.refinedmods.refinedstorage.common.support.FilteredContainer; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternType.java similarity index 96% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternType.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternType.java index 547fd3c83..5b2e2bc41 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.mojang.serialization.Codec; import net.minecraft.network.chat.Component; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTypeButton.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternTypeButton.java similarity index 96% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTypeButton.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternTypeButton.java index d04c26943..11cc248fa 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTypeButton.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternTypeButton.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.support.widget.HoveredImageButton; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTypeSettings.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternTypeSettings.java similarity index 92% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTypeSettings.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternTypeSettings.java index 3e93a7aeb..133b558fb 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTypeSettings.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/PatternTypeSettings.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; class PatternTypeSettings { private static final int CRAFTING = 0; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingInputData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingInputData.java similarity index 95% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingInputData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingInputData.java index 59b5181d3..05d2e7d1b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingInputData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingInputData.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerData; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingMatrixInputClientTooltipComponent.java similarity index 98% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputClientTooltipComponent.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingMatrixInputClientTooltipComponent.java index 982a56aba..00a3cd0ff 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingMatrixInputClientTooltipComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputResourceContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingMatrixInputResourceContainer.java similarity index 97% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputResourceContainer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingMatrixInputResourceContainer.java index a9c0834fe..d97b09830 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputResourceContainer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingMatrixInputResourceContainer.java @@ -1,9 +1,10 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.api.core.NullableType; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage.common.autocrafting.ProcessingPatternState; import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; import java.util.ArrayList; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixResourceSlot.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingMatrixResourceSlot.java similarity index 98% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixResourceSlot.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingMatrixResourceSlot.java index c1fcea8b3..57dc466a9 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixResourceSlot.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingMatrixResourceSlot.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlot; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternGridRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingPatternGridRenderer.java similarity index 98% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternGridRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingPatternGridRenderer.java index 71ca95ca9..9a3cc3e8f 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternGridRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/ProcessingPatternGridRenderer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.common.Platform; import com.refinedmods.refinedstorage.common.grid.AutocraftableResourceHint; @@ -16,9 +16,9 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; -import static com.refinedmods.refinedstorage.common.autocrafting.PatternGridScreen.INSET_HEIGHT; -import static com.refinedmods.refinedstorage.common.autocrafting.PatternGridScreen.INSET_PADDING; -import static com.refinedmods.refinedstorage.common.autocrafting.PatternGridScreen.INSET_WIDTH; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen.INSET_HEIGHT; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen.INSET_PADDING; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen.INSET_WIDTH; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; import static net.minecraft.client.gui.screens.inventory.AbstractContainerScreen.renderSlotHighlight; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternGridRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/SmithingTablePatternGridRenderer.java similarity index 96% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternGridRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/SmithingTablePatternGridRenderer.java index 9008c9790..796cbcd4e 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternGridRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/SmithingTablePatternGridRenderer.java @@ -1,5 +1,6 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; +import com.refinedmods.refinedstorage.common.autocrafting.VanillaConstants; import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; import java.util.List; @@ -23,9 +24,9 @@ import net.minecraft.world.item.SmithingTemplateItem; import net.minecraft.world.level.Level; -import static com.refinedmods.refinedstorage.common.autocrafting.PatternGridScreen.INSET_HEIGHT; -import static com.refinedmods.refinedstorage.common.autocrafting.PatternGridScreen.INSET_PADDING; -import static com.refinedmods.refinedstorage.common.autocrafting.PatternGridScreen.INSET_WIDTH; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen.INSET_HEIGHT; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen.INSET_PADDING; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen.INSET_WIDTH; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; class SmithingTablePatternGridRenderer implements PatternGridRenderer { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterInputContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/StonecutterInputContainer.java similarity index 96% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterInputContainer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/StonecutterInputContainer.java index ac59c4dac..69bb7cb45 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterInputContainer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/StonecutterInputContainer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; import com.refinedmods.refinedstorage.api.core.NullableType; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternGridRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/StonecutterPatternGridRenderer.java similarity index 97% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternGridRenderer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/StonecutterPatternGridRenderer.java index b7b5beb04..b6015cfd5 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternGridRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/StonecutterPatternGridRenderer.java @@ -1,5 +1,6 @@ -package com.refinedmods.refinedstorage.common.autocrafting; +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; +import com.refinedmods.refinedstorage.common.autocrafting.VanillaConstants; import com.refinedmods.refinedstorage.common.support.widget.ScrollbarWidget; import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; @@ -18,7 +19,7 @@ import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.StonecutterRecipe; -import static com.refinedmods.refinedstorage.common.autocrafting.PatternGridScreen.INSET_PADDING; +import static com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridScreen.INSET_PADDING; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static java.util.Objects.requireNonNull; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/package-info.java new file mode 100644 index 000000000..d0e39bff7 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/patterngrid/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.common.autocrafting.patterngrid; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractConstructorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractConstructorBlockEntity.java index d30fa7823..68772409a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractConstructorBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractConstructorBlockEntity.java @@ -84,12 +84,12 @@ void setFilters(final List filters) { @Override public List getUpgrades() { - return upgradeContainer.getUpgradeItems(); + return upgradeContainer.getUpgrades(); } @Override public boolean addUpgrade(final ItemStack upgradeStack) { - return upgradeContainer.addUpgradeItem(upgradeStack); + return upgradeContainer.addUpgrade(upgradeStack); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractDestructorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractDestructorBlockEntity.java index c1d00b756..ff40f8e87 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractDestructorBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/AbstractDestructorBlockEntity.java @@ -75,12 +75,12 @@ protected AbstractDestructorBlockEntity(final BlockPos pos, final BlockState sta @Override public List getUpgrades() { - return upgradeContainer.getUpgradeItems(); + return upgradeContainer.getUpgrades(); } @Override public boolean addUpgrade(final ItemStack upgradeStack) { - return upgradeContainer.addUpgradeItem(upgradeStack); + return upgradeContainer.addUpgrade(upgradeStack); } public boolean isPickupItems() { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java index 1868b4c92..2b5320718 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java @@ -1,7 +1,8 @@ package com.refinedmods.refinedstorage.common.content; -import com.refinedmods.refinedstorage.common.autocrafting.AutocrafterBlockEntity; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridBlockEntity; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterBlockEntity; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerBlockEntity; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridBlockEntity; import com.refinedmods.refinedstorage.common.constructordestructor.AbstractConstructorBlockEntity; import com.refinedmods.refinedstorage.common.constructordestructor.AbstractDestructorBlockEntity; import com.refinedmods.refinedstorage.common.controller.ControllerBlockEntity; @@ -91,6 +92,8 @@ public final class BlockEntities { private Supplier> diskInterface; @Nullable private Supplier> autocrafter; + @Nullable + private Supplier> autocrafterManager; private BlockEntities() { } @@ -304,4 +307,12 @@ public BlockEntityType getAutocrafter() { public void setAutocrafter(final Supplier> supplier) { this.autocrafter = supplier; } + + public BlockEntityType getAutocrafterManager() { + return requireNonNull(autocrafterManager).get(); + } + + public void setAutocrafterManager(final Supplier> supplier) { + this.autocrafterManager = supplier; + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java index 0c7b8036f..e3c403d05 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java @@ -1,7 +1,8 @@ package com.refinedmods.refinedstorage.common.content; -import com.refinedmods.refinedstorage.common.autocrafting.AutocrafterBlock; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridBlock; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterBlock; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerBlock; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridBlock; import com.refinedmods.refinedstorage.common.constructordestructor.AbstractConstructorBlockEntity; import com.refinedmods.refinedstorage.common.constructordestructor.AbstractDestructorBlockEntity; import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorBlock; @@ -151,6 +152,12 @@ public final class Blocks { ContentNames.AUTOCRAFTER, COLOR ); + private final BlockColorMap autocrafterManager = new BlockColorMap<>( + AutocrafterManagerBlock::new, + ContentIds.AUTOCRAFTER_MANAGER, + ContentNames.AUTOCRAFTER_MANAGER, + COLOR + ); @Nullable private Supplier quartzEnrichedIronBlock; @@ -422,4 +429,8 @@ public BlockColorMap getDiskInterface() { public BlockColorMap getAutocrafter() { return autocrafter; } + + public BlockColorMap getAutocrafterManager() { + return autocrafterManager; + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentIds.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentIds.java index 31f38d827..69792f5fb 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentIds.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentIds.java @@ -68,6 +68,7 @@ public final class ContentIds { public static final ResourceLocation DISK_INTERFACE = createIdentifier("disk_interface"); public static final ResourceLocation PATTERN = createIdentifier("pattern"); public static final ResourceLocation AUTOCRAFTER = createIdentifier("autocrafter"); + public static final ResourceLocation AUTOCRAFTER_MANAGER = createIdentifier("autocrafter_manager"); private ContentIds() { } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentNames.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentNames.java index 1cacbaacc..8a6233c1a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentNames.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/ContentNames.java @@ -40,6 +40,7 @@ public final class ContentNames { public static final MutableComponent RELAY = name("relay"); public static final MutableComponent DISK_INTERFACE = name("disk_interface"); public static final MutableComponent AUTOCRAFTER = name("autocrafter"); + public static final MutableComponent AUTOCRAFTER_MANAGER = name("autocrafter_manager"); public static final String CLEAR_CRAFTING_MATRIX_TO_NETWORK_TRANSLATION_KEY = createTranslationKey("key", "clear_crafting_grid_matrix_to_network"); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/CreativeModeTabItems.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/CreativeModeTabItems.java index bcae7cd56..f1bc18a0d 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/CreativeModeTabItems.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/CreativeModeTabItems.java @@ -59,6 +59,7 @@ private static void appendBlocks(final Consumer consumer) { Items.INSTANCE.getRelays().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getDiskInterfaces().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getAutocrafters().stream().map(Supplier::get).forEach(itemConsumer); + Items.INSTANCE.getAutocrafterManagers().stream().map(Supplier::get).forEach(itemConsumer); } private static void appendBlockColors(final Consumer consumer, final BlockColorMap map) { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java index 300aa23a8..1da5d7d4b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java @@ -24,6 +24,7 @@ public final class DefaultEnergyUsage { public static final long RELAY_OUTPUT_NETWORK = 8; public static final long AUTOCRAFTER = 4; public static final long AUTOCRAFTER_PER_PATTERN = 2; + public static final long AUTOCRAFTER_MANAGER = 16; public static final long CONTROLLER_CAPACITY = 1000; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Items.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Items.java index 2dfc026af..f16588c5f 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Items.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Items.java @@ -52,6 +52,7 @@ public final class Items { private final List> allRelays = new ArrayList<>(); private final List> allDiskInterfaces = new ArrayList<>(); private final List> allAutocrafters = new ArrayList<>(); + private final List> allAutocrafterManagers = new ArrayList<>(); @Nullable private Supplier quartzEnrichedIron; @Nullable @@ -447,6 +448,14 @@ public List> getAutocrafters() { return Collections.unmodifiableList(allAutocrafters); } + public void addAutocrafterManager(final Supplier supplier) { + allAutocrafterManagers.add(supplier); + } + + public List> getAutocrafterManagers() { + return Collections.unmodifiableList(allAutocrafterManagers); + } + public Item getNetworkCard() { return requireNonNull(networkCard).get(); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java index 4658b8af7..59dbf5f7b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java @@ -1,7 +1,8 @@ package com.refinedmods.refinedstorage.common.content; -import com.refinedmods.refinedstorage.common.autocrafting.AutocrafterContainerMenu; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; import com.refinedmods.refinedstorage.common.autocrafting.preview.AutocraftingPreviewContainerMenu; import com.refinedmods.refinedstorage.common.constructordestructor.ConstructorContainerMenu; import com.refinedmods.refinedstorage.common.constructordestructor.DestructorContainerMenu; @@ -95,6 +96,8 @@ public final class Menus { private Supplier> diskInterface; @Nullable private Supplier> autocrafter; + @Nullable + private Supplier> autocrafterManager; private Menus() { } @@ -326,4 +329,12 @@ public MenuType getAutocrafter() { public void setAutocrafter(final Supplier> autocrafter) { this.autocrafter = autocrafter; } + + public MenuType getAutocrafterManager() { + return requireNonNull(autocrafterManager).get(); + } + + public void setAutocrafterManager(final Supplier> autocrafterManager) { + this.autocrafterManager = autocrafterManager; + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Tags.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Tags.java index 8763b85fd..e7038a70f 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Tags.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Tags.java @@ -28,6 +28,7 @@ public final class Tags { public static final TagKey RELAYS = createTag("relays"); public static final TagKey DISK_INTERFACES = createTag("disk_interfaces"); public static final TagKey AUTOCRAFTERS = createTag("autocrafters"); + public static final TagKey AUTOCRAFTER_MANAGERS = createTag("autocrafter_managers"); private Tags() { } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/AbstractExporterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/AbstractExporterBlockEntity.java index 961903cbd..b3bf62e76 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/AbstractExporterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/AbstractExporterBlockEntity.java @@ -87,12 +87,12 @@ private void schedulingModeChanged(final SchedulingMode schedulingMode) { @Override public List getUpgrades() { - return upgradeContainer.getUpgradeItems(); + return upgradeContainer.getUpgrades(); } @Override public boolean addUpgrade(final ItemStack upgradeStack) { - return upgradeContainer.addUpgradeItem(upgradeStack); + return upgradeContainer.addUpgrade(upgradeStack); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridContainerMenu.java index a89a4178f..10932544a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridContainerMenu.java @@ -254,7 +254,7 @@ public void removed(final Player playerEntity) { } @Override - public void onScreenReady(final int playerInventoryY) { + public void resized(final int playerInventoryY, final int topYStart, final int topYEnd) { resetSlots(); addPlayerInventory(playerInventory, 8, playerInventoryY, (before, after) -> { final Pattern beforePattern = RefinedStorageApi.INSTANCE.getPattern(before, playerInventory.player.level()) @@ -278,7 +278,7 @@ public GridView getView() { public void onActiveChanged(final boolean newActive) { this.active = newActive; if (this.playerInventory.player instanceof ServerPlayer serverPlayerEntity) { - S2CPackets.sendGridActiveness(serverPlayerEntity, newActive); + S2CPackets.sendGridActive(serverPlayerEntity, newActive); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java index 0473d87b6..593b1416e 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java @@ -45,7 +45,7 @@ public CraftingGridContainerMenu(final int syncId, super(Menus.INSTANCE.getCraftingGrid(), syncId, playerInventory, gridData); this.craftingGrid = new ClientCraftingGrid(); this.gridPlayer = playerInventory.player; - onScreenReady(0); + resized(0, 0, 0); registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); } @@ -55,7 +55,7 @@ public CraftingGridContainerMenu(final int syncId, super(Menus.INSTANCE.getCraftingGrid(), syncId, playerInventory, grid); this.craftingGrid = new CraftingGridImpl(grid); this.gridPlayer = playerInventory.player; - onScreenReady(0); + resized(0, 0, 0); registerProperty(new ServerProperty<>( PropertyTypes.REDSTONE_MODE, grid::getRedstoneMode, @@ -98,8 +98,8 @@ public ItemStack quickMoveStack(final Player actor, final int slotIndex) { } @Override - public void onScreenReady(final int playerInventoryY) { - super.onScreenReady(playerInventoryY); + public void resized(final int playerInventoryY, final int topYStart, final int topYEnd) { + super.resized(playerInventoryY, topYStart, topYEnd); craftingMatrixSlots.clear(); for (int y = 0; y < 3; ++y) { for (int x = 0; x < 3; ++x) { 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 index 59bff838a..a77f2cb79 100644 --- 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 @@ -11,13 +11,13 @@ 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); + resized(0, 0, 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); + resized(0, 0, 0); registerProperty(new ServerProperty<>( PropertyTypes.REDSTONE_MODE, grid::getRedstoneMode, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridContainerMenu.java index b49be1e0d..7d9ba7011 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridContainerMenu.java @@ -12,7 +12,7 @@ public WirelessGridContainerMenu(final int syncId, final WirelessGridData wirelessGridData) { super(Menus.INSTANCE.getWirelessGrid(), syncId, playerInventory, wirelessGridData.gridData()); this.disabledSlot = wirelessGridData.slotReference(); - onScreenReady(0); + resized(0, 0, 0); } WirelessGridContainerMenu(final int syncId, @@ -21,6 +21,6 @@ public WirelessGridContainerMenu(final int syncId, final SlotReference slotReference) { super(Menus.INSTANCE.getWirelessGrid(), syncId, playerInventory, grid); this.disabledSlot = slotReference; - onScreenReady(0); + resized(0, 0, 0); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java index 633d7a46e..de723ef18 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java @@ -84,7 +84,7 @@ protected AbstractGridScreen(final T menu, @Override protected void init(final int rows) { - LOGGER.info("Initializing grid screen"); + LOGGER.info("Initializing grid screen - this shouldn't happen too much!"); if (searchField == null) { searchField = new GridSearchBoxWidget( @@ -365,9 +365,7 @@ private String getAmountText(final GridResource resource, } private void renderDisabledSlot(final GuiGraphics graphics, final int slotX, final int slotY) { - graphics.fillGradient( - RenderType.guiOverlay(), slotX, slotY, slotX + 16, slotY + 16, DISABLED_SLOT_COLOR, DISABLED_SLOT_COLOR, 0 - ); + graphics.fill(RenderType.guiOverlay(), slotX, slotY, slotX + 16, slotY + 16, DISABLED_SLOT_COLOR); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/AbstractImporterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/AbstractImporterBlockEntity.java index 6e722c5cb..0218082b6 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/AbstractImporterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/AbstractImporterBlockEntity.java @@ -81,12 +81,12 @@ protected AbstractImporterBlockEntity(final BlockPos pos, final BlockState state @Override public List getUpgrades() { - return upgradeContainer.getUpgradeItems(); + return upgradeContainer.getUpgrades(); } @Override public boolean addUpgrade(final ItemStack upgradeStack) { - return upgradeContainer.addUpgradeItem(upgradeStack); + return upgradeContainer.addUpgrade(upgradeStack); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java index acd182a92..30a76f32f 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java @@ -74,12 +74,12 @@ public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider pr @Override public List getUpgrades() { - return upgradeContainer.getUpgradeItems(); + return upgradeContainer.getUpgrades(); } @Override public boolean addUpgrade(final ItemStack upgradeStack) { - return upgradeContainer.addUpgradeItem(upgradeStack); + return upgradeContainer.addUpgrade(upgradeStack); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardContainerMenu.java index 49f272ded..ae5ef58b3 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/AbstractSecurityCardContainerMenu.java @@ -36,7 +36,7 @@ protected AbstractSecurityCardContainerMenu(final MenuType menuType, this.playerInventory = playerInventory; this.disabledSlot = disabledSlot; this.permissions = new ArrayList<>(); - onScreenReady(0); + resized(0, 0, 0); } List getPermissions() { @@ -44,7 +44,7 @@ List getPermissions() { } @Override - public void onScreenReady(final int playerInventoryY) { + public void resized(final int playerInventoryY, final int topYStart, final int topYEnd) { resetSlots(); addPlayerInventory(playerInventory, 8, playerInventoryY); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java index 27e78416b..1c08a96cd 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java @@ -109,12 +109,12 @@ public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provide @Override public List getUpgrades() { - return upgradeContainer.getUpgradeItems(); + return upgradeContainer.getUpgrades(); } @Override public boolean addUpgrade(final ItemStack upgradeStack) { - return upgradeContainer.addUpgradeItem(upgradeStack); + return upgradeContainer.addUpgrade(upgradeStack); } @Override 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 index 328e62c64..3e80f4045 100644 --- 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 @@ -69,8 +69,8 @@ protected boolean canTransferSlot(final Slot slot) { } @Override - public void onScreenReady(final int playerInventoryY) { - super.onScreenReady(playerInventoryY); + public void resized(final int playerInventoryY, final int topYStart, final int topYEnd) { + super.resized(playerInventoryY, topYStart, topYEnd); diskSlot = ValidatedSlot.forStorageContainer(diskInventory, 0, -19, 8); addSlot(diskSlot); transferManager.addBiTransfer(playerInventory, diskInventory); 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 index 380eb8eb4..f021b85e9 100644 --- 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 @@ -15,7 +15,7 @@ public PortableGridBlockContainerMenu(final int syncId, final PortableGridData portableGridData) { super(Menus.INSTANCE.getPortableGridBlock(), syncId, playerInventory, portableGridData); registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); - this.onScreenReady(0); + resized(0, 0, 0); } PortableGridBlockContainerMenu(final int syncId, @@ -34,6 +34,6 @@ public PortableGridBlockContainerMenu(final int syncId, portableGrid::getRedstoneMode, portableGrid::setRedstoneMode )); - this.onScreenReady(0); + resized(0, 0, 0); } } 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 index 83dbff994..157fafecf 100644 --- 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 @@ -15,7 +15,7 @@ public PortableGridItemContainerMenu(final int syncId, final PortableGridData portableGridData) { super(Menus.INSTANCE.getPortableGridItem(), syncId, playerInventory, portableGridData); this.disabledSlot = portableGridData.slotReference().orElse(null); - this.onScreenReady(0); + resized(0, 0, 0); } PortableGridItemContainerMenu(final int syncId, @@ -33,6 +33,6 @@ public PortableGridItemContainerMenu(final int syncId, energyStorage ); this.disabledSlot = slotReference; - this.onScreenReady(0); + resized(0, 0, 0); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseContainerMenu.java index befcfd50a..a00e4efdf 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseContainerMenu.java @@ -23,6 +23,8 @@ import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; +import static java.util.Objects.requireNonNull; + public abstract class AbstractBaseContainerMenu extends AbstractContainerMenu { protected final TransferManager transferManager; @Nullable @@ -40,7 +42,7 @@ public boolean hasProperty(final PropertyType type) { @SuppressWarnings("unchecked") public ClientProperty getProperty(final PropertyType type) { - return (ClientProperty) propertyMap.get(type); + return (ClientProperty) requireNonNull(propertyMap.get(type), "Property not found"); } public void receivePropertyChangeFromClient(final ResourceLocation id, final int newValue) { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AbstractAmountScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/amount/AbstractAmountScreen.java index 1743e4589..a451b82b3 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/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.common.support.amount; -import com.refinedmods.refinedstorage.common.autocrafting.AlternativesScreen; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.AlternativesScreen; import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; import java.util.Optional; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/AutocrafterNameChangePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/AutocrafterNameChangePacket.java index 04fc5454d..b1da3c01c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/AutocrafterNameChangePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/AutocrafterNameChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.common.autocrafting.AutocrafterContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridAllowedAlternativesChangePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridAllowedAlternativesChangePacket.java index 761816fb7..d3cc763e7 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridAllowedAlternativesChangePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridAllowedAlternativesChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import java.util.HashSet; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridClearPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridClearPacket.java index f4195ef1d..b36b9086b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridClearPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridClearPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridCraftingRecipeTransferPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridCraftingRecipeTransferPacket.java index 3dbc0ddbe..dc201b5b0 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridCraftingRecipeTransferPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridCraftingRecipeTransferPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridCreatePatternPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridCreatePatternPacket.java index 3225174f6..d995481fd 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridCreatePatternPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridCreatePatternPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridProcessingRecipeTransferPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridProcessingRecipeTransferPacket.java index 8f7ffefb4..89bafe125 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridProcessingRecipeTransferPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridProcessingRecipeTransferPacket.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.common.support.packet.c2s; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridSmithingTableRecipeTransferPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridSmithingTableRecipeTransferPacket.java index f5f5966b9..0d4a36437 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridSmithingTableRecipeTransferPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridSmithingTableRecipeTransferPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridStonecutterRecipeTransferPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridStonecutterRecipeTransferPacket.java index d95c48fcb..8a23f5609 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridStonecutterRecipeTransferPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/c2s/PatternGridStonecutterRecipeTransferPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.c2s; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import com.refinedmods.refinedstorage.common.support.resource.ResourceCodecs; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/AutocrafterManagerActivePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/AutocrafterManagerActivePacket.java new file mode 100644 index 000000000..7274142ec --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/AutocrafterManagerActivePacket.java @@ -0,0 +1,34 @@ +package com.refinedmods.refinedstorage.common.support.packet.s2c; + +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerContainerMenu; +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 net.minecraft.world.inventory.AbstractContainerMenu; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +public record AutocrafterManagerActivePacket(boolean active) implements CustomPacketPayload { + public static final Type PACKET_TYPE = + new Type<>(createIdentifier("autocrafter_manager_active")); + public static final StreamCodec STREAM_CODEC = + StreamCodec.composite( + ByteBufCodecs.BOOL, AutocrafterManagerActivePacket::active, + AutocrafterManagerActivePacket::new + ); + + public static void handle(final AutocrafterManagerActivePacket packet, final PacketContext ctx) { + final AbstractContainerMenu menu = ctx.getPlayer().containerMenu; + if (menu instanceof AutocrafterManagerContainerMenu containerMenu) { + containerMenu.setActive(packet.active); + } + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/AutocrafterNameUpdatePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/AutocrafterNameUpdatePacket.java index 3eb557d31..e4d844ec8 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/AutocrafterNameUpdatePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/AutocrafterNameUpdatePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.s2c; -import com.refinedmods.refinedstorage.common.autocrafting.AutocrafterContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.autocrafter.AutocrafterContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import net.minecraft.network.RegistryFriendlyByteBuf; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/PatternGridAllowedAlternativesUpdatePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/PatternGridAllowedAlternativesUpdatePacket.java index dad2cf5a2..c4bb96814 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/PatternGridAllowedAlternativesUpdatePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/PatternGridAllowedAlternativesUpdatePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.s2c; -import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu; +import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; import java.util.HashSet; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java index 9ddd2e9c1..fbc8778cf 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java @@ -29,10 +29,14 @@ public static void sendWirelessTransmitterData(final ServerPlayer player, final Platform.INSTANCE.sendPacketToClient(player, new WirelessTransmitterDataPacket(range, active)); } - public static void sendGridActiveness(final ServerPlayer player, final boolean active) { + public static void sendGridActive(final ServerPlayer player, final boolean active) { Platform.INSTANCE.sendPacketToClient(player, new GridActivePacket(active)); } + public static void sendAutocrafterManagerActive(final ServerPlayer player, final boolean active) { + Platform.INSTANCE.sendPacketToClient(player, new AutocrafterManagerActivePacket(active)); + } + public static void sendGridUpdate(final ServerPlayer player, final PlatformResourceKey resource, final long change, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/AbstractStretchingScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/AbstractStretchingScreen.java index 2d455bc14..756bf1456 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/AbstractStretchingScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/AbstractStretchingScreen.java @@ -15,11 +15,11 @@ public abstract class AbstractStretchingScreen extends AbstractBaseScreen { protected static final int ROW_SIZE = 18; + protected static final int TOP_HEIGHT = 19; - private static final int TOP_HEIGHT = 19; + private static final int INVENTORY_INCLUDING_TITLE_HEIGHT = 99; private static final int COLUMNS = 9; private static final int MIN_ROWS = 3; - private static final int INVENTORY_INCLUDING_TITLE_HEIGHT = 99; private static final int ROW_PADDING = 3; private int visibleRows; @@ -44,7 +44,7 @@ protected void init() { this.imageHeight = TOP_HEIGHT + (ROW_SIZE * visibleRows) + getBottomHeight(); this.inventoryLabelY = imageHeight - INVENTORY_INCLUDING_TITLE_HEIGHT + 4; - getMenu().onScreenReady(imageHeight - INVENTORY_INCLUDING_TITLE_HEIGHT + 17); + resize(); super.init(); @@ -66,6 +66,14 @@ protected void init(final int rows) { // no op } + protected final void resize() { + getMenu().resized( + imageHeight - INVENTORY_INCLUDING_TITLE_HEIGHT + 17, + TOP_HEIGHT + 1, + TOP_HEIGHT + 1 + (ROW_SIZE * visibleRows) - 2 + ); + } + protected final int getScrollbarOffset() { if (scrollbar == null) { return 0; 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 index 748a2002f..2f93f8bbb 100644 --- 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 @@ -2,5 +2,5 @@ @FunctionalInterface public interface ScreenSizeListener { - void onScreenReady(int playerInventoryY); + void resized(int playerInventoryY, int topYStart, int topYEnd); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeContainer.java index 5c71dc2e6..00285ae74 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeContainer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/UpgradeContainer.java @@ -145,20 +145,20 @@ public long getEnergyUsage() { return usage; } - public List getUpgradeItems() { - final List upgradeItems = new ArrayList<>(); + public List getUpgrades() { + final List upgrades = new ArrayList<>(); for (int i = 0; i < getContainerSize(); ++i) { - final ItemStack itemStack = getItem(i); - if (itemStack.isEmpty()) { + final ItemStack stack = getItem(i); + if (stack.isEmpty()) { continue; } - upgradeItems.add(itemStack.copy()); + upgrades.add(stack.copy()); } - return upgradeItems; + return upgrades; } - public boolean addUpgradeItem(final ItemStack upgradeItem) { - return addItem(upgradeItem).isEmpty(); + public boolean addUpgrade(final ItemStack upgrade) { + return addItem(upgrade).isEmpty(); } public NonNullList getDrops() { diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json index df57807b1..10d370c0a 100644 --- a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json @@ -38,6 +38,7 @@ "block.refinedstorage.relay": "Relay", "block.refinedstorage.disk_interface": "Disk Interface", "block.refinedstorage.autocrafter": "Autocrafter", + "block.refinedstorage.autocrafter_manager": "Autocrafter Manager", "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.", @@ -126,7 +127,7 @@ "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.priority.crafter_help": "If multiple patterns exist for one resource, crafting tasks will prioritize the pattern in the Autocrafter with the highest priority.", + "gui.refinedstorage.priority.crafter_help": "If multiple patterns exist for one resource, crafting tasks will prioritize the pattern in the autocrafter with the highest priority.", "gui.refinedstorage.configure_amount": "Configure amount", "gui.refinedstorage.configure_amount.reset": "Reset", "gui.refinedstorage.configure_amount.set": "Set", @@ -202,6 +203,8 @@ "gui.refinedstorage.autocrafter.lock_mode.lock_until_all_outputs_are_received": "Lock until all outputs are received", "gui.refinedstorage.autocrafter.lock_mode.lock_until_high_redstone_signal": "Lock until high redstone signal", "gui.refinedstorage.autocrafter.lock_mode.lock_until_low_redstone_signal": "Lock until low redstone signal", + "gui.refinedstorage.autocrafter.visible_to_the_autocrafter_manager": "Visible to the Autocrafter Manager", + "gui.refinedstorage.autocrafter.visible_to_the_autocrafter_manager.help": "If this is enabled, you will be able to manage this autocrafter in the Autocrafter Manager.", "gui.refinedstorage.autocrafter.edit_name": "Edit", "gui.refinedstorage.autocrafter.chained": "Chained", "gui.refinedstorage.autocrafter.chained.help": "This autocrafter is part of a chain.", @@ -215,6 +218,22 @@ "gui.refinedstorage.autocrafting_preview.available": "Available: %s", "gui.refinedstorage.autocrafting_preview.to_craft": "To craft: %s", "gui.refinedstorage.autocrafting_preview.missing": "Missing: %s", + "gui.refinedstorage.autocrafter_manager.search_mode": "Search mode", + "gui.refinedstorage.autocrafter_manager.search_mode.all": "All", + "gui.refinedstorage.autocrafter_manager.search_mode.all.help": "Search in pattern inputs, pattern outputs and autocrafter names.", + "gui.refinedstorage.autocrafter_manager.search_mode.pattern_inputs": "Pattern inputs", + "gui.refinedstorage.autocrafter_manager.search_mode.pattern_inputs.help": "Search in pattern inputs.", + "gui.refinedstorage.autocrafter_manager.search_mode.pattern_outputs": "Pattern outputs", + "gui.refinedstorage.autocrafter_manager.search_mode.pattern_outputs.help": "Search in pattern outputs.", + "gui.refinedstorage.autocrafter_manager.search_mode.autocrafter_names": "Autocrafter names", + "gui.refinedstorage.autocrafter_manager.search_mode.autocrafter_names.help": "Search in autocrafter names.", + "gui.refinedstorage.autocrafter_manager.view_type": "View type", + "gui.refinedstorage.autocrafter_manager.view_type.visible": "Visible", + "gui.refinedstorage.autocrafter_manager.view_type.visible.help": "Show all autocrafters that are visible to the Autocrafter Manager.", + "gui.refinedstorage.autocrafter_manager.view_type.not_full": "Not full", + "gui.refinedstorage.autocrafter_manager.view_type.not_full.help": "Show all autocrafters that are not full yet.", + "gui.refinedstorage.autocrafter_manager.view_type.all": "All", + "gui.refinedstorage.autocrafter_manager.view_type.all.help": "Show all autocrafters.", "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.", @@ -327,6 +346,7 @@ "item.refinedstorage.pattern": "Pattern", "item.refinedstorage.pattern.fuzzy_mode": "Fuzzy mode", "item.refinedstorage.pattern.help": "Used in autocrafting to store the recipe to be crafted. Use while crouching to clear.", + "item.refinedstorage.autocrafter_manager.help": "Allows managing all your autocrafters from a single interface.", "misc.refinedstorage.stored": "Stored: %s", "misc.refinedstorage.stored_with_capacity": "Stored: %s / %s (%d%%)", "misc.refinedstorage.total": "%d total", @@ -396,7 +416,8 @@ "tag.item.refinedstorage.storage_disks": "Storage Disks", "tag.item.refinedstorage.wireless_transmitters": "Wireless Transmitters", "tag.item.refinedstorage.disk_interfaces": "Disk Interfaces", - "tag.item.refinedstorage.crafters": "Crafters", + "tag.item.refinedstorage.autocrafters": "Autocrafters", + "tag.item.refinedstorage.autocrafter_managers": "Autocrafter Managers", "text.autoconfig.refinedstorage.title": "Refined Storage Configuration", "refinedstorage.configuration.title": "Refined Storage Configuration", "refinedstorage.configuration.section.refinedstorage.common.toml": "Refined Storage Configuration", @@ -597,6 +618,14 @@ "text.autoconfig.refinedstorage.option.autocrafter.energyUsage.tooltip": "The energy used by the Autocrafter.", "text.autoconfig.refinedstorage.option.autocrafter.energyUsagePerPattern": "Energy usage per pattern", "text.autoconfig.refinedstorage.option.autocrafter.energyUsagePerPattern.tooltip": "The additional energy used per pattern.", + "text.autoconfig.refinedstorage.option.autocrafterManager": "Autocrafter Manager", + "text.autoconfig.refinedstorage.option.autocrafterManager.tooltip": "Configuration for the Autocrafter Manager.", + "text.autoconfig.refinedstorage.option.autocrafterManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage.option.autocrafterManager.energyUsage.tooltip": "The energy used by the Autocrafter Manager.", + "text.autoconfig.refinedstorage.option.autocrafterManager.searchMode": "Search mode", + "text.autoconfig.refinedstorage.option.autocrafterManager.searchMode.tooltip": "The search mode.", + "text.autoconfig.refinedstorage.option.autocrafterManager.viewType": "View type", + "text.autoconfig.refinedstorage.option.autocrafterManager.viewType.tooltip": "The view type.", "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", @@ -641,5 +670,7 @@ "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", "advancements.refinedstorage.autocrafting": "Autocrafting", - "advancements.refinedstorage.autocrafting.description": "Automate crafting with an Autocrafter by using patterns created in a Pattern Grid" + "advancements.refinedstorage.autocrafting.description": "Automate crafting with an Autocrafter by using patterns created in a Pattern Grid", + "advancements.refinedstorage.managing_patterns": "Managing patterns", + "advancements.refinedstorage.managing_patterns.description": "Craft an Autocrafter Manager to manage your patterns in a centralized interface" } diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/back.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/back.png new file mode 100644 index 000000000..ffb76f755 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/back.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/black.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/black.png new file mode 100644 index 000000000..11f51d272 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/black.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/blue.png new file mode 100644 index 000000000..bacdff192 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/blue.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/brown.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/brown.png new file mode 100644 index 000000000..9d84b5b04 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/brown.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/cyan.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/cyan.png new file mode 100644 index 000000000..4179a1e09 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/cyan.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/gray.png new file mode 100644 index 000000000..d129f17dd Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/gray.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/green.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/green.png new file mode 100644 index 000000000..9a51df363 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/green.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/inactive.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/inactive.png new file mode 100644 index 000000000..47d8df7d3 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/inactive.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/light_blue.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/light_blue.png new file mode 100644 index 000000000..9e25a25d4 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/light_blue.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/light_gray.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/light_gray.png new file mode 100644 index 000000000..8618f2d9e Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/light_gray.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/lime.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/lime.png new file mode 100644 index 000000000..c3e2bb457 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/lime.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/magenta.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/magenta.png new file mode 100644 index 000000000..cfe755a67 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/magenta.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/orange.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/orange.png new file mode 100644 index 000000000..5fb06912d Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/orange.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/pink.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/pink.png new file mode 100644 index 000000000..6c27efe1d Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/pink.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/purple.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/purple.png new file mode 100644 index 000000000..259a8be79 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/purple.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/red.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/red.png new file mode 100644 index 000000000..c6db80aa3 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/red.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/white.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/white.png new file mode 100644 index 000000000..a0f147a49 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/white.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/yellow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/yellow.png new file mode 100644 index 000000000..d497b2be1 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/cutouts/yellow.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/front.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/front.png new file mode 100644 index 000000000..951973d63 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/front.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/left.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/left.png new file mode 100644 index 000000000..a4a5b2664 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/left.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/right.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/right.png new file mode 100644 index 000000000..eb4e500c5 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/right.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/top.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/top.png new file mode 100644 index 000000000..0d782d2d0 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/block/autocrafter_manager/top.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/autocrafter_manager.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/autocrafter_manager.png new file mode 100644 index 000000000..4e88dbe82 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/autocrafter_manager.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/autocrafter_manager/autocrafter_name.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/autocrafter_manager/autocrafter_name.png new file mode 100644 index 000000000..e2d03985d Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/autocrafter_manager/autocrafter_name.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_all_outputs_are_received.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_all_outputs_are_received.png similarity index 100% rename from refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_all_outputs_are_received.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_all_outputs_are_received.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_connected_machine_is_empty.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_connected_machine_is_empty.png similarity index 100% rename from refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_connected_machine_is_empty.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_connected_machine_is_empty.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_high_redstone_signal.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_high_redstone_signal.png similarity index 100% rename from refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_high_redstone_signal.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_high_redstone_signal.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_low_redstone_signal.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_low_redstone_signal.png similarity index 100% rename from refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_low_redstone_signal.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_low_redstone_signal.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_redstone_pulse_is_received.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_redstone_pulse_is_received.png similarity index 100% rename from refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/lock_until_redstone_pulse_is_received.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/lock_until_redstone_pulse_is_received.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/never.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/never.png similarity index 100% rename from refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_lock_mode/never.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/lock_mode/never.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/visible_to_the_autocrafter_manager/no.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/visible_to_the_autocrafter_manager/no.png new file mode 100644 index 000000000..054e6ac47 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/visible_to_the_autocrafter_manager/no.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/visible_to_the_autocrafter_manager/yes.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/visible_to_the_autocrafter_manager/yes.png new file mode 100644 index 000000000..cd3147b66 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter/visible_to_the_autocrafter_manager/yes.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/all.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/all.png new file mode 100644 index 000000000..71c37387b Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/all.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/autocrafter_names.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/autocrafter_names.png new file mode 100644 index 000000000..ddb29dfa1 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/autocrafter_names.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/pattern_inputs.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/pattern_inputs.png new file mode 100644 index 000000000..6a5552254 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/pattern_inputs.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/pattern_outputs.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/pattern_outputs.png new file mode 100644 index 000000000..d8e3a35d4 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/search_mode/pattern_outputs.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/view_type/all.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/view_type/all.png new file mode 100644 index 000000000..cd3147b66 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/view_type/all.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/view_type/not_full.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/view_type/not_full.png new file mode 100644 index 000000000..2e5d35776 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/view_type/not_full.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/view_type/visible.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/view_type/visible.png new file mode 100644 index 000000000..514ee0198 Binary files /dev/null and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/autocrafter_manager/view_type/visible.png differ diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/all.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/all.png index afd9d1d77..bbecbe88e 100644 Binary files a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/all.png and b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/all.png differ diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/managing_patterns.json b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/managing_patterns.json new file mode 100644 index 000000000..060a4decf --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/advancement/managing_patterns.json @@ -0,0 +1,26 @@ +{ + "display": { + "icon": { + "id": "refinedstorage:autocrafter_manager" + }, + "title": { + "translate": "advancements.refinedstorage.managing_patterns" + }, + "description": { + "translate": "advancements.refinedstorage.managing_patterns.description" + } + }, + "parent": "refinedstorage:autocrafting", + "criteria": { + "autocrafter_manager_in_inventory": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "#refinedstorage:autocrafter_managers" + } + ] + } + } + } +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/autocrafter_manager.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/autocrafter_manager.json new file mode 100644 index 000000000..6862ee918 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/autocrafter_manager.json @@ -0,0 +1,28 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "PCG", + "EMG", + "PCG" + ], + "key": { + "P": { + "item": "refinedstorage:advanced_processor" + }, + "C": { + "tag": "refinedstorage:autocrafters" + }, + "G": { + "tag": "c:glass_blocks" + }, + "E": { + "item": "refinedstorage:quartz_enriched_iron" + }, + "M": { + "item": "refinedstorage:machine_casing" + } + }, + "result": { + "id": "refinedstorage:autocrafter_manager" + } +} \ No newline at end of file diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java index a795f8784..0ca4674bd 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java @@ -19,6 +19,7 @@ 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.AutocrafterManagerActivePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.AutocrafterNameUpdatePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.AutocraftingPreviewResponsePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.AutocraftingResponsePacket; @@ -128,6 +129,7 @@ private void setRenderLayers() { setCutout(Blocks.INSTANCE.getRelay()); setCutout(Blocks.INSTANCE.getDiskInterface()); setCutout(Blocks.INSTANCE.getAutocrafter()); + setCutout(Blocks.INSTANCE.getAutocrafterManager()); } private void setCutout(final BlockColorMap blockMap) { @@ -157,6 +159,7 @@ private void registerEmissiveModels() { ); Blocks.INSTANCE.getRelay().forEach((color, id, block) -> registerEmissiveRelayModels(color, id)); Blocks.INSTANCE.getAutocrafter().forEach((color, id, block) -> registerEmissiveAutocrafterModels(color, id)); + registerColoredEmissiveModels(Blocks.INSTANCE.getAutocrafterManager(), "autocrafter_manager"); } private void registerColoredEmissiveModels(final BlockColorMap blockMap, @@ -264,6 +267,10 @@ private void registerPacketHandlers() { GridActivePacket.PACKET_TYPE, wrapHandler(GridActivePacket::handle) ); + ClientPlayNetworking.registerGlobalReceiver( + AutocrafterManagerActivePacket.PACKET_TYPE, + wrapHandler(AutocrafterManagerActivePacket::handle) + ); ClientPlayNetworking.registerGlobalReceiver( EnergyInfoPacket.PACKET_TYPE, wrapHandler(EnergyInfoPacket::handle) 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 index 91d5d7024..37078f05d 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ConfigImpl.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ConfigImpl.java @@ -1,6 +1,8 @@ package com.refinedmods.refinedstorage.fabric; import com.refinedmods.refinedstorage.api.grid.view.GridSortingDirection; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerSearchMode; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerViewType; import com.refinedmods.refinedstorage.common.content.DefaultEnergyUsage; import com.refinedmods.refinedstorage.common.grid.CraftingGridMatrixCloseBehavior; import com.refinedmods.refinedstorage.common.grid.GridSortingTypes; @@ -122,6 +124,9 @@ public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage.co @ConfigEntry.Gui.CollapsibleObject private AutocrafterEntryImpl autocrafter = new AutocrafterEntryImpl(); + @ConfigEntry.Gui.CollapsibleObject + private AutocrafterManagerEntryImpl autocrafterManager = new AutocrafterManagerEntryImpl(); + public static ConfigImpl get() { return AutoConfig.getConfigHolder(ConfigImpl.class).getConfig(); } @@ -287,6 +292,11 @@ public AutocrafterEntry getAutocrafter() { return autocrafter; } + @Override + public AutocrafterManagerEntry getAutocrafterManager() { + return autocrafterManager; + } + private static class GridEntryImpl implements GridEntry { private boolean largeFont = false; @@ -739,4 +749,43 @@ public long getEnergyUsage() { return energyUsage; } } + + private static class AutocrafterManagerEntryImpl implements AutocrafterManagerEntry { + private long energyUsage = DefaultEnergyUsage.AUTOCRAFTER_MANAGER; + + private AutocrafterManagerSearchMode searchMode = AutocrafterManagerSearchMode.ALL; + + private AutocrafterManagerViewType viewType = AutocrafterManagerViewType.VISIBLE; + + @Override + public void setSearchMode(final AutocrafterManagerSearchMode searchMode) { + this.searchMode = searchMode; + save(); + } + + @Override + public AutocrafterManagerSearchMode getSearchMode() { + return searchMode; + } + + @Override + public void setViewType(final AutocrafterManagerViewType viewType) { + this.viewType = viewType; + save(); + } + + @Override + public AutocrafterManagerViewType getViewType() { + return viewType; + } + + @Override + public long getEnergyUsage() { + return energyUsage; + } + + private static void save() { + AutoConfig.getConfigHolder(ConfigImpl.class).save(); + } + } } 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 index 2eb94d057..743cca012 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ModInitializerImpl.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ModInitializerImpl.java @@ -55,6 +55,7 @@ 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.AutocrafterManagerActivePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.AutocrafterNameUpdatePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.AutocraftingPreviewResponsePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.AutocraftingResponsePacket; @@ -421,6 +422,10 @@ private void registerServerToClientPackets() { WirelessTransmitterDataPacket.STREAM_CODEC ); PayloadTypeRegistry.playS2C().register(GridActivePacket.PACKET_TYPE, GridActivePacket.STREAM_CODEC); + PayloadTypeRegistry.playS2C().register( + AutocrafterManagerActivePacket.PACKET_TYPE, + AutocrafterManagerActivePacket.STREAM_CODEC + ); PayloadTypeRegistry.playS2C().register(GridClearPacket.PACKET_TYPE, GridClearPacket.STREAM_CODEC); PayloadTypeRegistry.playS2C().register(GridUpdatePacket.PACKET_TYPE, GridUpdatePacket.STREAM_CODEC); PayloadTypeRegistry.playS2C().register( @@ -692,6 +697,7 @@ private void registerCapabilities() { registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getStorageMonitor()); registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getWirelessTransmitter()); registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getAutocrafter()); + registerNetworkNodeContainerProvider(BlockEntities.INSTANCE.getAutocrafterManager()); registerItemStorage( AbstractDiskDriveBlockEntity.class::isInstance, AbstractDiskDriveBlockEntity.class::cast, 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 index 96fa0e471..fb5553942 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java @@ -2,6 +2,8 @@ import com.refinedmods.refinedstorage.api.grid.view.GridSortingDirection; import com.refinedmods.refinedstorage.common.Config; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerSearchMode; +import com.refinedmods.refinedstorage.common.autocrafting.autocraftermanager.AutocrafterManagerViewType; import com.refinedmods.refinedstorage.common.content.DefaultEnergyUsage; import com.refinedmods.refinedstorage.common.grid.CraftingGridMatrixCloseBehavior; import com.refinedmods.refinedstorage.common.grid.GridSortingTypes; @@ -53,6 +55,7 @@ public class ConfigImpl implements Config { private final SimpleEnergyUsageEntry securityManager; private final RelayEntry relay; private final AutocrafterEntryImpl autocrafter; + private final AutocrafterManagerEntryImpl autocrafterManager; public ConfigImpl() { screenSize = builder @@ -98,6 +101,7 @@ public ConfigImpl() { securityManager = new SimpleEnergyUsageEntryImpl("securityManager", DefaultEnergyUsage.SECURITY_MANAGER); relay = new RelayEntryImpl(); autocrafter = new AutocrafterEntryImpl(); + autocrafterManager = new AutocrafterManagerEntryImpl(); spec = builder.build(); } @@ -264,10 +268,15 @@ public RelayEntry getRelay() { } @Override - public AutocrafterEntryImpl getAutocrafter() { + public AutocrafterEntry getAutocrafter() { return autocrafter; } + @Override + public AutocrafterManagerEntry getAutocrafterManager() { + return autocrafterManager; + } + private static String translationKey(final String value) { return createTranslationKey("text.autoconfig", "option." + value); } @@ -951,4 +960,55 @@ public long getEnergyUsage() { return energyUsage.get(); } } + + private class AutocrafterManagerEntryImpl implements AutocrafterManagerEntry { + private final ModConfigSpec.LongValue energyUsage; + private final ModConfigSpec.EnumValue searchMode; + private final ModConfigSpec.EnumValue viewType; + + AutocrafterManagerEntryImpl() { + builder.translation(translationKey("autocrafterManager")).push("autocrafterManager"); + energyUsage = builder + .translation(translationKey("autocrafterManager." + ENERGY_USAGE)) + .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.AUTOCRAFTER_MANAGER, 0, Long.MAX_VALUE); + searchMode = builder + .translation(translationKey("autocrafterManager.searchMode")) + .defineEnum("searchMode", AutocrafterManagerSearchMode.ALL); + viewType = builder + .translation(translationKey("autocrafterManager.viewType")) + .defineEnum("viewType", AutocrafterManagerViewType.VISIBLE); + builder.pop(); + } + + @Override + public void setSearchMode(final AutocrafterManagerSearchMode searchMode) { + if (searchMode != this.searchMode.get()) { + this.searchMode.set(searchMode); + ConfigImpl.this.spec.save(); + } + } + + @Override + public AutocrafterManagerSearchMode getSearchMode() { + return searchMode.get(); + } + + @Override + public void setViewType(final AutocrafterManagerViewType viewType) { + if (viewType != this.viewType.get()) { + this.viewType.set(viewType); + ConfigImpl.this.spec.save(); + } + } + + @Override + public AutocrafterManagerViewType getViewType() { + return viewType.get(); + } + + @Override + public long getEnergyUsage() { + return energyUsage.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 index fb0e8e4eb..63a292e96 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ModInitializer.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ModInitializer.java @@ -55,6 +55,7 @@ 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.AutocrafterManagerActivePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.AutocrafterNameUpdatePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.AutocraftingPreviewResponsePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.AutocraftingResponsePacket; @@ -430,6 +431,7 @@ private void registerCapabilities(final RegisterCapabilitiesEvent event) { registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getStorageMonitor()); registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getWirelessTransmitter()); registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getAutocrafter()); + registerNetworkNodeContainerProvider(event, BlockEntities.INSTANCE.getAutocrafterManager()); event.registerBlockEntity( Capabilities.ItemHandler.BLOCK, BlockEntities.INSTANCE.getDiskDrive(), @@ -590,6 +592,11 @@ private static void registerServerToClientPackets(final PayloadRegistrar registr GridActivePacket.STREAM_CODEC, wrapHandler(GridActivePacket::handle) ); + registrar.playToClient( + AutocrafterManagerActivePacket.PACKET_TYPE, + AutocrafterManagerActivePacket.STREAM_CODEC, + wrapHandler(AutocrafterManagerActivePacket::handle) + ); registrar.playToClient( GridClearPacket.PACKET_TYPE, GridClearPacket.STREAM_CODEC, diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockModelProviderImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockModelProviderImpl.java index 042161937..b74b9ce02 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockModelProviderImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockModelProviderImpl.java @@ -51,6 +51,7 @@ protected void registerModels() { registerRightLeftBackFrontTopModel(Blocks.INSTANCE.getGrid(), "grid", ""); registerRightLeftBackFrontTopModel(Blocks.INSTANCE.getCraftingGrid(), "crafting_grid", ""); registerRightLeftBackFrontTopModel(Blocks.INSTANCE.getPatternGrid(), "pattern_grid", ""); + registerRightLeftBackFrontTopModel(Blocks.INSTANCE.getAutocrafterManager(), "autocrafter_manager", ""); registerDetectors(); registerWirelessTransmitters(); registerNetworkReceivers(); diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockStateProviderImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockStateProviderImpl.java index 23d382e0e..775770ecf 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockStateProviderImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/BlockStateProviderImpl.java @@ -59,6 +59,7 @@ protected void registerStatesAndModels() { registerRelays(); registerDiskInterfaces(); registerAutocrafters(); + registerAutocrafterManagers(); } private void registerCables() { @@ -325,6 +326,14 @@ private void registerAutocrafters() { }); } + private void registerAutocrafterManagers() { + Blocks.INSTANCE.getAutocrafterManager().forEach((color, id, block) -> configureActiveColoredDirectionalBlock( + color, + block, + "autocrafter_manager" + )); + } + private void configureActiveColoredDirectionalBlock(final DyeColor color, final Supplier block, final String name) { diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java index 983a523ab..e7c226bb3 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java @@ -52,6 +52,7 @@ protected void registerModels() { registerRelays(); registerDiskInterfaces(); registerAutocrafters(); + registerAutocrafterManagers(); } private void registerCables() { @@ -227,6 +228,14 @@ private void registerAutocrafters() { )); } + private void registerAutocrafterManagers() { + final var blocks = Blocks.INSTANCE.getAutocrafterManager(); + blocks.forEach((color, id, block) -> withExistingParent( + id.getPath(), + createIdentifier("block/autocrafter_manager/" + color.getName()) + )); + } + private ModelFile modelFile(final ResourceLocation location) { return new ModelFile.ExistingModelFile(location, existingFileHelper); } diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java index 32b2fa6c4..6a71a8e05 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java @@ -42,6 +42,7 @@ protected void generate() { Blocks.INSTANCE.getRelay().forEach((color, id, block) -> drop(block.get())); Blocks.INSTANCE.getDiskInterface().forEach((color, id, block) -> drop(block.get())); Blocks.INSTANCE.getAutocrafter().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getAutocrafterManager().forEach((color, id, block) -> drop(block.get())); } private void drop(final Block block) { @@ -73,6 +74,7 @@ protected Iterable getKnownBlocks() { blocks.addAll(Blocks.INSTANCE.getRelay().values()); blocks.addAll(Blocks.INSTANCE.getDiskInterface().values()); blocks.addAll(Blocks.INSTANCE.getAutocrafter().values()); + blocks.addAll(Blocks.INSTANCE.getAutocrafterManager().values()); return blocks; } } diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/RecoloringRecipeProvider.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/RecoloringRecipeProvider.java index ac3b84b27..db6656d9b 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/RecoloringRecipeProvider.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/recipe/RecoloringRecipeProvider.java @@ -80,6 +80,9 @@ protected void buildRecipes(final RecipeOutput output) { Blocks.INSTANCE.getAutocrafter().forEach((color, id, block) -> recipe(Tags.AUTOCRAFTERS, block.get().asItem(), color) .save(output, recipeId(color, "autocrafter"))); + Blocks.INSTANCE.getAutocrafterManager().forEach((color, id, block) -> + recipe(Tags.AUTOCRAFTER_MANAGERS, block.get().asItem(), color) + .save(output, recipeId(color, "autocrafter_manager"))); } private ResourceLocation recipeId(final DyeColor color, final String suffix) { 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 index 290721ca4..12e81288b 100644 --- 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 @@ -21,6 +21,7 @@ import net.neoforged.neoforge.common.data.ExistingFileHelper; import static com.refinedmods.refinedstorage.common.content.Tags.AUTOCRAFTERS; +import static com.refinedmods.refinedstorage.common.content.Tags.AUTOCRAFTER_MANAGERS; 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; @@ -135,6 +136,10 @@ protected void addTags(final HolderLookup.Provider provider) { Blocks.INSTANCE.getAutocrafter().values().stream() .map(block -> (Supplier) block::asItem) .toList()); + addAllToTag(AUTOCRAFTER_MANAGERS, + Blocks.INSTANCE.getAutocrafterManager().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); } private void addAllToTag(final TagKey t, final Collection> items) { diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/autocrafting/SimplePattern.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/autocrafting/SimplePattern.java index 4ebb15448..25669b377 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/autocrafting/SimplePattern.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/autocrafting/SimplePattern.java @@ -12,6 +12,11 @@ public SimplePattern(final ResourceKey... outputs) { this.outputs = Set.of(outputs); } + @Override + public Set getInputResources() { + return Set.of(); + } + @Override public Set getOutputResources() { return outputs;