Skip to content

Commit

Permalink
Merge pull request #652 from refinedmods/release/2.0.0-milestone.4.6
Browse files Browse the repository at this point in the history
Release v2.0.0-milestone.4.6
  • Loading branch information
raoulvdberge authored Aug 8, 2024
2 parents 87076fb + 9c274bf commit 2f97ae8
Show file tree
Hide file tree
Showing 415 changed files with 11,572 additions and 1,437 deletions.
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

0 comments on commit 2f97ae8

Please sign in to comment.