diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-11-21 11:49:06 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-11-21 11:49:06 +0800 |
| commit | 49e2087ffaae1fca37e3a76a7a486bfbe133ab36 (patch) | |
| tree | 8ad1f1d47e6534e7ff96ac5a5f00e5f20a104d3f /forge/src/main/java | |
| parent | b8683fae824221c2dc83db492c68a6cd49841c3d (diff) | |
| download | RoughlyEnoughItems-49e2087ffaae1fca37e3a76a7a486bfbe133ab36.tar.gz RoughlyEnoughItems-49e2087ffaae1fca37e3a76a7a486bfbe133ab36.tar.bz2 RoughlyEnoughItems-49e2087ffaae1fca37e3a76a7a486bfbe133ab36.zip | |
Fix EnderStorage recipes
Diffstat (limited to 'forge/src/main/java')
| -rw-r--r-- | forge/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/forge/DefaultCraftingDisplayImpl.java | 38 |
1 files changed, 38 insertions, 0 deletions
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<Integer, Integer> getSize(Recipe<?> recipe) { + if (recipe instanceof IShapedRecipe) { + return Pair.of(((IShapedRecipe<?>) recipe).getRecipeWidth(), ((IShapedRecipe<?>) recipe).getRecipeHeight()); + } + + return null; + } +} |
