Skip to content

Commit

Permalink
Merge pull request #428 from refinedmods/release/2.0.0-milestone.3.0
Browse files Browse the repository at this point in the history
Release v2.0.0-milestone.3.0
  • Loading branch information
raoulvdberge authored Aug 27, 2023
2 parents 18b19d0 + e677752 commit 7adc997
Show file tree
Hide file tree
Showing 317 changed files with 6,128 additions and 932 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ on:
types: [ opened, synchronize, reopened ]
jobs:
build:
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.8.2
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.7.1
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.8.2
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.7.1
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.8.2
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.7.1
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.8.2
secrets: inherit
with:
project-name: 'Refined Storage'
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 * * *'
jobs:
lock:
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.8.2
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.7.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.8.2
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.7.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.8.2
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.7.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.8.2
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [2.0.0-milestone.3.0] - 2023-08-27

### Added

- Wireless Grid
- Creative Wireless Grid
- Wireless Transmitter
- Range Upgrade
- Creative Range Upgrade
- Fully charged Controller variants to the creative mode tab.

### Changed

- The Forge variant now targets NeoForge instead of Forge.
- You can now always open the Wireless Grid, even if there is no network bound or if the Wireless Grid is out of
energy.

### Fixed

- Fixed inactive Grid slots still rendering resources.
- Fixed being able to interact with inactive Grid.
- Fixed nearly on/off Controller model not being rendered correctly on Forge.
- Fixed Controller energy tooltip not working.

## [2.0.0-milestone.2.14] - 2023-08-19

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions config/checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<suppressions>
<!-- Test directories don't need a package-info.java file -->
<suppress checks="JavadocPackage" files="test[\\/].*.java"/>
<!-- Mod initializer can be longer due to initialization logic -->
<suppress checks="FileLength" files="ModInitializer.*.java"/>
<!-- Mod initializer can be longer due to initialization logic, config can be long too -->
<suppress checks="FileLength" files="(ModInitializer.*\.java|ConfigImpl\.java)"/>
<!-- Shadow target contains underscore -->
<suppress checks="MemberName" files="ModelBakerImplMixin.java"/>
<suppress checks="HideUtilityClassConstructor" files="GridClearPacket.java"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.refinedmods.refinedstorage2.api.grid.service;
package com.refinedmods.refinedstorage2.api.grid.operations;

import org.apiguardian.api.API;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.refinedmods.refinedstorage2.api.grid.service;
package com.refinedmods.refinedstorage2.api.grid.operations;

import org.apiguardian.api.API;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.refinedmods.refinedstorage2.api.grid.service;
package com.refinedmods.refinedstorage2.api.grid.operations;

import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage;
import com.refinedmods.refinedstorage2.api.storage.InsertableStorage;

import org.apiguardian.api.API;

/**
* The grid service is the service that the grid uses to interact with the storage network.
* Grid operations, used for grids to interact with the storage network.
*
* @param <T> the resource type
*/
@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.2")
public interface GridService<T> {
public interface GridOperations<T> {
/**
* Tries to move a resource from the network storage to the destination.
* The amount being extracted depends on the extraction mode.
Expand All @@ -20,7 +20,7 @@ public interface GridService<T> {
* @param extractMode the extract mode
* @param destination the destination
*/
void extract(T resource, GridExtractMode extractMode, InsertableStorage<T> destination);
boolean extract(T resource, GridExtractMode extractMode, InsertableStorage<T> destination);

/**
* Tries to move a resource from the source to the network storage.
Expand All @@ -30,5 +30,5 @@ public interface GridService<T> {
* @param insertMode the insertion mode
* @param source the source
*/
void insert(T resource, GridInsertMode insertMode, ExtractableStorage<T> source);
boolean insert(T resource, GridInsertMode insertMode, ExtractableStorage<T> source);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.refinedmods.refinedstorage2.api.grid.service;
package com.refinedmods.refinedstorage2.api.grid.operations;

import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage2.api.storage.Actor;
Expand All @@ -12,36 +12,37 @@
import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.2")
public class GridServiceImpl<T> implements GridService<T> {
public class GridOperationsImpl<T> implements GridOperations<T> {
private final StorageChannel<T> storageChannel;
private final Actor actor;
private final ToLongFunction<T> maxAmountProvider;
private final long singleAmount;

/**
* @param storageChannel the storage channel to act on
* @param actor the actor performing the grid interactions
* @param actor the actor performing the grid operations
* @param maxAmountProvider provider for the maximum amount of a given resource
* @param singleAmount amount that needs to be extracted when using
* {@link GridInsertMode#SINGLE_RESOURCE} or {@link GridExtractMode#SINGLE_RESOURCE}
*/
public GridServiceImpl(final StorageChannel<T> storageChannel,
final Actor actor,
final ToLongFunction<T> maxAmountProvider,
final long singleAmount) {
public GridOperationsImpl(final StorageChannel<T> storageChannel,
final Actor actor,
final ToLongFunction<T> maxAmountProvider,
final long singleAmount) {
this.storageChannel = storageChannel;
this.actor = actor;
this.maxAmountProvider = maxAmountProvider;
this.singleAmount = singleAmount;
}

@Override
public void extract(final T resource, final GridExtractMode extractMode, final InsertableStorage<T> destination) {
public boolean extract(final T resource, final GridExtractMode extractMode,
final InsertableStorage<T> destination) {
final long amount = getExtractableAmount(resource, extractMode);
if (amount == 0) {
return;
return false;
}
TransferHelper.transfer(resource, amount, actor, storageChannel, destination, storageChannel);
return TransferHelper.transfer(resource, amount, actor, storageChannel, destination, storageChannel) > 0;
}

private long getExtractableAmount(final T resource, final GridExtractMode extractMode) {
Expand All @@ -65,11 +66,11 @@ private long adjustExtractableAmountAccordingToExtractMode(final GridExtractMode
}

@Override
public void insert(final T resource, final GridInsertMode insertMode, final ExtractableStorage<T> source) {
public boolean insert(final T resource, final GridInsertMode insertMode, final ExtractableStorage<T> source) {
final long amount = switch (insertMode) {
case ENTIRE_RESOURCE -> maxAmountProvider.applyAsLong(resource);
case SINGLE_RESOURCE -> singleAmount;
};
TransferHelper.transfer(resource, amount, actor, source, storageChannel, null);
return TransferHelper.transfer(resource, amount, actor, source, storageChannel, null) > 0;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@ParametersAreNonnullByDefault
@FieldsAndMethodsAreNonnullByDefault
package com.refinedmods.refinedstorage2.api.grid.service;
package com.refinedmods.refinedstorage2.api.grid.operations;

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

Expand Down

This file was deleted.

Loading

0 comments on commit 7adc997

Please sign in to comment.