Skip to content

Commit

Permalink
feat: disk interface alias
Browse files Browse the repository at this point in the history
"Disk Manipulator"
  • Loading branch information
raoulvdberge committed Oct 12, 2024
1 parent f248ebe commit 05c38b2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- The recipe transfer support in the Pattern Grid and Crafting Grid now indicates whether all or some resources are autocraftable.
- You can now start autocrafting for missing autocraftable items from the Crafting Grid via the recipe transfer.
- Alias support for the Disk Interface (formerly known as "Disk Manipulator").

### Fixed

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
package com.refinedmods.refinedstorage.jei.common;

import com.refinedmods.refinedstorage.common.content.Items;
import com.refinedmods.refinedstorage.common.grid.screen.AbstractGridScreen;
import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen;

import java.util.function.Supplier;
import javax.annotation.Nullable;

import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.constants.RecipeTypes;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.registration.IGuiHandlerRegistration;
import mezz.jei.api.registration.IIngredientAliasRegistration;
import mezz.jei.api.registration.IRecipeTransferRegistration;
import mezz.jei.api.runtime.IJeiRuntime;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;

import static com.refinedmods.refinedstorage.jei.common.Common.MOD_ID;

@JeiPlugin
public class RefinedStorageModPlugin implements IModPlugin {
private static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath(Common.MOD_ID, "plugin");
private static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath(MOD_ID, "plugin");
@Nullable
private static IJeiRuntime runtime;

Expand All @@ -24,6 +31,15 @@ public ResourceLocation getPluginUid() {
return ID;
}

@Override
public void registerIngredientAliases(final IIngredientAliasRegistration registration) {
registration.addAliases(VanillaTypes.ITEM_STACK, Items.INSTANCE.getDiskInterfaces()
.stream()
.map(Supplier::get)
.map(Item::getDefaultInstance)
.toList(), "alias.%s.refinedstorage1_disk_manipulator".formatted(MOD_ID));
}

@Override
public void registerRecipeTransferHandlers(final IRecipeTransferRegistration registration) {
registration.addRecipeTransferHandler(new CraftingGridRecipeTransferHandler(), RecipeTypes.CRAFTING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"gui.refinedstorage_jei_integration.transfer.missing_but_some_autocraftable": "Missing items, some are autocraftable",
"gui.refinedstorage_jei_integration.transfer.ctrl_click_to_autocraft": "CTRL + click to autocraft",
"gui.refinedstorage_jei_integration.transfer.all_autocraftable": "All are autocraftable",
"gui.refinedstorage_jei_integration.transfer.some_autocraftable": "Some are autocraftable"
"gui.refinedstorage_jei_integration.transfer.some_autocraftable": "Some are autocraftable",
"alias.refinedstorage_jei_integration.refinedstorage1_disk_manipulator": "Disk Manipulator"
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"fabricloader": ">=0.14.6",
"fabric-api": "*",
"minecraft": "~1.21",
"refinedstorage": ">=2.0.0-milestone.4.7",
"refinedstorage": ">=2.0.0-milestone.4.8",
"jei": ">=19.20.0",
"java": ">=17"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ JEI integration for Refined Storage.
[[dependencies.refinedstorage_jei_integration]]
modId = "refinedstorage"
type = "required"
versionRange = "2.0.0-milestone.4.7"
versionRange = "2.0.0-milestone.4.8"
side = "BOTH"
[[dependencies.refinedstorage_jei_integration]]
modId = "jei"
Expand Down

0 comments on commit 05c38b2

Please sign in to comment.