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

feat: port to minecraft 1.21 #17

Merged
merged 1 commit into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ body:
description: |
If your Minecraft version isn't listed here, it means that it's no longer supported. In that case, don't create an issue.
options:
- Minecraft 1.20.4
- Minecraft 1.21
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.13.4
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.15.2
with:
mutation-testing: false
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.13.4
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.15.2
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.13.4
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.15.2
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.13.4
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.15.2
secrets: inherit
with:
project-name: 'Refined Storage - REI Integration'
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 * * *'
jobs:
lock:
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.13.4
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.15.2
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.13.4
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.15.2
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.13.4
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.15.2
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.13.4
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.15.2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ out/
/bin/
logs/
.cache/
run/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Support for Refined Storage v2.0.0-milestone.4.2.

## [0.1.4] - 2024-06-28

### Fixed
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
refinedstorageVersion=2.0.0-milestone.3.14
architecturyVersion=11.1.17
clothConfigVersion=13.0.121
reiVersion=14.1.727
refinedstorageVersion=2.0.0-milestone.4.2
architecturyVersion=13.0.3
clothConfigVersion=15.0.127
reiVersion=16.0.729
# Gradle
org.gradle.jvmargs=-Xmx1G
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@
public final class Common {
public static final String MOD_ID = "refinedstorage_rei_integration";

public static final ResourceLocation SYNCHRONIZER_ID = new ResourceLocation(MOD_ID, "rei");
public static final ResourceLocation SYNCHRONIZER_ID = ResourceLocation.fromNamespaceAndPath(
MOD_ID,
"rei"
);
public static final MutableComponent SYNCHRONIZER_TITLE = Component.translatable(
"gui.%s.grid.synchronizer".formatted(MOD_ID)
);
public static final Component SYNCHRONIZER_HELP = Component.translatable(
"gui.%s.grid.synchronizer.help".formatted(MOD_ID)
);

public static final ResourceLocation TWO_WAY_SYNCHRONIZER_ID = new ResourceLocation(MOD_ID, "rei_two_way");
public static final ResourceLocation TWO_WAY_SYNCHRONIZER_ID = ResourceLocation.fromNamespaceAndPath(
MOD_ID,
"rei_two_way"
);
public static final MutableComponent TWO_WAY_SYNCHRONIZER_TITLE = Component.translatable(
"gui.%s.grid.synchronizer.two_way".formatted(MOD_ID)
);
public static final Component TWO_WAY_SYNCHRONIZER_HELP = Component.translatable(
"gui.%s.grid.synchronizer.two_way.help".formatted(MOD_ID)
);

public static final ResourceLocation FULLY_CHARGED_CONTROLLER_GROUP_ID = new ResourceLocation(
public static final ResourceLocation FULLY_CHARGED_CONTROLLER_GROUP_ID = ResourceLocation.fromNamespaceAndPath(
MOD_ID,
"fully_charged_controller"
);
Expand Down
1 change: 0 additions & 1 deletion refinedstorage-rei-integration-fabric/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions refinedstorage-rei-integration-fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ repositories {
}

dependencies {
modApi "com.refinedmods.refinedstorage2:refinedstorage2-platform-fabric:${refinedstorageVersion}"
// https://linkie.shedaniel.dev/dependencies?loader=fabric&version=1.20.4
modApi "com.refinedmods.refinedstorage:refinedstorage-platform-fabric:${refinedstorageVersion}"
// https://linkie.shedaniel.dev/dependencies?loader=fabric&version=1.21
modApi "dev.architectury:architectury-fabric:${architecturyVersion}"
modApi "me.shedaniel.cloth:cloth-config-fabric:${clothConfigVersion}"
modApi "me.shedaniel:RoughlyEnoughItems-fabric:${reiVersion}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.refinedmods.refinedstorage.rei.fabric;

import com.refinedmods.refinedstorage.api.resource.list.ResourceList;
import com.refinedmods.refinedstorage.platform.common.grid.CraftingGridContainerMenu;
import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource;

import java.awt.Color;
import java.util.List;
import java.util.stream.Collectors;

import com.mojang.blaze3d.vertex.PoseStack;
import com.refinedmods.refinedstorage2.api.resource.list.ResourceList;
import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResource;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.widgets.Slot;
import me.shedaniel.rei.api.client.gui.widgets.Widget;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package com.refinedmods.refinedstorage.rei.fabric;

import com.refinedmods.refinedstorage.platform.api.PlatformApi;
import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen;
import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractResourceContainerMenu;
import com.refinedmods.refinedstorage.platform.common.support.containermenu.ResourceSlot;
import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage2.platform.common.Platform;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.drag.DraggableStack;
import me.shedaniel.rei.api.client.gui.drag.DraggableStackVisitor;
Expand Down Expand Up @@ -62,7 +63,7 @@ private DraggedAcceptorResult accept(
if (!slotBounds.contains(context.getCurrentPosition())) {
continue;
}
Platform.INSTANCE.getClientToServerCommunications().sendResourceFilterSlotChange(resource, slot.index);
C2SPackets.sendResourceFilterSlotChange(resource, slot.index);
return DraggedAcceptorResult.ACCEPTED;
}
return DraggedAcceptorResult.PASS;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.refinedmods.refinedstorage.rei.fabric;

import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen;

import java.util.Collection;
import java.util.stream.Collectors;

import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.registry.screen.ExclusionZonesProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.refinedmods.refinedstorage.rei.fabric;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen;
import com.refinedmods.refinedstorage.platform.api.PlatformApi;
import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage.platform.common.grid.screen.AbstractGridScreen;

import dev.architectury.event.CompoundEventResult;
import me.shedaniel.math.Point;
import me.shedaniel.rei.api.client.registry.screen.FocusedStackProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.refinedmods.refinedstorage.rei.fabric;

import com.refinedmods.refinedstorage.platform.common.content.ContentIds;
import com.refinedmods.refinedstorage.platform.common.content.Items;
import com.refinedmods.refinedstorage.platform.common.content.Tags;
import com.refinedmods.refinedstorage.platform.common.controller.ControllerBlockItem;
import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen;

import java.util.function.Supplier;

import com.refinedmods.refinedstorage2.platform.common.content.ContentIds;
import com.refinedmods.refinedstorage2.platform.common.content.Items;
import com.refinedmods.refinedstorage2.platform.common.content.Tags;
import com.refinedmods.refinedstorage2.platform.common.controller.ControllerBlockItem;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen;
import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
import me.shedaniel.rei.api.client.registry.entry.CollapsibleEntryRegistry;
import me.shedaniel.rei.api.client.registry.screen.ExclusionZones;
Expand All @@ -22,9 +23,9 @@
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;

import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation;
import static com.refinedmods.refinedstorage.rei.common.Common.FULLY_CHARGED_CONTROLLER_GROUP_ID;
import static com.refinedmods.refinedstorage.rei.common.Common.FULLY_CHARGED_CONTROLLER_GROUP_NAME;
import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;

@Environment(EnvType.CLIENT)
public class ReiClientPlugin implements REIClientPlugin {
Expand All @@ -42,7 +43,7 @@ public void registerTransferHandlers(final TransferHandlerRegistry registry) {

@Override
public void registerItemComparators(final ItemComparatorRegistry registry) {
Items.INSTANCE.getControllers().stream().map(Supplier::get).forEach(registry::registerNbt);
Items.INSTANCE.getControllers().stream().map(Supplier::get).forEach(registry::registerComponents);
}

private Component tagName(final String name) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.refinedmods.refinedstorage.rei.fabric;

import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridSynchronizer;

import javax.annotation.Nullable;

import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridSynchronizer;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.refinedmods.refinedstorage.rei.fabric;

import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage.platform.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResource;
import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource;

import java.util.Optional;

import com.refinedmods.refinedstorage2.platform.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage2.platform.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResource;
import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResource;
import dev.architectury.fluid.FluidStack;
import me.shedaniel.rei.api.common.util.EntryStacks;
import net.minecraft.world.item.ItemStack;
Expand All @@ -14,7 +15,7 @@ class ReiRecipeModIngredientConverter implements RecipeModIngredientConverter {
@Override
public Optional<PlatformResourceKey> convertToResource(final Object ingredient) {
if (ingredient instanceof FluidStack fluidStack) {
return Optional.of(new FluidResource(fluidStack.getFluid(), fluidStack.getTag()));
return Optional.of(new FluidResource(fluidStack.getFluid(), fluidStack.getPatch()));
}
if (ingredient instanceof ItemStack itemStack) {
return Optional.of(ItemResource.ofItemStack(itemStack));
Expand All @@ -31,7 +32,7 @@ public Optional<Object> convertToIngredient(final PlatformResourceKey resource)
final FluidStack fluidStack = FluidStack.create(
fluidResource.fluid(),
FluidStack.bucketAmount(),
fluidResource.tag()
fluidResource.components()
);
return Optional.of(EntryStacks.of(fluidStack));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.refinedmods.refinedstorage.rei.fabric;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.RefinedStoragePlugin;
import com.refinedmods.refinedstorage.platform.api.PlatformApi;
import com.refinedmods.refinedstorage.platform.api.RefinedStoragePlugin;

import static com.refinedmods.refinedstorage.rei.common.Common.SYNCHRONIZER_ID;
import static com.refinedmods.refinedstorage.rei.common.Common.TWO_WAY_SYNCHRONIZER_ID;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.refinedmods.refinedstorage.rei.fabric;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen;
import com.refinedmods.refinedstorage.platform.api.PlatformApi;
import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseScreen;

import dev.architectury.event.CompoundEventResult;
import me.shedaniel.math.Point;
import me.shedaniel.rei.api.client.registry.screen.FocusedStackProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
"links": {
"modmenu.discord": "https://discordapp.com/invite/VYzsydb"
},
"parent": "refinedstorage2"
"parent": "refinedstorage"
}
},
"depends": {
"fabricloader": ">=0.14.6",
"fabric-api": "*",
"minecraft": "~1.20.4",
"roughlyenoughitems": ">=14",
"minecraft": "~1.21",
"refinedstorage": ">=2.0.0-milestone.4.2",
"roughlyenoughitems": ">=16",
"java": ">=17"
}
}
1 change: 0 additions & 1 deletion refinedstorage-rei-integration-forge/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ plugins {
id 'java-library'
}

archivesBaseName = 'refinedstorage-rei-integration-forge'
archivesBaseName = 'refinedstorage-rei-integration-neoforge'

forgeProject("refinedstorage_rei_integration", project(":refinedstorage-rei-integration-common"))
neoForgeProject("refinedstorage_rei_integration", project(":refinedstorage-rei-integration-common"))

repositories {
maven {
Expand All @@ -25,8 +25,8 @@ repositories {
}

dependencies {
api "com.refinedmods.refinedstorage2:refinedstorage2-platform-forge:${refinedstorageVersion}"
// https://linkie.shedaniel.dev/dependencies?loader=neoforge&version=1.20.4
api "com.refinedmods.refinedstorage:refinedstorage-platform-neoforge:${refinedstorageVersion}"
// https://linkie.shedaniel.dev/dependencies?loader=neoforge&version=1.21
api "dev.architectury:architectury-neoforge:${architecturyVersion}"
api "me.shedaniel.cloth:cloth-config-neoforge:${clothConfigVersion}"
api "me.shedaniel:RoughlyEnoughItems-neoforge:${reiVersion}"
Expand Down
Loading
Loading