Skip to content

Commit

Permalink
Merge pull request #663 from refinedmods/release/2.0.0-milestone.4.7
Browse files Browse the repository at this point in the history
Release v2.0.0-milestone.4.7
  • Loading branch information
raoulvdberge authored Aug 11, 2024
2 parents 2f97ae8 + fcd24af commit 902c1e0
Show file tree
Hide file tree
Showing 553 changed files with 4,337 additions and 1,590 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ body:
description: |
If your Minecraft version isn't listed here, it means that it isn't supported. In that case, don't create an issue.
options:
- Minecraft 1.21
- Minecraft 1.21.1
validations:
required: true
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [ opened, synchronize, reopened ]
jobs:
build:
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.16.9
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.17.1
with:
gametests: true
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.16.9
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.17.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.16.9
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.17.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.16.9
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.17.1
secrets: inherit
with:
project-name: 'Refined Storage'
Expand Down
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 * * 1'
jobs:
lock:
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.16.9
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.17.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.16.9
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.17.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.16.9
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.17.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.16.9
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.17.1
29 changes: 28 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.7] - 2024-08-11

### Added

- You can now upgrade Storage Disks and Storage Blocks to a higher tier by combining with a higher tier Storage Part. The original Storage Part will be returned.

### Changed

- Updated to Minecraft 1.21.1.
- The Network Transmitter and Wireless Transmitter GUI now has an inactive and active GUI animation.
- The Wireless Transmitter now shows whether it's inactive in GUI instead of always showing the range.

### Fixed

- Use new slimeballs convention tag for Processor Binding.
- Portable Grid search bar texture being positioned in the wrong way.
- External Storage screen unnecessarily showing upgrade slots.
- Grid setting changes not persisting after restarting Minecraft.
- Fixed not being able to extract fluids from the Grid with an empty bucket or other empty fluid container.
- All blocks and items now correctly retain their custom name.

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

### Added
Expand All @@ -20,6 +41,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- 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.
- You can now search in the Pattern Grid alternatives screen.
- In the Pattern Grid alternatives screen, all resources belonging to a tag or no longer shown at once. You can expand or collapse them.
- The tag names in the Pattern Grid alternatives screen will now be translated.
- "Exact mode" in the Pattern Grid has been replaced with "Fuzzy mode" (inverse).

### Fixed

Expand Down Expand Up @@ -712,7 +737,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.6...HEAD
[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.7...HEAD

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

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

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
refinedarchitectVersion=0.16.9
refinedarchitectVersion=0.17.1
# Gradle
org.gradle.jvmargs=-Xmx1G
6 changes: 0 additions & 6 deletions refinedstorage-common-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {

refinedarchitect {
common()
testing()
javadoc()
publishing {
maven = true
Expand All @@ -22,9 +21,4 @@ dependencies {
api(project(":refinedstorage-resource-api"))
api(project(":refinedstorage-network-api"))
api(project(":refinedstorage-grid-api"))
testImplementation(libs.junit.api)
testImplementation(libs.junit.params)
testImplementation(libs.assertj)
testImplementation(libs.equalsverifier)
testRuntimeOnly(libs.junit.engine)
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ GridScrollingStrategy createGridScrollingStrategy(AbstractContainerMenu containe

<T extends ResourceKey> void registerResourceRendering(Class<T> resourceClass, ResourceRendering rendering);

ResourceRendering getResourceRendering(ResourceKey resource);
<T extends ResourceKey> ResourceRendering getResourceRendering(Class<T> resourceClass);

void addIngredientConverter(RecipeModIngredientConverter converter);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ public <T extends ResourceKey> void registerResourceRendering(final Class<T> res
}

@Override
public ResourceRendering getResourceRendering(final ResourceKey resource) {
return ensureLoaded().getResourceRendering(resource);
public <T extends ResourceKey> ResourceRendering getResourceRendering(final Class<T> resourceClass) {
return ensureLoaded().getResourceRendering(resourceClass);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,5 @@ public interface GridSynchronizer {
@Nullable
String getTextToSynchronizeToGrid();

ResourceLocation getTextureIdentifier();

int getXTexture();

int getYTexture();
ResourceLocation getSprite();
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent;
import net.minecraft.network.chat.Component;
import net.minecraft.world.inventory.tooltip.TooltipComponent;
import net.minecraft.world.item.ItemStack;
import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6")
public interface PlatformGridResource extends GridResource {
boolean canExtract(ItemStack carriedStack, GridView view);

void onExtract(GridExtractMode extractMode,
boolean cursor,
GridExtractionStrategy extractionStrategy);
Expand All @@ -42,7 +45,7 @@ void onScroll(GridScrollMode scrollMode,

int getRegistryId();

List<ClientTooltipComponent> getExtractionHints(GridView view);
List<ClientTooltipComponent> getExtractionHints(ItemStack carriedStack, GridView view);

@Nullable
@API(status = API.Status.INTERNAL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
Expand All @@ -35,6 +36,16 @@ protected AbstractStorageContainerBlockItem(
this.helper = helper;
}

@Override
public void inventoryTick(final ItemStack stack,
final Level level,
final Entity entity,
final int slotId,
final boolean isSelected) {
super.inventoryTick(stack, level, entity, slotId, isSelected);
helper.transferStorageIfNecessary(stack, level, entity, this::createStorage);
}

@Override
public InteractionResultHolder<ItemStack> use(final Level level, final Player player, final InteractionHand hand) {
final ItemStack stack = player.getItemInHand(hand);
Expand Down Expand Up @@ -76,13 +87,16 @@ public void appendHoverText(final ItemStack stack,
final TooltipFlag flag) {
super.appendHoverText(stack, context, tooltip, flag);
final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getClientStorageRepository();
helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, hasCapacity());
helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, getCapacity());
}

protected abstract boolean hasCapacity();
@Nullable
protected abstract Long getCapacity();

protected abstract String formatAmount(long amount);

protected abstract SerializableStorage createStorage(StorageRepository storageRepository);

protected abstract ItemStack createPrimaryDisassemblyByproduct(int count);

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ public void inventoryTick(final ItemStack stack,
final int slot,
final boolean selected) {
super.inventoryTick(stack, level, entity, slot, selected);
if (!level.isClientSide() && !helper.hasStorage(stack) && entity instanceof Player) {
final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getStorageRepository(level);
helper.setStorage(storageRepository, stack, createStorage(storageRepository));
}
helper.transferStorageIfNecessary(stack, level, entity, this::createStorage);
helper.loadStorageIfNecessary(stack, level, entity, this::createStorage);
}

@Override
Expand All @@ -64,10 +62,11 @@ public void appendHoverText(final ItemStack stack,
final TooltipFlag flag) {
super.appendHoverText(stack, context, tooltip, flag);
final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getClientStorageRepository();
helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, hasCapacity());
helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, getCapacity());
}

protected abstract boolean hasCapacity();
@Nullable
protected abstract Long getCapacity();

protected abstract String formatAmount(long amount);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.function.LongFunction;
import javax.annotation.Nullable;

import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand All @@ -21,9 +23,15 @@
public interface StorageContainerItemHelper {
Optional<SerializableStorage> resolveStorage(StorageRepository storageRepository, ItemStack stack);

void setStorage(StorageRepository storageRepository, ItemStack stack, SerializableStorage storage);
void loadStorageIfNecessary(ItemStack stack,
Level level,
Entity entity,
Function<StorageRepository, SerializableStorage> factory);

boolean hasStorage(ItemStack stack);
void transferStorageIfNecessary(ItemStack stack,
Level level,
Entity entity,
Function<StorageRepository, SerializableStorage> factory);

Optional<StorageInfo> getInfo(StorageRepository storageRepository, ItemStack stack);

Expand All @@ -38,7 +46,7 @@ void appendToTooltip(ItemStack stack,
List<Component> tooltip,
TooltipFlag context,
LongFunction<String> amountFormatter,
boolean hasCapacity);
@Nullable Long capacity);

void transferToBlockEntity(ItemStack stack, StorageBlockEntity blockEntity);

Expand All @@ -49,4 +57,6 @@ void appendToTooltip(ItemStack stack,
Set<ResourceLocation> getDiskModels();

Map<Item, ResourceLocation> getDiskModelsByItem();

void markAsToTransfer(ItemStack from, ItemStack to);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public interface StorageRepository {
*/
Optional<SerializableStorage> removeIfEmpty(UUID id);

/**
* Removes a storage by ID.
*
* @param id the id
*/
void remove(UUID id);

/**
* Retrieves info for a given storage ID.
*
Expand Down

This file was deleted.

Loading

0 comments on commit 902c1e0

Please sign in to comment.