diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-11-21 11:49:06 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-11-21 19:05:46 +0800 |
| commit | 30eb93c91f00c6cf8a3809ff72fa9bedaaebbc92 (patch) | |
| tree | 70b0d086a0fef306250aeddc8197a464567e6d5a /forge/src/main | |
| parent | 8203246cb37dff7ef0871ad03ab49b271727abfd (diff) | |
| download | RoughlyEnoughItems-30eb93c91f00c6cf8a3809ff72fa9bedaaebbc92.tar.gz RoughlyEnoughItems-30eb93c91f00c6cf8a3809ff72fa9bedaaebbc92.tar.bz2 RoughlyEnoughItems-30eb93c91f00c6cf8a3809ff72fa9bedaaebbc92.zip | |
Fix EnderStorage recipes
Diffstat (limited to 'forge/src/main')
| -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; + } +} |
