Skip to content

Commit

Permalink
Merge pull request #405 from refinedmods/release/2.0.0-milestone.2.12
Browse files Browse the repository at this point in the history
Release v2.0.0-milestone.2.12
  • Loading branch information
raoulvdberge authored Aug 6, 2023
2 parents 7616929 + e1ff3a1 commit 8cba3b3
Show file tree
Hide file tree
Showing 623 changed files with 11,375 additions and 3,874 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.5.5
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.7.1
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.5.5
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.7.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.5.5
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.7.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.5.5
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.7.1
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.5.5
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.7.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.5.5
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.7.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.5.5
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.7.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.5.5
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.7.1
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,36 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [2.0.0-milestone.2.12] - 2023-08-06

### Added

- Constructor
- Regulator Upgrade
- Filter slot hints that show which resource will be put in a filter slot and what the effect of the filter is on the device.
- Grid slot hints that show which resource will be inserted or extracted in a Grid.
- Help information to the side buttons by pressing SHIFT.
- Help information on items.
- A warning to the "filter mode" button on the storage screens if there is an allowlist with no configured filters.
- The "supported by" tooltip on upgrade items now shows the devices that accept the upgrade.

### Changed

- The Constructor crafting recipe now takes 2 diamonds instead of 2 redstone.
- You can now select a "Scheduling mode" in the Constructor: first available, round robin, random.
- The "applicable upgrades" tooltip on the upgrade slot tooltip now shows the upgrade items in item form.
- The Regulator Upgrade now works in an Importer as well. It will only keep importing until the configured amount is reached.
- The Regulator Upgrade now needs to be configured separately, by using the upgrade. It can no longer be configured in the device GUI itself.

### Fixed

- Fixed Grid voiding fluids if there was no space in inventory on Fabric.
- Fixed Grid dropping fluid buckets if there was no space in inventory on Forge.
- Fixed compatibility with custom tooltips in the Grid.
- Fixed bundle tooltip in the Grid.
- Fixed changes to access mode or fuzzy mode not being persisted.
- Fixed being able to put any item in the upgrade slots.

## [2.0.0-milestone.2.11] - 2023-07-04

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p>Refined Storage is a mass storage mod for Minecraft that offers the player a network-based storage system, allowing
them to store items and fluids on a massively expandable device network.</p>

[![Build Status](https://github.com/refinedmods/refinedstorage2/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/refinedmods/refinedstorage2/actions/workflows/build.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=coverage)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Downloads on CurseForge](http://cf.way2muchnoise.eu/full_243076_downloads.svg)](http://minecraft.curseforge.com/projects/refined-storage) [![Discord](https://img.shields.io/discord/342942776494653441)](https://discordapp.com/invite/VYzsydb) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md)
[![Build Status](https://github.com/refinedmods/refinedstorage2/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/refinedmods/refinedstorage2/actions/workflows/build.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=coverage)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=refinedmods_refinedstorage2&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=refinedmods_refinedstorage2) [![Downloads on CurseForge](http://cf.way2muchnoise.eu/full_243076_downloads.svg)](http://minecraft.curseforge.com/projects/refined-storage) [![Downloads on Modrinth](https://img.shields.io/modrinth/dt/refined-storage?logo=modrinth)](https://modrinth.com/mod/refined-storage) [![Discord](https://img.shields.io/discord/342942776494653441)](https://discordapp.com/invite/VYzsydb) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md)
</div>

## About
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void extract(final T resource, final GridExtractMode extractMode, final I
if (amount == 0) {
return;
}
TransferHelper.transfer(resource, amount, actor, storageChannel, destination, null);
TransferHelper.transfer(resource, amount, actor, storageChannel, destination, storageChannel);
}

private long getExtractableAmount(final T resource, final GridExtractMode extractMode) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.refinedmods.refinedstorage2.api.network.node.exporter.strategy;
package com.refinedmods.refinedstorage2.api.network.node.exporter;

import com.refinedmods.refinedstorage2.api.network.Network;
import com.refinedmods.refinedstorage2.api.storage.Actor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@ParametersAreNonnullByDefault
@FieldsAndMethodsAreNonnullByDefault
package com.refinedmods.refinedstorage2.api.network.node.exporter.strategy;
package com.refinedmods.refinedstorage2.api.network.node.exporter;

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

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.refinedmods.refinedstorage2.api.network.node.task;

import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.11")
@FunctionalInterface
public interface Task<C> {
boolean run(C context);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.refinedmods.refinedstorage2.api.network.node.task;

import java.util.List;

import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.11")
@FunctionalInterface
public interface TaskExecutor<C> {
void execute(List<? extends Task<C>> tasks, C context);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@ParametersAreNonnullByDefault
@FieldsAndMethodsAreNonnullByDefault
package com.refinedmods.refinedstorage2.api.network.node.exporter.scheduling;
package com.refinedmods.refinedstorage2.api.network.node.task;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.refinedmods.refinedstorage2.api.network.impl.node.exporter.strategy;
package com.refinedmods.refinedstorage2.api.network.impl.node.exporter;

import com.refinedmods.refinedstorage2.api.network.Network;
import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent;
import com.refinedmods.refinedstorage2.api.network.node.exporter.strategy.ExporterTransferStrategy;
import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy;
import com.refinedmods.refinedstorage2.api.storage.Actor;
import com.refinedmods.refinedstorage2.api.storage.InsertableStorage;
import com.refinedmods.refinedstorage2.api.storage.TransferHelper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.refinedmods.refinedstorage2.api.network.impl.node.exporter.strategy;
package com.refinedmods.refinedstorage2.api.network.impl.node.exporter;

import com.refinedmods.refinedstorage2.api.network.Network;
import com.refinedmods.refinedstorage2.api.network.node.exporter.strategy.ExporterTransferStrategy;
import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy;
import com.refinedmods.refinedstorage2.api.storage.Actor;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.refinedmods.refinedstorage2.api.network.impl.node.exporter;

import com.refinedmods.refinedstorage2.api.network.Network;
import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode;
import com.refinedmods.refinedstorage2.api.network.node.NetworkNodeActor;
import com.refinedmods.refinedstorage2.api.network.node.exporter.scheduling.ExporterSchedulingMode;
import com.refinedmods.refinedstorage2.api.network.node.exporter.strategy.ExporterTransferStrategy;
import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy;
import com.refinedmods.refinedstorage2.api.network.node.task.Task;
import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor;
import com.refinedmods.refinedstorage2.api.storage.Actor;

import java.util.ArrayList;
Expand All @@ -13,11 +15,11 @@
public class ExporterNetworkNode extends AbstractNetworkNode {
private long energyUsage;
private final Actor actor = new NetworkNodeActor(this);
private final List<Object> templates = new ArrayList<>();
private final List<TaskImpl> tasks = new ArrayList<>();
@Nullable
private ExporterTransferStrategy transferStrategy;
@Nullable
private ExporterSchedulingMode schedulingMode;
private TaskExecutor<TaskContext> taskExecutor;

public ExporterNetworkNode(final long energyUsage) {
this.energyUsage = energyUsage;
Expand All @@ -27,22 +29,23 @@ public void setTransferStrategy(@Nullable final ExporterTransferStrategy transfe
this.transferStrategy = transferStrategy;
}

public void setSchedulingMode(@Nullable final ExporterSchedulingMode schedulingMode) {
this.schedulingMode = schedulingMode;
public void setTaskExecutor(@Nullable final TaskExecutor<TaskContext> taskExecutor) {
this.taskExecutor = taskExecutor;
}

@Override
public void doWork() {
super.doWork();
if (network == null || !isActive() || transferStrategy == null || schedulingMode == null) {
if (network == null || !isActive() || taskExecutor == null) {
return;
}
schedulingMode.execute(templates, transferStrategy, network, actor);
final TaskContext context = new TaskContext(network, actor);
taskExecutor.execute(tasks, context);
}

public void setFilterTemplates(final List<Object> newTemplates) {
templates.clear();
templates.addAll(newTemplates);
public void setFilterTemplates(final List<Object> templates) {
tasks.clear();
tasks.addAll(templates.stream().map(TaskImpl::new).toList());
}

public void setEnergyUsage(final long energyUsage) {
Expand All @@ -53,4 +56,23 @@ public void setEnergyUsage(final long energyUsage) {
public long getEnergyUsage() {
return energyUsage;
}

public record TaskContext(Network network, Actor actor) {
}

class TaskImpl implements Task<TaskContext> {
private final Object template;

TaskImpl(final Object template) {
this.template = template;
}

@Override
public boolean run(final TaskContext context) {
if (transferStrategy == null) {
return false;
}
return transferStrategy.transfer(template, context.actor, context.network);
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8cba3b3

Please sign in to comment.