From 30eb93c91f00c6cf8a3809ff72fa9bedaaebbc92 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sun, 21 Nov 2021 11:49:06 +0800 Subject: Fix EnderStorage recipes --- forge/build.gradle | 2 ++ .../crafting/forge/DefaultCraftingDisplayImpl.java | 38 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 forge/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/forge/DefaultCraftingDisplayImpl.java (limited to 'forge') diff --git a/forge/build.gradle b/forge/build.gradle index 4c13b0d67..ed93685d4 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -99,6 +99,8 @@ dependencies { // modRuntime("curse.maven:cofh-core-69162:3407019") // modRuntime("curse.maven:advanced-peripherals-431725:3525665") // modRuntime("curse.maven:cc-tweaked-282001:3434680") + // modRuntime("curse.maven:ender-storage-245174:3361748") + // modRuntime("curse.maven:codechicken-242818:3528603") } shadowJar { diff --git a/forge/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/forge/DefaultCraftingDisplayImpl.java b/forge/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/forge/DefaultCraftingDisplayImpl.java new file mode 100644 index 000000000..fe2b36fcc --- /dev/null +++ b/forge/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/forge/DefaultCraftingDisplayImpl.java @@ -0,0 +1,38 @@ +/* + * This file is licensed under the MIT License, part of Roughly Enough Items. + * Copyright (c) 2018, 2019, 2020, 2021 shedaniel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package me.shedaniel.rei.plugin.common.displays.crafting.forge; + +import net.minecraft.world.item.crafting.Recipe; +import net.minecraftforge.common.crafting.IShapedRecipe; +import org.apache.commons.lang3.tuple.Pair; + +public class DefaultCraftingDisplayImpl { + public static Pair getSize(Recipe recipe) { + if (recipe instanceof IShapedRecipe) { + return Pair.of(((IShapedRecipe) recipe).getRecipeWidth(), ((IShapedRecipe) recipe).getRecipeHeight()); + } + + return null; + } +} -- cgit