Skip to content

Commit

Permalink
Merge pull request #8 from refinedmods/release/0.1.2
Browse files Browse the repository at this point in the history
Release v0.1.2
  • Loading branch information
raoulvdberge authored Jun 20, 2024
2 parents 4dd73e1 + 3bd8251 commit c301ba9
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 104 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.2] - 2024-06-20

### Fixed

- Potential load order issues on Fabric.

## [0.1.1] - 2024-06-16

### Fixed
Expand All @@ -24,7 +30,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Support for REI collapsable entries.
- Grid / REI search box synchronization options.

[Unreleased]: https://github.com/refinedmods/refinedstorage-rei-integration/compare/v0.1.1...HEAD
[Unreleased]: https://github.com/refinedmods/refinedstorage-rei-integration/compare/v0.1.2...HEAD

[0.1.2]: https://github.com/refinedmods/refinedstorage-rei-integration/compare/v0.1.1...v0.1.2

[0.1.1]: https://github.com/refinedmods/refinedstorage-rei-integration/compare/v0.1.0...v0.1.1

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
refinedstorageVersion=2.0.0-milestone.3.10
refinedstorageVersion=2.0.0-milestone.3.13
architecturyVersion=11.1.17
clothConfigVersion=13.0.121
reiVersion=14.1.727
Expand Down
12 changes: 4 additions & 8 deletions refinedstorage-rei-integration-fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@ repositories {
password = "\u0067hp_oGjcDFCn8jeTzIj4Ke9pLoEVtpnZMP4VQgaX"
}
}
maven {
name = 'ModMenu'
url 'https://maven.terraformersmc.com/'
}
maven {
name = 'Cloth Config, REI'
url 'https://maven.shedaniel.me/'
}
maven {
name = 'NoIndium'
url = 'https://maven.cafeteria.dev/releases/'
name = 'ModMenu'
url 'https://maven.terraformersmc.com/'
}
maven {
name = "Trinkets"
url = 'https://maven.ladysnake.org/releases'
name = 'NoIndium'
url = 'https://maven.cafeteria.dev/releases/'
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
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.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage2.platform.common.Platform;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu;
Expand All @@ -19,12 +19,6 @@

class DraggableStackVisitorImpl
implements DraggableStackVisitor<AbstractBaseScreen<? extends AbstractResourceContainerMenu>> {
private final RecipeModIngredientConverter ingredientConverter;

DraggableStackVisitorImpl(final RecipeModIngredientConverter ingredientConverter) {
this.ingredientConverter = ingredientConverter;
}

@Override
public Stream<BoundsProvider> getDraggableAcceptingBounds(
final DraggingContext<AbstractBaseScreen<? extends AbstractResourceContainerMenu>> context,
Expand All @@ -34,7 +28,7 @@ public Stream<BoundsProvider> getDraggableAcceptingBounds(
final var menu = screen.getMenu();
final var value = stack.getStack().getValue();
final List<BoundsProvider> bounds = new ArrayList<>();
ingredientConverter.convertToResource(value).ifPresent(resource -> {
PlatformApi.INSTANCE.getIngredientConverter().convertToResource(value).ifPresent(resource -> {
for (final ResourceSlot slot : menu.getResourceSlots()) {
if (slot.isFilter() && slot.isValid(resource)) {
bounds.add(BoundsProvider.ofRectangle(toRectangle(screen, slot)));
Expand All @@ -52,7 +46,7 @@ public DraggedAcceptorResult acceptDraggedStack(
final var screen = context.getScreen();
final var menu = screen.getMenu();
final Object value = stack.getStack().getValue();
return ingredientConverter.convertToResource(value)
return PlatformApi.INSTANCE.getIngredientConverter().convertToResource(value)
.map(resource -> accept(context, menu, screen, resource))
.orElse(DraggedAcceptorResult.PASS);
}
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.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage2.platform.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen;
import dev.architectury.event.CompoundEventResult;
import me.shedaniel.math.Point;
Expand All @@ -10,12 +10,6 @@
import net.minecraft.client.gui.screens.Screen;

class GridFocusedStackProvider implements FocusedStackProvider {
private final RecipeModIngredientConverter converter;

GridFocusedStackProvider(final RecipeModIngredientConverter converter) {
this.converter = converter;
}

@Override
public CompoundEventResult<EntryStack<?>> provide(final Screen screen, final Point mouse) {
if (!(screen instanceof AbstractGridScreen<?> gridScreen)) {
Expand All @@ -25,7 +19,9 @@ public CompoundEventResult<EntryStack<?>> provide(final Screen screen, final Poi
if (resource == null) {
return CompoundEventResult.pass();
}
final Object converted = converter.convertToIngredient(resource).orElse(null);
final Object converted = PlatformApi.INSTANCE.getIngredientConverter()
.convertToIngredient(resource)
.orElse(null);
if (converted instanceof EntryStack<?> stack) {
return CompoundEventResult.interruptTrue(stack);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.util.function.Supplier;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap;
import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
import com.refinedmods.refinedstorage2.platform.common.content.ContentIds;
Expand Down Expand Up @@ -32,10 +30,9 @@
public class ReiClientPlugin implements REIClientPlugin {
@Override
public void registerScreens(final ScreenRegistry registry) {
final RecipeModIngredientConverter converter = PlatformApi.INSTANCE.getIngredientConverter();
registry.registerFocusedStack(new GridFocusedStackProvider(converter));
registry.registerFocusedStack(new ResourceFocusedStackProvider(converter));
registry.registerDraggableStackVisitor(new DraggableStackVisitorImpl(converter));
registry.registerFocusedStack(new GridFocusedStackProvider());
registry.registerFocusedStack(new ResourceFocusedStackProvider());
registry.registerDraggableStackVisitor(new DraggableStackVisitorImpl());
}

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

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.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;

public class ReiRefinedStoragePlugin implements RefinedStoragePlugin {
@Override
public void onPlatformApiAvailable(final PlatformApi platformApi) {
platformApi.addIngredientConverter(new ReiRecipeModIngredientConverter());
platformApi.getGridSynchronizerRegistry().register(SYNCHRONIZER_ID, new ReiGridSynchronizer(false));
platformApi.getGridSynchronizerRegistry().register(TWO_WAY_SYNCHRONIZER_ID, new ReiGridSynchronizer(true));
}
}
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.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage2.platform.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen;
import dev.architectury.event.CompoundEventResult;
import me.shedaniel.math.Point;
Expand All @@ -10,12 +10,6 @@
import net.minecraft.client.gui.screens.Screen;

class ResourceFocusedStackProvider implements FocusedStackProvider {
private final RecipeModIngredientConverter converter;

ResourceFocusedStackProvider(final RecipeModIngredientConverter converter) {
this.converter = converter;
}

@Override
public CompoundEventResult<EntryStack<?>> provide(final Screen screen, final Point mouse) {
if (!(screen instanceof AbstractBaseScreen<?> baseScreen)) {
Expand All @@ -25,7 +19,9 @@ public CompoundEventResult<EntryStack<?>> provide(final Screen screen, final Poi
if (hoveredResource == null) {
return CompoundEventResult.pass();
}
final Object converted = converter.convertToIngredient(hoveredResource).orElse(null);
final Object converted = PlatformApi.INSTANCE.getIngredientConverter()
.convertToIngredient(hoveredResource)
.orElse(null);
if (converted instanceof EntryStack<?> stack) {
return CompoundEventResult.interruptTrue(stack);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"license": "MIT",
"environment": "*",
"entrypoints": {
"client": [
"com.refinedmods.refinedstorage.rei.fabric.ClientModInitializerImpl"
"refinedstorage_plugin": [
"com.refinedmods.refinedstorage.rei.fabric.ReiRefinedStoragePlugin"
],
"rei_client": [
"com.refinedmods.refinedstorage.rei.fabric.ReiClientPlugin"
Expand Down
18 changes: 7 additions & 11 deletions refinedstorage-rei-integration-forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ archivesBaseName = 'refinedstorage-rei-integration-forge'
forgeProject("refinedstorage_rei_integration", project(":refinedstorage-rei-integration-common"))

repositories {
maven {
url = uri("https://maven.pkg.github.com/refinedmods/refinedstorage2")
credentials {
username = "anything"
password = "\u0067hp_oGjcDFCn8jeTzIj4Ke9pLoEVtpnZMP4VQgaX"
}
}
maven {
name = 'REI'
url 'https://maven.shedaniel.me/'
Expand All @@ -15,17 +22,6 @@ repositories {
name = 'Architectury'
url "https://maven.architectury.dev/"
}
maven {
name = 'Curios'
url = "https://maven.theillusivec4.top/"
}
maven {
url = uri("https://maven.pkg.github.com/refinedmods/refinedstorage2")
credentials {
username = "anything"
password = "\u0067hp_oGjcDFCn8jeTzIj4Ke9pLoEVtpnZMP4VQgaX"
}
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
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.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage2.platform.common.Platform;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu;
Expand All @@ -19,12 +19,6 @@

class DraggableStackVisitorImpl
implements DraggableStackVisitor<AbstractBaseScreen<? extends AbstractResourceContainerMenu>> {
private final RecipeModIngredientConverter ingredientConverter;

DraggableStackVisitorImpl(final RecipeModIngredientConverter ingredientConverter) {
this.ingredientConverter = ingredientConverter;
}

@Override
public Stream<BoundsProvider> getDraggableAcceptingBounds(
final DraggingContext<AbstractBaseScreen<? extends AbstractResourceContainerMenu>> context,
Expand All @@ -34,7 +28,7 @@ public Stream<BoundsProvider> getDraggableAcceptingBounds(
final var menu = screen.getMenu();
final var value = stack.getStack().getValue();
final List<BoundsProvider> bounds = new ArrayList<>();
ingredientConverter.convertToResource(value).ifPresent(resource -> {
PlatformApi.INSTANCE.getIngredientConverter().convertToResource(value).ifPresent(resource -> {
for (final ResourceSlot slot : menu.getResourceSlots()) {
if (slot.isFilter() && slot.isValid(resource)) {
bounds.add(BoundsProvider.ofRectangle(toRectangle(screen, slot)));
Expand All @@ -52,7 +46,7 @@ public DraggedAcceptorResult acceptDraggedStack(
final var screen = context.getScreen();
final var menu = screen.getMenu();
final Object value = stack.getStack().getValue();
return ingredientConverter.convertToResource(value)
return PlatformApi.INSTANCE.getIngredientConverter().convertToResource(value)
.map(resource -> accept(context, menu, screen, resource))
.orElse(DraggedAcceptorResult.PASS);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.refinedmods.refinedstorage.rei.forge;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.support.resource.PlatformResourceKey;
import com.refinedmods.refinedstorage2.platform.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen;
import dev.architectury.event.CompoundEventResult;
import me.shedaniel.math.Point;
Expand All @@ -10,12 +10,6 @@
import net.minecraft.client.gui.screens.Screen;

class GridFocusedStackProvider implements FocusedStackProvider {
private final RecipeModIngredientConverter converter;

GridFocusedStackProvider(final RecipeModIngredientConverter converter) {
this.converter = converter;
}

@Override
public CompoundEventResult<EntryStack<?>> provide(final Screen screen, final Point mouse) {
if (!(screen instanceof AbstractGridScreen<?> gridScreen)) {
Expand All @@ -25,7 +19,9 @@ public CompoundEventResult<EntryStack<?>> provide(final Screen screen, final Poi
if (underlyingResource == null) {
return CompoundEventResult.pass();
}
final Object converted = converter.convertToIngredient(underlyingResource).orElse(null);
final Object converted = PlatformApi.INSTANCE.getIngredientConverter()
.convertToIngredient(underlyingResource)
.orElse(null);
if (converted instanceof EntryStack<?> stack) {
return CompoundEventResult.interruptTrue(stack);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.util.function.Supplier;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap;
import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
import com.refinedmods.refinedstorage2.platform.common.content.ContentIds;
Expand Down Expand Up @@ -31,10 +29,9 @@
public class ReiClientPlugin implements REIClientPlugin {
@Override
public void registerScreens(final ScreenRegistry registry) {
final RecipeModIngredientConverter converter = PlatformApi.INSTANCE.getIngredientConverter();
registry.registerFocusedStack(new GridFocusedStackProvider(converter));
registry.registerFocusedStack(new ResourceFocusedStackProvider(converter));
registry.registerDraggableStackVisitor(new DraggableStackVisitorImpl(converter));
registry.registerFocusedStack(new GridFocusedStackProvider());
registry.registerFocusedStack(new ResourceFocusedStackProvider());
registry.registerDraggableStackVisitor(new DraggableStackVisitorImpl());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.refinedmods.refinedstorage.rei.forge;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
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.AbstractBaseScreen;
import dev.architectury.event.CompoundEventResult;
import me.shedaniel.math.Point;
Expand All @@ -10,12 +10,6 @@
import net.minecraft.client.gui.screens.Screen;

class ResourceFocusedStackProvider implements FocusedStackProvider {
private final RecipeModIngredientConverter converter;

ResourceFocusedStackProvider(final RecipeModIngredientConverter converter) {
this.converter = converter;
}

@Override
public CompoundEventResult<EntryStack<?>> provide(final Screen screen, final Point mouse) {
if (!(screen instanceof AbstractBaseScreen<?> baseScreen)) {
Expand All @@ -25,7 +19,9 @@ public CompoundEventResult<EntryStack<?>> provide(final Screen screen, final Poi
if (hoveredResource == null) {
return CompoundEventResult.pass();
}
final Object converted = converter.convertToIngredient(hoveredResource).orElse(null);
final Object converted = PlatformApi.INSTANCE.getIngredientConverter()
.convertToIngredient(hoveredResource)
.orElse(null);
if (converted instanceof EntryStack<?> stack) {
return CompoundEventResult.interruptTrue(stack);
}
Expand Down

0 comments on commit c301ba9

Please sign in to comment.