Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.0.0-milestone.4.8 #706

Merged
merged 107 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
380b85f
Merge pull request #664 from refinedmods/main
raoulvdberge Aug 11, 2024
abc1ac3
fix: mouse keybindings not working on neoforge
raoulvdberge Aug 11, 2024
87da4d6
chore: sonar fixes
raoulvdberge Aug 11, 2024
13811fa
fix: creative items not having correct gui title
raoulvdberge Aug 11, 2024
d7cd115
Merge pull request #666 from refinedmods/fix/GH-665/mouse-keybinds
raoulvdberge Aug 11, 2024
ca22042
chore: update translation Turkish from crowdin
raoulvdberge Aug 12, 2024
94c9437
Merge pull request #667 from refinedmods/crowdin-translations
raoulvdberge Aug 12, 2024
53273b4
refactor: remove AbstractLevelInteractingNetworkNodeContainerBlockEntity
raoulvdberge Aug 12, 2024
9d8c5d6
refactor: move "placed by player id" out of AbstractRedstoneModeNetwo…
raoulvdberge Aug 12, 2024
6f75180
refactor: remove AbstractRedstoneModeNetworkNodeContainerBlockEntity
raoulvdberge Aug 12, 2024
46fa1cc
refactor: simplify UpgradeContainer usage
raoulvdberge Aug 12, 2024
1940ca7
refactor: remove AbstractUpgradeableNetworkNodeContainerBlockEntity
raoulvdberge Aug 12, 2024
ad2f3e8
refactor: remove AbstractSchedulingNetworkNodeContainerBlockEntity
raoulvdberge Aug 14, 2024
a9a406a
refactor: constructor and destructor now have their own network node
raoulvdberge Aug 14, 2024
dad98e0
refactor: work tick rate is now entirely determined by the upgrade co…
raoulvdberge Aug 14, 2024
14442be
Merge pull request #668 from refinedmods/refactor/NO-ISSUE/untangle-n…
raoulvdberge Aug 14, 2024
da665f2
feat: use model data for cable connections
raoulvdberge Aug 12, 2024
5028bbb
refactor: disk interface model now has a color property on forge
raoulvdberge Aug 14, 2024
14698cc
Merge pull request #669 from refinedmods/fix/NO-ISSUE/cable-model-data
raoulvdberge Aug 14, 2024
d3fe39d
chore: update translation Chinese Traditional from crowdin
raoulvdberge Aug 15, 2024
39e0b11
Merge pull request #670 from refinedmods/crowdin-translations
raoulvdberge Aug 16, 2024
ab15150
fix: reuse grid resources when rebuilding view list
raoulvdberge Aug 18, 2024
667a278
Merge pull request #672 from refinedmods/fix/NO-ISSUE/grid-resource-r…
raoulvdberge Aug 18, 2024
3d4d1b7
feat: crafter block
raoulvdberge Aug 23, 2024
8452293
feat: use marquee everywhere
raoulvdberge Aug 25, 2024
926ccff
feat: crafter screen
raoulvdberge Aug 25, 2024
8fb64b8
fix: upgrade destinations not being shown on upgrades
raoulvdberge Aug 25, 2024
1b15d9e
feat: crafter renaming
raoulvdberge Aug 25, 2024
3ec49ba
feat: crafter chaining
raoulvdberge Aug 25, 2024
75806a3
feat: crafter lock mode
raoulvdberge Aug 27, 2024
dbac883
feat: crafter priority
raoulvdberge Aug 27, 2024
a7f7ac7
feat: crafter now indicates whether it is chained
raoulvdberge Aug 29, 2024
c823673
feat: use edit button instead of title click
raoulvdberge Aug 29, 2024
30f25c6
docs: update changelog
raoulvdberge Aug 29, 2024
a9d17ba
Merge pull request #676 from refinedmods/feat/GH-98/crafter
raoulvdberge Aug 29, 2024
c561c66
feat: pattern registration
raoulvdberge Aug 29, 2024
faa5596
feat: the grid now knows what is craftable
raoulvdberge Aug 30, 2024
aed7473
chore: change wording of not chained help
raoulvdberge Aug 30, 2024
cea095e
refactor: convert patterns to regular classes
raoulvdberge Aug 31, 2024
eecc1ab
feat: the tooltip for the fuzzy mode checkbox is now a help tooltip
raoulvdberge Aug 31, 2024
7c35657
feat: craftable grid slots now have a highlight and tooltip
raoulvdberge Sep 1, 2024
91231d0
feat: pattern and crafting grid slots now have a craftable highlight …
raoulvdberge Sep 1, 2024
6b2e9ff
feat: grid view type
raoulvdberge Sep 1, 2024
9406c87
chore: remove resource type help
raoulvdberge Sep 1, 2024
84e8407
feat: autocraftable hint now also checks patterns in inventory
raoulvdberge Sep 1, 2024
2c1a757
refactor: remove zeroed system for grid resources
raoulvdberge Sep 1, 2024
f4d8167
feat: make filter based on recipe items discoverable with help tooltip
raoulvdberge Sep 1, 2024
5684bb7
docs: update changelog
raoulvdberge Sep 1, 2024
314776e
chore: fix build problems
raoulvdberge Sep 1, 2024
25666be
Merge pull request #678 from refinedmods/feat/GH-612/pattern-registra…
raoulvdberge Sep 1, 2024
1de2aeb
feat: external storage gametest
starforcraft Aug 3, 2024
e689ccc
Merge pull request #640 from starforcraft/feat/GH-248/extstoragetests
raoulvdberge Sep 1, 2024
ae2412c
feat: detector gametest
starforcraft Sep 2, 2024
f05e10a
Merge pull request #679 from starforcraft/feat/GH-248/detectortests
raoulvdberge Sep 2, 2024
2c5c54b
refactor: make resource list interface immutable
raoulvdberge Sep 4, 2024
7ba8c51
Merge pull request #681 from refinedmods/refactor/NO-ISSUE/mutable-re…
raoulvdberge Sep 4, 2024
ac09e65
chore: upgrade refined architect
raoulvdberge Sep 9, 2024
ec92d2a
Merge pull request #683 from refinedmods/chore/NO-ISSUE/upgrade-archi…
raoulvdberge Sep 9, 2024
38a0983
chore: upgrade refined architect
raoulvdberge Sep 10, 2024
74b2ee2
Merge pull request #685 from refinedmods/build/NO-ISSUE/config-cache
raoulvdberge Sep 10, 2024
5342df8
feat: disk interface gametest
starforcraft Sep 7, 2024
4f0897c
Merge pull request #682 from starforcraft/feat/GH-248/diskinterfacetests
raoulvdberge Sep 10, 2024
29985c0
feat: interface gametest
starforcraft Sep 10, 2024
91a274f
Merge pull request #687 from starforcraft/feat/GH-248/interfacetests
raoulvdberge Sep 14, 2024
457afca
feat: crafting preview screen
raoulvdberge Sep 1, 2024
7d1b322
feat: crafting requests on the side of the preview
raoulvdberge Sep 5, 2024
673817f
feat: crafting preview on the server
raoulvdberge Oct 4, 2024
1b3a43e
feat: starting crafting tasks on the server
raoulvdberge Oct 4, 2024
fb0c927
feat: storage monitor autocrafting
raoulvdberge Oct 4, 2024
d35175f
Merge pull request #688 from refinedmods/feat/GH-98/crafting-preview
raoulvdberge Oct 4, 2024
2229ae9
chore: rename crafter to autocrafter
raoulvdberge Oct 4, 2024
4466b1a
Merge pull request #694 from refinedmods/chore/GH-98/autocrafter-rename
raoulvdberge Oct 4, 2024
f44c58d
feat: necessary code to support autocrafting from recipe mods
raoulvdberge Oct 5, 2024
3368659
feat: autocrafting support in the relay
raoulvdberge Oct 7, 2024
c99fd10
chore: cleanup recipe mod helper code
raoulvdberge Oct 10, 2024
30d00dc
refactor: dedicated package for fixtures
raoulvdberge Oct 10, 2024
51209f5
feat: additional energy usage for patterns in the autocrafter
raoulvdberge Oct 10, 2024
0b17850
Merge pull request #700 from refinedmods/feat/GH-98/relay-autocrafting
raoulvdberge Oct 11, 2024
4b2981b
fix: resources with changed data format or id causing load error
raoulvdberge Oct 11, 2024
4e5cd40
Merge pull request #701 from refinedmods/fix/GH-691/disk-corruption-safe
raoulvdberge Oct 11, 2024
f679bee
fix: crash when trying to export fluids on Fabric via external storage
raoulvdberge Oct 11, 2024
ff63e86
docs: remove mastodon link from readme
raoulvdberge Oct 11, 2024
e13a481
Merge pull request #702 from refinedmods/fix/GH-693/ext-storage-crash
raoulvdberge Oct 11, 2024
984bb6c
feat: regulator upgrade gametest
starforcraft Sep 14, 2024
f6bd683
Merge pull request #690 from starforcraft/feat/GH-248/regularupgradet…
raoulvdberge Oct 11, 2024
739252e
chore: update translation Russian from crowdin
raoulvdberge Oct 12, 2024
1703b59
chore: update translation French from crowdin
raoulvdberge Oct 12, 2024
61e5199
chore: update translation Spanish from crowdin
raoulvdberge Oct 12, 2024
e083580
chore: update translation Danish from crowdin
raoulvdberge Oct 12, 2024
cd2a6d6
chore: update translation German from crowdin
raoulvdberge Oct 12, 2024
d974027
chore: update translation Hungarian from crowdin
raoulvdberge Oct 12, 2024
715857e
chore: update translation Italian from crowdin
raoulvdberge Oct 12, 2024
f30d9ad
chore: update translation Japanese from crowdin
raoulvdberge Oct 12, 2024
3d79ee1
chore: update translation Korean from crowdin
raoulvdberge Oct 12, 2024
b35a849
chore: update translation Polish from crowdin
raoulvdberge Oct 12, 2024
aa3a86f
chore: update translation Swedish from crowdin
raoulvdberge Oct 12, 2024
553d088
chore: update translation Turkish from crowdin
raoulvdberge Oct 12, 2024
1d273b4
chore: update translation Chinese Simplified from crowdin
raoulvdberge Oct 12, 2024
efe4f9f
chore: update translation Chinese Traditional from crowdin
raoulvdberge Oct 12, 2024
e6f8ac8
chore: update translation Portuguese, Brazilian from crowdin
raoulvdberge Oct 12, 2024
b8631ff
chore: update translation Indonesian from crowdin
raoulvdberge Oct 12, 2024
5378895
chore: update translation Ukrainian from crowdin
raoulvdberge Oct 12, 2024
cb4d54a
Merge pull request #704 from refinedmods/crowdin-translations
raoulvdberge Oct 12, 2024
a2da917
fix: the configuration card is now stack sensitive
raoulvdberge Oct 12, 2024
eff65a8
feat: expose creative mode tab id
raoulvdberge Oct 12, 2024
65c6198
Merge pull request #705 from refinedmods/fix/GH-703/config-card-stack
raoulvdberge Oct 12, 2024
6080a41
chore: prepare release v2.0.0-milestone.4.8
raoulvdberge Oct 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 17 additions & 16 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,19 +265,20 @@ Refined Storage is split up into various modules. Most modules aren't dependent
the `refinedstorage-common`, `refinedstorage-neoforge` and `refinedstorage-fabric` modules have dependencies on
Minecraft.

| Name | Use in addons | Description |
|-------------------------------|---------------|----------------------------------------------------------------------------------------------------------|
| `refinedstorage-core-api` | ✔️ | Contains some utility classes and enums. |
| `refinedstorage-grid-api` | ✔️ | Contains Grid related functionality. |
| `refinedstorage-network-api` | ✔️ | Contains storage network related functionality. |
| `refinedstorage-network` | ❌ | Contains implementations of `refinedstorage-network-api`. |
| `refinedstorage-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. |
| `refinedstorage-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. |
| `refinedstorage-resource-api` | ✔️ | Contains API for handling resources. |
| `refinedstorage-storage-api` | ✔️ | Contains storage related functionality. |
| `refinedstorage-common-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. |
| `refinedstorage-common` | ❌ | Common mod code. Most gameplay code is in here. |
| `refinedstorage-fabric-api` | ✔️ | Additional API for the Fabric platform. |
| `refinedstorage-fabric` | ❌ | The platform module for Fabric. This module contains Fabric specific code. |
| `refinedstorage-neoforge-api` | ✔️ | Additional API for the NeoForge platform. |
| `refinedstorage-neoforge` | ❌ | The platform module for NeoForge. This module contains NeoForge specific code and the integration tests. |
| Name | Use in addons | Description |
|-----------------------------------|---------------|----------------------------------------------------------------------------------------------------------|
| `refinedstorage-core-api` | ✔️ | Contains some utility classes and enums. |
| `refinedstorage-grid-api` | ✔️ | Contains Grid related functionality. |
| `refinedstorage-autocrafting-api` | ✔️ | Contains autocrafting related functionality. |
| `refinedstorage-network-api` | ✔️ | Contains storage network related functionality. |
| `refinedstorage-network` | ❌ | Contains implementations of `refinedstorage-network-api`. |
| `refinedstorage-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. |
| `refinedstorage-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. |
| `refinedstorage-resource-api` | ✔️ | Contains API for handling resources. |
| `refinedstorage-storage-api` | ✔️ | Contains storage related functionality. |
| `refinedstorage-common-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. |
| `refinedstorage-common` | ❌ | Common mod code. Most gameplay code is in here. |
| `refinedstorage-fabric-api` | ✔️ | Additional API for the Fabric platform. |
| `refinedstorage-fabric` | ❌ | The platform module for Fabric. This module contains Fabric specific code. |
| `refinedstorage-neoforge-api` | ✔️ | Additional API for the NeoForge platform. |
| `refinedstorage-neoforge` | ❌ | The platform module for NeoForge. This module contains NeoForge specific code and the integration tests. |
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [ opened, synchronize, reopened ]
jobs:
build:
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.17.1
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.19.1
with:
gametests: true
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: string
jobs:
draft:
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.17.1
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.19.1
with:
release-type: ${{ inputs.release-type }}
version-number-override: ${{ inputs.version-number-override }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-for-unsupported-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
types: [ labeled, unlabeled, reopened ]
jobs:
unsupported-labeler:
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.17.1
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.19.1
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- closed
jobs:
publish-release:
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.17.1
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.19.1
secrets: inherit
with:
project-name: 'Refined Storage'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/resolved-issue-locking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
- cron: '0 0 * * 1'
jobs:
lock:
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.17.1
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.19.1
2 changes: 1 addition & 1 deletion .github/workflows/validate-branch-name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate branch name
on: [ pull_request ]
jobs:
validate-branch-name:
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.17.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.19.1
2 changes: 1 addition & 1 deletion .github/workflows/validate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ]
jobs:
validate-changelog:
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.17.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.19.1
2 changes: 1 addition & 1 deletion .github/workflows/validate-commit-messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate commit messages
on: [ pull_request ]
jobs:
validate-commit-messages:
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.17.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.19.1
3 changes: 3 additions & 0 deletions .idea/dictionaries/refinedstorage.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 41 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,44 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [2.0.0-milestone.4.8] - 2024-10-12

### Added

- Autocrafter
- The Relay now has support for propagating autocrafting when not in pass-through mode.

### Changed

- 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.
- Changed "Crafter mode" to "Locking mode" with following options:
- Never
- Lock until redstone pulse is received
- Lock until connected machine is empty (new, facilitates easier "blocking mode" without redstone)
- Lock until all outputs are received (new, facilitates easier "blocking mode" without redstone)
- Lock until low redstone signal
- Lock until high redstone signal
- Resources in the Grid that are autocraftable now display an orange backdrop and tooltip to indicate whether the resource is autocraftable at a glance.
- Slots used in the Pattern Grid for pattern encoding and Crafting Grid crafting matrix slots now display an orange backdrop and tooltip to indicate whether the item is autocraftable at a glance. This checks patterns from your network and from your inventory.
- Added help tooltip for filtering based on recipe items in the Crafting Grid.
- The crafting amount and crafting preview screens have been merged. Changing the amount will update the live preview.
- 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

- Fixed mouse keybindings not working on NeoForge.
- Fixed upgrade destinations not being shown on upgrades.
- Fixed resources with changed data format or ID causing entire storage to fail to load.
- Fixed crash when trying to export fluids from an External Storage on Fabric.
- The Configuration Card can now also transfer the (configured) Regulator Upgrade.

## [2.0.0-milestone.4.7] - 2024-08-11

### Added
Expand Down Expand Up @@ -737,7 +775,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.7...HEAD
[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.8...HEAD

[2.0.0-milestone.4.8]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.7...v2.0.0-milestone.4.8

[2.0.0-milestone.4.7]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.6...v2.0.0-milestone.4.7

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ this mod that allow the player to set up auto-crafting, allowing the crafting of
- [Javadoc](https://refinedmods.com/javadoc/refinedstorage2)
- [Discord](https://discordapp.com/invite/VYzsydb)
- [Twitter](https://twitter.com/refinedmods)
- [Mastodon](https://anvil.social/@refinedmods)

## Building

Expand Down
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ project.extensions.getByType<SonarExtension>().apply {
)
}
}

allprojects {
apply(plugin = "publishing")
publishing {
repositories {
mavenLocal()
}
}
}
6 changes: 4 additions & 2 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="FileLength">
<property name="max" value="750"/>
<property name="max" value="800"/>
</module>
<module name="NewlineAtEndOfFile"/>
<module name="JavadocPackage"/>
Expand Down Expand Up @@ -109,7 +109,9 @@
<module name="MethodCount"/>
<module name="MethodLength"/>
<module name="OuterTypeNumber"/>
<module name="RecordComponentNumber"/>
<module name="RecordComponentNumber">
<property name="max" value="20"/>
</module>
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="NoWhitespaceAfter"/>
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
refinedarchitectVersion=0.17.1
refinedarchitectVersion=0.19.1
# Gradle
org.gradle.jvmargs=-Xmx1G
org.gradle.configureondemand=true
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
31 changes: 31 additions & 0 deletions refinedstorage-autocrafting-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
plugins {
id("refinedarchitect.base")
}

refinedarchitect {
testing()
mutationTesting()
javadoc()
publishing {
maven = true
}
}

base {
archivesName.set("refinedstorage-autocrafting-api")
}

dependencies {
api(libs.apiguardian)
api(project(":refinedstorage-resource-api"))
api(project(":refinedstorage-core-api"))
api(project(":refinedstorage-storage-api"))
api(project(":refinedstorage-query-parser"))
implementation(libs.slf4j.api)
testImplementation(libs.junit.api)
testImplementation(libs.junit.params)
testImplementation(libs.assertj)
testImplementation(libs.mockito)
testRuntimeOnly(libs.junit.engine)
testRuntimeOnly(libs.slf4j.impl)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.refinedmods.refinedstorage.api.autocrafting;

import java.util.List;

public record AutocraftingPreview(AutocraftingPreviewType type, List<AutocraftingPreviewItem> items) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.refinedmods.refinedstorage.api.autocrafting;

import com.refinedmods.refinedstorage.api.resource.ResourceKey;

public record AutocraftingPreviewItem(ResourceKey resource, long available, long missing, long toCraft) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.refinedmods.refinedstorage.api.autocrafting;

import com.refinedmods.refinedstorage.api.resource.ResourceKey;

import java.util.Optional;

public interface AutocraftingPreviewProvider {
Optional<AutocraftingPreview> getPreview(ResourceKey resource, long amount);

boolean startTask(ResourceKey resource, long amount);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.refinedmods.refinedstorage.api.autocrafting;

public enum AutocraftingPreviewType {
SUCCESS,
MISSING_RESOURCES
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.refinedmods.refinedstorage.api.autocrafting;

import com.refinedmods.refinedstorage.api.resource.ResourceKey;

import java.util.Set;

import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.6")
public interface Pattern {
Set<ResourceKey> getOutputResources();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.refinedmods.refinedstorage.api.autocrafting;

import com.refinedmods.refinedstorage.api.resource.ResourceKey;

import java.util.Set;

import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.8")
public interface PatternRepository {
void add(Pattern pattern);

void remove(Pattern pattern);

Set<ResourceKey> getOutputs();

Set<Pattern> getAll();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.refinedmods.refinedstorage.api.autocrafting;

import com.refinedmods.refinedstorage.api.resource.ResourceKey;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class PatternRepositoryImpl implements PatternRepository {
private final Set<Pattern> patterns = new HashSet<>();
private final Set<Pattern> patternsView = Collections.unmodifiableSet(patterns);
private final Set<ResourceKey> outputs = new HashSet<>();

@Override
public void add(final Pattern pattern) {
patterns.add(pattern);
outputs.addAll(pattern.getOutputResources());
}

@Override
public void remove(final Pattern pattern) {
patterns.remove(pattern);
for (final ResourceKey output : pattern.getOutputResources()) {
final boolean noOtherPatternHasThisOutput = patterns.stream()
.noneMatch(otherPattern -> otherPattern.getOutputResources().contains(output));
if (noOtherPatternHasThisOutput) {
outputs.remove(output);
}
}
}

@Override
public Set<ResourceKey> getOutputs() {
return outputs;
}

@Override
public Set<Pattern> getAll() {
return patternsView;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@ParametersAreNonnullByDefault
@FieldsAndMethodsAreNonnullByDefault
package com.refinedmods.refinedstorage.network.test.fake;
package com.refinedmods.refinedstorage.api.autocrafting;

import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;

Expand Down
Loading
Loading