Skip to content

Commit

Permalink
chore: upgrade refined storage
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvdberge committed Jun 9, 2024
1 parent ada4627 commit e3aa0d5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 16 deletions.
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.3.8.

## [0.1.0] - 2024-06-08

### Added
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
refinedstorageVersion=2.0.0-milestone.3.8
# Gradle
org.gradle.jvmargs=-Xmx1G
refinedstorageVersion=2.0.0-milestone.3.7
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import java.util.Collections;
import java.util.List;

import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter;
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 @@ -16,9 +16,9 @@

@SuppressWarnings("rawtypes")
class GhostIngredientHandler implements IGhostIngredientHandler<AbstractBaseScreen> {
private final IngredientConverter ingredientConverter;
private final RecipeModIngredientConverter ingredientConverter;

GhostIngredientHandler(final IngredientConverter ingredientConverter) {
GhostIngredientHandler(final RecipeModIngredientConverter ingredientConverter) {
this.ingredientConverter = ingredientConverter;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.Optional;

import com.refinedmods.refinedstorage2.platform.api.grid.view.PlatformGridResource;
import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter;
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 mezz.jei.api.gui.handlers.IGuiContainerHandler;
import mezz.jei.api.ingredients.IIngredientHelper;
Expand All @@ -13,10 +13,10 @@
import mezz.jei.api.runtime.IIngredientManager;

class GridGuiContainerHandler implements IGuiContainerHandler<AbstractGridScreen<?>> {
private final IngredientConverter converter;
private final RecipeModIngredientConverter converter;
private final IIngredientManager ingredientManager;

GridGuiContainerHandler(final IngredientConverter converter, final IIngredientManager ingredientManager) {
GridGuiContainerHandler(final RecipeModIngredientConverter converter, final IIngredientManager ingredientManager) {
this.converter = converter;
this.ingredientManager = ingredientManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

import java.util.Optional;

import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter;
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 mezz.jei.api.helpers.IPlatformFluidHelper;
import net.minecraft.world.item.ItemStack;

class IngredientConvertImpl implements IngredientConverter {
class JeiRecipeModIngredientConverter implements RecipeModIngredientConverter {
private final IPlatformFluidHelper<?> fluidHelper;

IngredientConvertImpl(final IPlatformFluidHelper<?> fluidHelper) {
JeiRecipeModIngredientConverter(final IPlatformFluidHelper<?> fluidHelper) {
this.fluidHelper = fluidHelper;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import javax.annotation.Nullable;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter;
import com.refinedmods.refinedstorage2.platform.api.support.resource.RecipeModIngredientConverter;
import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen;
import mezz.jei.api.IModPlugin;
Expand Down Expand Up @@ -44,7 +44,7 @@ public void onRuntimeAvailable(final IJeiRuntime newRuntime) {

@Override
public void registerGuiHandlers(final IGuiHandlerRegistration registration) {
final IngredientConverter converter = PlatformApi.INSTANCE.getIngredientConverter();
final RecipeModIngredientConverter converter = PlatformApi.INSTANCE.getIngredientConverter();
registration.addGenericGuiContainerHandler(
AbstractBaseScreen.class,
new ResourceGuiContainerHandler(converter, registration.getJeiHelpers().getIngredientManager())
Expand Down Expand Up @@ -84,6 +84,6 @@ private void registerGridSynchronizers() {
}

private void registerIngredientConverters(final IPlatformFluidHelper<?> fluidHelper) {
PlatformApi.INSTANCE.registerIngredientConverter(new IngredientConvertImpl(fluidHelper));
PlatformApi.INSTANCE.addIngredientConverter(new JeiRecipeModIngredientConverter(fluidHelper));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.Optional;
import javax.annotation.Nullable;

import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter;
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 mezz.jei.api.gui.handlers.IGuiContainerHandler;
import mezz.jei.api.ingredients.IIngredientHelper;
Expand All @@ -13,10 +13,11 @@
import mezz.jei.api.runtime.IIngredientManager;

class ResourceGuiContainerHandler implements IGuiContainerHandler<AbstractBaseScreen<?>> {
private final IngredientConverter converter;
private final RecipeModIngredientConverter converter;
private final IIngredientManager ingredientManager;

ResourceGuiContainerHandler(final IngredientConverter converter, final IIngredientManager ingredientManager) {
ResourceGuiContainerHandler(final RecipeModIngredientConverter converter,
final IIngredientManager ingredientManager) {
this.converter = converter;
this.ingredientManager = ingredientManager;
}
Expand Down

0 comments on commit e3aa0d5

Please sign in to comment.