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.3.4 #495

Merged
merged 36 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a7b97e4
Merge pull request #476 from refinedmods/main
raoulvdberge Feb 17, 2024
a1cc6d2
fix: losing disk when using wrench dismantling on the portable grid
raoulvdberge Feb 18, 2024
3c6874b
fix: losing energy when using wrench dismantling
raoulvdberge Feb 19, 2024
c4c807a
refactor: use energy proxy for block entity change detection
raoulvdberge Feb 19, 2024
8360d8a
Merge pull request #478 from refinedmods/fix/GH-477/wrenching
raoulvdberge Feb 19, 2024
d1402fd
refactor: introduce listening energy storage
raoulvdberge Feb 19, 2024
bdbbc6c
Merge pull request #479 from refinedmods/fix/GH-477/wrenching-other
raoulvdberge Feb 19, 2024
23f9170
fix: changing side buttons doesn't work on Forge
raoulvdberge Mar 9, 2024
aacba0b
Merge pull request #485 from refinedmods/fix/GH-484/sidebuttons
raoulvdberge Mar 9, 2024
5ff90cf
refactor: remove generics for ResourceList and Storage
raoulvdberge Mar 3, 2024
b8844ec
refactor: remove StorageChannel segregation per type
raoulvdberge Mar 9, 2024
1fd63d1
Merge pull request #483 from refinedmods/refactor/GH-482/generics
raoulvdberge Mar 9, 2024
c63a5a1
chore: remove wildcard generics
raoulvdberge Mar 10, 2024
1d22f42
chore: remove duplication for string constants
raoulvdberge Mar 10, 2024
ce827d0
chore: remove usage of RuntimeException
raoulvdberge Mar 10, 2024
8a47e57
chore: menu type in container menus is nullable
raoulvdberge Mar 10, 2024
7b2d3d5
chore: remove deprecations
raoulvdberge Mar 10, 2024
7251c0d
docs: javadoc link
raoulvdberge Mar 10, 2024
f07c45c
Merge pull request #486 from refinedmods/chore/GH-482/sonarfixes
raoulvdberge Mar 10, 2024
20bf875
feat: void excess mode
raoulvdberge Feb 18, 2024
303cb25
Merge pull request #490 from refinedmods/feat/GH-120/void-excess
raoulvdberge Mar 10, 2024
720ec86
refactor: move ResourceListOperationResult to ResourceList
raoulvdberge Mar 10, 2024
67db6d3
docs: note reference passing of ResourceAmount in GridResourceFactory
raoulvdberge Mar 10, 2024
109e637
fix: possible CME in GridView
raoulvdberge Mar 10, 2024
21f3435
refactor: move ResourceContainerType to slot
raoulvdberge Mar 10, 2024
7a185eb
docs: missing changelog entry from 20bf875d
raoulvdberge Mar 10, 2024
092047f
fix: incrementing starting from 1 in amount screens not having an int…
raoulvdberge Mar 10, 2024
b8a0f04
chore: forgotten rename
raoulvdberge Mar 11, 2024
e58e472
Merge pull request #491 from refinedmods/fix/GH-480/cme
raoulvdberge Mar 11, 2024
cdbf4d1
fix: problems moving network devices with Carry On mod
raoulvdberge Mar 11, 2024
971b44e
Merge pull request #492 from refinedmods/fix/GH-456/carryon
raoulvdberge Mar 11, 2024
4d9a264
refactor: test hardening
raoulvdberge Mar 14, 2024
9ffd4e4
Merge pull request #493 from refinedmods/fix/GH-456/testhardening
raoulvdberge Mar 14, 2024
cf9fedb
fix: escape key not working on auto-selected grid search box
raoulvdberge Mar 14, 2024
d9ceb8b
Merge pull request #494 from refinedmods/fix/GH-455/searchbox
raoulvdberge Mar 14, 2024
0a59360
chore: prepare release v2.0.0-milestone.3.4
raoulvdberge Mar 16, 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
  •  
  •  
  •  
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [2.0.0-milestone.3.4] - 2024-03-16

### Added

- Void excess mode to storages.

### Fixed

- Fixed losing disk when using Wrench dismantling on the Portable Grid.
- Fixed losing energy when using Wrench dismantling on the Portable Grid and the Controller.
- Fixed changing side buttons not working on Forge.
- Fixed External Storage not displaying empty allowlist warning.
- Fixed incrementing starting from 1 in amount screens not having an intended off-by-one.
- Fixed problems moving network devices with "Carry On" mod.
- Fixed escape key not working on auto-selected Grid search box.

## [2.0.0-milestone.3.3] - 2024-02-17

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

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

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

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ this mod that allow the player to setup auto-crafting, allowing the crafting of
- [Roadmap](https://github.com/refinedmods/refinedstorage2/projects)
- [Wiki](https://github.com/refinedmods/refinedstorage2/wiki)
- [Refined Mods on GitHub](https://github.com/refinedmods)
- [Javadoc](https://refinedmods.com/javadoc/refinedstorage2)
- [Discord](https://discordapp.com/invite/VYzsydb)
- [Twitter](https://twitter.com/refinedmods)
- [Mastodon](https://anvil.social/@refinedmods)
Expand Down
15 changes: 7 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ subprojects {

ext {
apis = [
':refinedstorage2-core-api',
':refinedstorage2-resource-api',
':refinedstorage2-storage-api',
':refinedstorage2-network-api',
':refinedstorage2-network',
':refinedstorage2-grid-api',
':refinedstorage2-query-parser'
':refinedstorage2-core-api',
':refinedstorage2-resource-api',
':refinedstorage2-storage-api',
':refinedstorage2-network-api',
':refinedstorage2-network',
':refinedstorage2-grid-api',
':refinedstorage2-query-parser'
]
compileApis = [':refinedstorage2-platform-api']
}
Expand All @@ -22,7 +22,6 @@ enableSonarQube("refinedmods_refinedstorage2")
sonarqube {
properties {
property "sonar.coverage.exclusions", "refinedstorage2-platform-forge/**/*,refinedstorage2-platform-fabric/**/*,refinedstorage2-platform-common/**/*,refinedstorage2-platform-api/**/*"
// TODO: REI code is duplicated as reusing it in a common module isn't possible/too difficult. Fix this.
property "sonar.cpd.exclusions", "refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/*,refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/*"
}
}

This file was deleted.

This file was deleted.

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

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

import org.apiguardian.api.API;

/**
* 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 GridOperations<T> {
public interface GridOperations {
/**
* 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 +19,7 @@ public interface GridOperations<T> {
* @param extractMode the extract mode
* @param destination the destination
*/
boolean extract(T resource, GridExtractMode extractMode, InsertableStorage<T> destination);
boolean extract(ResourceKey resource, GridExtractMode extractMode, InsertableStorage destination);

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

import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
import com.refinedmods.refinedstorage2.api.storage.Actor;
import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage;
import com.refinedmods.refinedstorage2.api.storage.InsertableStorage;
Expand All @@ -12,10 +13,10 @@
import org.apiguardian.api.API;

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

/**
Expand All @@ -25,9 +26,9 @@ public class GridOperationsImpl<T> implements GridOperations<T> {
* @param singleAmount amount that needs to be extracted when using
* {@link GridInsertMode#SINGLE_RESOURCE} or {@link GridExtractMode#SINGLE_RESOURCE}
*/
public GridOperationsImpl(final StorageChannel<T> storageChannel,
public GridOperationsImpl(final StorageChannel storageChannel,
final Actor actor,
final ToLongFunction<T> maxAmountProvider,
final ToLongFunction<ResourceKey> maxAmountProvider,
final long singleAmount) {
this.storageChannel = storageChannel;
this.actor = actor;
Expand All @@ -36,22 +37,22 @@ public GridOperationsImpl(final StorageChannel<T> storageChannel,
}

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

private long getExtractableAmount(final T resource, final GridExtractMode extractMode) {
private long getExtractableAmount(final ResourceKey resource, final GridExtractMode extractMode) {
final long extractableAmount = getExtractableAmount(resource);
return adjustExtractableAmountAccordingToExtractMode(extractMode, extractableAmount);
}

private long getExtractableAmount(final T resource) {
private long getExtractableAmount(final ResourceKey resource) {
final long totalSize = storageChannel.get(resource).map(ResourceAmount::getAmount).orElse(0L);
final long maxAmount = maxAmountProvider.applyAsLong(resource);
return Math.min(totalSize, maxAmount);
Expand All @@ -67,7 +68,9 @@ private long adjustExtractableAmountAccordingToExtractMode(final GridExtractMode
}

@Override
public boolean insert(final T resource, final GridInsertMode insertMode, final ExtractableStorage<T> source) {
public boolean insert(final ResourceKey resource,
final GridInsertMode insertMode,
final ExtractableStorage source) {
final long amount = switch (insertMode) {
case ENTIRE_RESOURCE -> maxAmountProvider.applyAsLong(resource);
case SINGLE_RESOURCE -> singleAmount;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
package com.refinedmods.refinedstorage2.api.grid.operations;

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

public class NoopGridOperations<T> implements GridOperations<T> {
public class NoopGridOperations implements GridOperations {
@Override
public boolean extract(final T resource,
public boolean extract(final ResourceKey resource,
final GridExtractMode extractMode,
final InsertableStorage<T> destination) {
final InsertableStorage destination) {
return false;
}

@Override
public boolean insert(final T resource,
public boolean insert(final ResourceKey resource,
final GridInsertMode insertMode,
final ExtractableStorage<T> source) {
final ExtractableStorage source) {
return false;
}
}
Loading
Loading