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.6 #652

Merged
merged 46 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ba0ab59
Merge pull request #635 from refinedmods/main
raoulvdberge Jul 26, 2024
f93cfa5
feat: pattern grid and pattern
raoulvdberge Jul 26, 2024
1d518e4
fix: remove progress bar from widgets.png
raoulvdberge Jul 29, 2024
5bc6512
fix: remove scrollbar from widgets.png
raoulvdberge Jul 29, 2024
32ff668
fix: remove side buttons from icons.png
raoulvdberge Jul 29, 2024
0122243
fix: remove light arrow from icons.png
raoulvdberge Jul 29, 2024
2763dc4
fix: remove warning icon from icons.png
raoulvdberge Jul 29, 2024
066851b
fix: remove help icon from icons.png
raoulvdberge Jul 29, 2024
6ef5eeb
fix: remove mouse buttons from icons.png
raoulvdberge Jul 29, 2024
55f3d39
chore: remove guide book texture
raoulvdberge Jul 29, 2024
770afb2
chore: rename icons.png to side_button_icons.png
raoulvdberge Jul 29, 2024
d4dfcb2
fix: incorrect and outdated explanations for fuzzy mode
raoulvdberge Jul 29, 2024
81e91ac
chore: fix sonar issues
raoulvdberge Jul 29, 2024
112ec9f
Merge pull request #636 from refinedmods/feat/GH-104/pattern-grid
raoulvdberge Jul 29, 2024
052637c
feat: silk touch upgrade gametest setup
starforcraft Jul 31, 2024
6334023
Merge pull request #638 from starforcraft/feat/GH-248/silktouchtests
raoulvdberge Jul 31, 2024
ff8bdd9
feat: processing pattern encoding
raoulvdberge Jul 29, 2024
48a5784
Merge pull request #639 from refinedmods/feat/GH-104/processing-patterns
raoulvdberge Aug 1, 2024
b9f384b
refactor: grid resources no longer store amount
raoulvdberge Aug 3, 2024
890903b
refactor: fuzzy resource list no longer stores ResourceAmount references
raoulvdberge Aug 3, 2024
b21b7cd
feat: add ability to retrieve amount of a resource
raoulvdberge Aug 3, 2024
db62e7b
refactor: add ability to check if a resource exists in storage
raoulvdberge Aug 3, 2024
47549ab
feat: add ability to retrieve unique resources within a ResourceList
raoulvdberge Aug 3, 2024
9380e40
feat: add ability to copy resource list
raoulvdberge Aug 3, 2024
cfa6ea2
refactor: rename #getAll to #copyState
raoulvdberge Aug 3, 2024
5bb69a4
refactor: use internal entry representation in ResourceList
raoulvdberge Aug 3, 2024
a8adc84
refactor: make ResourceAmount an immutable record
raoulvdberge Aug 3, 2024
e05b665
Merge pull request #641 from refinedmods/refactor/NO-ISSUE/immutable-…
raoulvdberge Aug 3, 2024
02381bf
chore: minor cleanup
raoulvdberge Aug 3, 2024
0d5b1c3
feat: alternatives screen for processing patterns
raoulvdberge Aug 3, 2024
fbb2157
feat: encode alternatives in processing pattern
raoulvdberge Aug 5, 2024
2d44d1e
Merge pull request #643 from refinedmods/feat/GH-104/alternatives
raoulvdberge Aug 6, 2024
8b824fd
feat: stonecutter pattern encoding
raoulvdberge Aug 6, 2024
a4bd22d
Merge pull request #648 from refinedmods/feat/GH-104/stonecutter-patt…
raoulvdberge Aug 6, 2024
4aee1da
feat: smithing table pattern encoding
raoulvdberge Aug 6, 2024
dfc2675
refactor: move pattern grid rendering per type to different classes
raoulvdberge Aug 6, 2024
fca1612
Merge pull request #649 from refinedmods/feat/GH-104/smithing-table
raoulvdberge Aug 7, 2024
fb4bde7
feat: recipe mod transfer support for pattern grid
raoulvdberge Aug 7, 2024
3efbdb6
feat: filter slot change support for recipe mods
raoulvdberge Aug 8, 2024
75af964
fix: missing tag translation for pattern grids
raoulvdberge Aug 8, 2024
9897a32
fix: alternatives not being updated if amount changes
raoulvdberge Aug 8, 2024
82ee865
Merge pull request #650 from refinedmods/feat/GH-104/recipe-transfer
raoulvdberge Aug 8, 2024
2e39bd6
fix: not being able to extract patterns
raoulvdberge Aug 8, 2024
1deb3ae
feat: the pattern output is now always rendered in the result slot
raoulvdberge Aug 8, 2024
e8a6142
Merge pull request #651 from refinedmods/fix/NO-ISSUE/pattern-extract
raoulvdberge Aug 8, 2024
9c274bf
chore: prepare release v2.0.0-milestone.4.6
raoulvdberge Aug 8, 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
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .idea/dictionaries/refinedstorage.xml

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

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

## [Unreleased]

## [2.0.0-milestone.4.6] - 2024-08-08

### Added

- Pattern Grid
- Pattern

### Changed

- The Pattern now shows the recipe in the tooltip.
- When a Pattern is created for a recipe, the Pattern will have a different texture and name to differentiate between empty patterns.
- The Pattern Grid now has additional support for encoding stonecutter and smithing table recipes.
- The Pattern output is now always rendered in the Pattern Grid result slot.

### Fixed

- Clicking on a scrollbar no longer makes a clicking sound.
- Incorrect and outdated (mentioning NBT tags) help explanations for fuzzy mode.
- Amount screen allowing more than the maximum for fluids.
- Potential text overflow in the Grid for localization with long "Grid" text.

## [2.0.0-milestone.4.5] - 2024-07-26

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

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

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

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

allprojects {
apply(plugin = "maven-publish")
publishing {
repositories {
mavenLocal()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.refinedmods.refinedstorage.api.network.node.NetworkNode;
import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.common.api.autocrafting.Pattern;
import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategyFactory;
import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategyFactory;
import com.refinedmods.refinedstorage.common.api.exporter.ExporterTransferStrategyFactory;
Expand Down Expand Up @@ -200,4 +201,6 @@ EnergyStorage asBlockItemEnergyStorage(
void sendNoPermissionMessage(ServerPlayer player, Component message);

boolean canPlaceNetworkNode(ServerPlayer player, Level level, BlockPos pos, BlockState state);

Optional<Pattern> getPattern(ItemStack stack, Level level);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.refinedmods.refinedstorage.api.network.node.NetworkNode;
import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.common.api.autocrafting.Pattern;
import com.refinedmods.refinedstorage.common.api.constructordestructor.ConstructorStrategyFactory;
import com.refinedmods.refinedstorage.common.api.constructordestructor.DestructorStrategyFactory;
import com.refinedmods.refinedstorage.common.api.exporter.ExporterTransferStrategyFactory;
Expand Down Expand Up @@ -395,6 +396,11 @@ public boolean canPlaceNetworkNode(final ServerPlayer player,
return ensureLoaded().canPlaceNetworkNode(player, level, pos, state);
}

@Override
public Optional<Pattern> getPattern(final ItemStack stack, final Level level) {
return ensureLoaded().getPattern(stack, level);
}

private RefinedStorageApi ensureLoaded() {
if (delegate == null) {
throw new IllegalStateException("API not loaded yet");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.refinedmods.refinedstorage.common.api.autocrafting;

import org.apiguardian.api.API;

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

import java.util.Optional;
import java.util.UUID;
import javax.annotation.Nullable;

import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.6")
public interface PatternProviderItem {
@Nullable
UUID getId(ItemStack stack);

Optional<Pattern> getPattern(ItemStack stack, Level level);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@ParametersAreNonnullByDefault
@FieldsAndMethodsAreNonnullByDefault
package com.refinedmods.refinedstorage.common.api.autocrafting;

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

import javax.annotation.ParametersAreNonnullByDefault;
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,40 @@

import com.refinedmods.refinedstorage.api.grid.view.GridResourceAttributeKey;
import com.refinedmods.refinedstorage.api.grid.view.GridView;
import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey;

import java.util.Collections;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import javax.annotation.Nullable;

import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0")
public abstract class AbstractPlatformGridResource implements PlatformGridResource {
protected final ResourceAmount resourceAmount;
public abstract class AbstractPlatformGridResource<T extends PlatformResourceKey> implements PlatformGridResource {
protected final T resource;
private final String name;
private final Map<GridResourceAttributeKey, Set<String>> attributes;
private boolean zeroed;

protected AbstractPlatformGridResource(final ResourceAmount resourceAmount,
protected AbstractPlatformGridResource(final T resource,
final String name,
final Map<GridResourceAttributeKey, Set<String>> attributes) {
this.resourceAmount = resourceAmount;
this.resource = resource;
this.name = name;
this.attributes = attributes;
}

@Override
public Optional<TrackedResource> getTrackedResource(final GridView view) {
return view.getTrackedResource(resourceAmount.getResource());
return view.getTrackedResource(resource);
}

@Override
public long getAmount() {
return resourceAmount.getAmount();
public long getAmount(final GridView view) {
return view.getAmount(resource);
}

@Override
Expand All @@ -57,10 +58,16 @@ public void setZeroed(final boolean zeroed) {
this.zeroed = zeroed;
}

@Nullable
@Override
public PlatformResourceKey getResourceForRecipeMods() {
return resource;
}

@Override
public String toString() {
return "AbstractPlatformGridResource{"
+ "resourceAmount=" + resourceAmount
+ "resource=" + resource
+ ", name='" + name + '\''
+ ", attributes=" + attributes
+ ", zeroed=" + zeroed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode;
import com.refinedmods.refinedstorage.api.grid.view.GridResource;
import com.refinedmods.refinedstorage.api.grid.view.GridView;
import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode;
import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy;
import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy;
import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType;

import java.util.List;
import java.util.Optional;
Expand All @@ -28,19 +30,21 @@ void onScroll(GridScrollMode scrollMode,

void render(GuiGraphics graphics, int x, int y);

String getDisplayedAmount();
String getDisplayedAmount(GridView view);

String getAmountInTooltip();
String getAmountInTooltip(GridView view);

boolean belongsToResourceType(ResourceType resourceType);

List<Component> getTooltip();

Optional<TooltipComponent> getTooltipImage();

int getRegistryId();

List<ClientTooltipComponent> getExtractionHints();
List<ClientTooltipComponent> getExtractionHints(GridView view);

@Nullable
@API(status = API.Status.INTERNAL)
PlatformResourceKey getUnderlyingResource();
PlatformResourceKey getResourceForRecipeMods();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.refinedmods.refinedstorage.common.api.storage.root;

import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.api.storage.root.RootStorage;

Expand All @@ -10,5 +9,5 @@

@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4")
public interface FuzzyRootStorage extends RootStorage {
Collection<ResourceAmount> getFuzzy(ResourceKey resource);
Collection<ResourceKey> getFuzzy(ResourceKey resource);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

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

import java.util.List;

import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.4")
public interface PlatformResourceKey extends ResourceKey {
long getInterfaceExportLimit();

long getProcessingPatternLimit();

List<ResourceTag> getTags();

ResourceType getResourceType();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.refinedmods.refinedstorage.common.api.support.resource;

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

import java.util.Optional;

import org.apiguardian.api.API;
Expand All @@ -8,5 +10,7 @@
public interface RecipeModIngredientConverter {
Optional<PlatformResourceKey> convertToResource(Object ingredient);

Optional<ResourceAmount> convertToResourceAmount(Object ingredient);

Optional<Object> convertToIngredient(PlatformResourceKey resource);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,19 @@ public interface ResourceContainer {

void remove(int index);

void clear();

int size();

default boolean isEmpty() {
for (int i = 0; i < size(); i++) {
if (!isEmpty(i)) {
return false;
}
}
return true;
}

default boolean isEmpty(int index) {
return get(index) == null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.refinedmods.refinedstorage.common.api.support.resource;

import java.util.List;

import net.minecraft.tags.TagKey;
import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.6")
public record ResourceTag(TagKey<?> key, List<PlatformResourceKey> resources) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.refinedmods.refinedstorage.api.grid.operations.GridOperations;
import com.refinedmods.refinedstorage.api.grid.view.GridResource;
import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.api.storage.Actor;
import com.refinedmods.refinedstorage.api.storage.root.RootStorage;

Expand Down Expand Up @@ -33,9 +33,7 @@ public interface ResourceType {

double getDisplayAmount(long amount);

Optional<GridResource> toGridResource(ResourceAmount resourceAmount);

boolean isGridResourceBelonging(GridResource gridResource);
Optional<GridResource> toGridResource(ResourceKey resource);

long getInterfaceExportLimit();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.refinedmods.refinedstorage.common.api.support.resource.list;

import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.api.resource.list.ResourceList;
import com.refinedmods.refinedstorage.common.api.support.resource.FuzzyModeNormalizer;
Expand All @@ -17,5 +16,5 @@ public interface FuzzyResourceList extends ResourceList {
* @param resource the resource, doesn't matter if it's normalized or not
* @return a list of fuzzy matched variants, or empty list if none found
*/
Collection<ResourceAmount> getFuzzy(ResourceKey resource);
Collection<ResourceKey> getFuzzy(ResourceKey resource);
}
Loading
Loading