diff options
| author | Danielshe <shekwancheung0528@gmail.com> | 2019-11-06 21:40:11 +0800 |
|---|---|---|
| committer | Danielshe <shekwancheung0528@gmail.com> | 2019-11-06 21:40:15 +0800 |
| commit | 0cc101e5cb57e62674abe421983444f79ea630fc (patch) | |
| tree | b3d1c4c1853a3e9d60ae2857e7aa1b5430f2f559 /src | |
| parent | d26cb24ffffc1e6063a2dd1053ccbc886c60767f (diff) | |
| download | RoughlyEnoughItems-0cc101e5cb57e62674abe421983444f79ea630fc.tar.gz RoughlyEnoughItems-0cc101e5cb57e62674abe421983444f79ea630fc.tar.bz2 RoughlyEnoughItems-0cc101e5cb57e62674abe421983444f79ea630fc.zip | |
3.2.6
Diffstat (limited to 'src')
29 files changed, 145 insertions, 66 deletions
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java index dc65ed688..05588262e 100644 --- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java +++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java @@ -61,24 +61,28 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer { private static final DisplayHelper DISPLAY_HELPER = new DisplayHelperImpl(); private static final Map<Identifier, REIPluginEntry> plugins = Maps.newHashMap(); private static final ExecutorService SYNC_RECIPES = Executors.newSingleThreadScheduledExecutor(r -> new Thread(r, "REI-SyncRecipes")); - private static ConfigManagerImpl configManager; + private static ConfigManager configManager; static { LOGGER = LogManager.getFormatterLogger("REI"); } + @Deprecated public static RecipeHelper getRecipeHelper() { return RECIPE_HELPER; } + @Deprecated public static ConfigManager getConfigManager() { return configManager; } + @Deprecated public static EntryRegistry getEntryRegistry() { return ENTRY_REGISTRY; } + @Deprecated public static DisplayHelper getDisplayHelper() { return DISPLAY_HELPER; } diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java index 26b96e243..9369dc1be 100644 --- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java +++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java @@ -100,7 +100,6 @@ public class RoughlyEnoughItemsNetwork implements ModInitializer { } catch (Exception e) { e.printStackTrace(); } - // } }); FabricLoader.getInstance().getEntrypoints("rei_containers", Runnable.class).forEach(Runnable::run); } diff --git a/src/main/java/me/shedaniel/rei/api/ConfigManager.java b/src/main/java/me/shedaniel/rei/api/ConfigManager.java index e64d5df55..bd9ea38cb 100644 --- a/src/main/java/me/shedaniel/rei/api/ConfigManager.java +++ b/src/main/java/me/shedaniel/rei/api/ConfigManager.java @@ -5,6 +5,7 @@ package me.shedaniel.rei.api; +import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.zeroeightsix.fiber.exception.FiberException; import net.minecraft.client.gui.screen.Screen; @@ -12,6 +13,10 @@ import java.io.IOException; public interface ConfigManager { + static ConfigManager getInstance() { + return RoughlyEnoughItemsCore.getConfigManager(); + } + /** * Saves the config. * diff --git a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java index 2fe8be295..be6ed6a2f 100644 --- a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java +++ b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -16,6 +16,10 @@ import static net.minecraft.util.ActionResult.PASS; public interface DisplayHelper { + static DisplayHelper getInstance() { + return RoughlyEnoughItemsCore.getDisplayHelper(); + } + /** * Gets the sorted version of all responsible bounds handlers * diff --git a/src/main/java/me/shedaniel/rei/api/EntryRegistry.java b/src/main/java/me/shedaniel/rei/api/EntryRegistry.java index 338986578..03cf0c21e 100644 --- a/src/main/java/me/shedaniel/rei/api/EntryRegistry.java +++ b/src/main/java/me/shedaniel/rei/api/EntryRegistry.java @@ -5,6 +5,8 @@ package me.shedaniel.rei.api; +import me.shedaniel.rei.RoughlyEnoughItemsCore; +import me.shedaniel.rei.api.annotations.ToBeRemoved; import me.shedaniel.rei.utils.CollectionUtils; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -13,6 +15,10 @@ import java.util.List; public interface EntryRegistry { + static EntryRegistry getInstance() { + return RoughlyEnoughItemsCore.getEntryRegistry(); + } + /** * Gets the current modifiable stacks list * diff --git a/src/main/java/me/shedaniel/rei/api/EntryStack.java b/src/main/java/me/shedaniel/rei/api/EntryStack.java index 01fc901b4..905540d56 100644 --- a/src/main/java/me/shedaniel/rei/api/EntryStack.java +++ b/src/main/java/me/shedaniel/rei/api/EntryStack.java @@ -11,6 +11,7 @@ import me.shedaniel.rei.impl.EmptyEntryStack; import me.shedaniel.rei.impl.FluidEntryStack; import me.shedaniel.rei.impl.ItemEntryStack; import net.minecraft.block.Block; +import net.minecraft.client.resource.language.I18n; import net.minecraft.fluid.Fluid; import net.minecraft.item.Item; import net.minecraft.item.ItemConvertible; @@ -31,7 +32,7 @@ public interface EntryStack { } static EntryStack create(Fluid fluid) { - return create(fluid, 1000); + return new FluidEntryStack(fluid); } static EntryStack create(Fluid fluid, int amount) { @@ -46,10 +47,6 @@ public interface EntryStack { return new ItemEntryStack(new ItemStack(item)); } - static EntryStack create(Block block) { - return new ItemEntryStack(new ItemStack(block)); - } - Optional<Identifier> getIdentifier(); EntryStack.Type getType(); @@ -144,5 +141,13 @@ public interface EntryStack { private Item() { } } + + public static class Fluid { + // Return null to disable + public static final Settings<Function<EntryStack, String>> AMOUNT_TOOLTIP = new Settings<Function<EntryStack, String>>(stack -> I18n.translate("tooltip.rei.fluid_amount", stack.getAmount())); + + private Fluid() { + } + } } } diff --git a/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java b/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java index 8651c6751..cdc5574cf 100644 --- a/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java +++ b/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java @@ -5,6 +5,8 @@ package me.shedaniel.rei.api; +import net.fabricmc.loader.api.SemanticVersion; +import net.fabricmc.loader.util.version.VersionParsingException; import net.minecraft.util.Identifier; /** @@ -12,6 +14,10 @@ import net.minecraft.util.Identifier; */ public interface REIPluginEntry { + default SemanticVersion getMinimumVersion() throws VersionParsingException { + return null; + } + /** * Gets the priority of the plugin. * diff --git a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java index 82ed70eca..f212a3db2 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java @@ -8,7 +8,7 @@ package me.shedaniel.rei.api; import me.shedaniel.math.api.Rectangle; import me.shedaniel.rei.gui.RecipeViewingScreen; import me.shedaniel.rei.gui.entries.RecipeEntry; -import me.shedaniel.rei.gui.renderers.SimpleRecipeEntry; +import me.shedaniel.rei.gui.entries.SimpleRecipeEntry; import me.shedaniel.rei.gui.widget.CategoryBaseWidget; import me.shedaniel.rei.gui.widget.RecipeBaseWidget; import me.shedaniel.rei.gui.widget.Widget; diff --git a/src/main/java/me/shedaniel/rei/api/plugins/REIPluginV0.java b/src/main/java/me/shedaniel/rei/api/plugins/REIPluginV0.java index 22ad3af01..1c4a5c2a4 100644 --- a/src/main/java/me/shedaniel/rei/api/plugins/REIPluginV0.java +++ b/src/main/java/me/shedaniel/rei/api/plugins/REIPluginV0.java @@ -9,16 +9,17 @@ import me.shedaniel.rei.api.DisplayHelper; import me.shedaniel.rei.api.EntryRegistry; import me.shedaniel.rei.api.REIPluginEntry; import me.shedaniel.rei.api.RecipeHelper; +import me.shedaniel.rei.api.annotations.ToBeRemoved; import net.fabricmc.loader.api.SemanticVersion; import net.fabricmc.loader.util.version.VersionParsingException; public interface REIPluginV0 extends REIPluginEntry { - SemanticVersion getMinimumVersion() throws VersionParsingException; - /** * On register of the plugin */ + @ToBeRemoved + @Deprecated default void onFirstLoad() { } @@ -62,4 +63,10 @@ public interface REIPluginV0 extends REIPluginEntry { default void registerOthers(RecipeHelper recipeHelper) { } + default void preRegister() { + } + + default void postRegister() { + } + } diff --git a/src/main/java/me/shedaniel/rei/gui/renderers/SimpleRecipeEntry.java b/src/main/java/me/shedaniel/rei/gui/entries/SimpleRecipeEntry.java index c0682b226..97d5aab97 100644 --- a/src/main/java/me/shedaniel/rei/gui/renderers/SimpleRecipeEntry.java +++ b/src/main/java/me/shedaniel/rei/gui/entries/SimpleRecipeEntry.java @@ -3,12 +3,11 @@ * Licensed under the MIT License. */ -package me.shedaniel.rei.gui.renderers; +package me.shedaniel.rei.gui.entries; import com.google.common.collect.Lists; import me.shedaniel.math.api.Rectangle; import me.shedaniel.rei.api.EntryStack; -import me.shedaniel.rei.gui.entries.RecipeEntry; import me.shedaniel.rei.gui.widget.EntryWidget; import me.shedaniel.rei.gui.widget.QueuedTooltip; import me.shedaniel.rei.utils.CollectionUtils; diff --git a/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java b/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java index 816ec4d47..c9583dae7 100644 --- a/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java +++ b/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java @@ -37,9 +37,14 @@ import java.util.Optional; @Deprecated public class FluidEntryStack extends AbstractEntryStack { private static final Map<Fluid, Pair<Sprite, Integer>> FLUID_SPRITE_CACHE = new HashMap<>(); + private static final int EMPTY_AMOUNT = -1319182373; private Fluid fluid; private int amount; + public FluidEntryStack(Fluid fluid) { + this(fluid, EMPTY_AMOUNT); + } + public FluidEntryStack(Fluid fluid, int amount) { this.fluid = fluid; this.amount = amount; @@ -79,7 +84,7 @@ public class FluidEntryStack extends AbstractEntryStack { @Override public void setAmount(int amount) { - this.amount = Math.max(amount, 0); + this.amount = amount == EMPTY_AMOUNT ? EMPTY_AMOUNT : Math.max(amount, 0); if (isEmpty()) { fluid = Fluids.EMPTY; } @@ -87,7 +92,7 @@ public class FluidEntryStack extends AbstractEntryStack { @Override public boolean isEmpty() { - return amount <= 0 || fluid == Fluids.EMPTY; + return (amount != EMPTY_AMOUNT && amount <= 0) || fluid == Fluids.EMPTY; } @Override @@ -138,6 +143,10 @@ public class FluidEntryStack extends AbstractEntryStack { if (!getSetting(Settings.TOOLTIP_ENABLED).value().get() || isEmpty()) return null; List<String> toolTip = Lists.newArrayList(EntryListWidget.tryGetEntryStackName(this)); + if (amount >= 0) { + String amountTooltip = getSetting(Settings.Fluid.AMOUNT_TOOLTIP).value().apply(this); + if (amountTooltip != null) for (String s : amountTooltip.split("\n")) toolTip.add(s); + } toolTip.addAll(getSetting(Settings.TOOLTIP_APPEND_EXTRA).value().apply(this)); if (getSetting(Settings.TOOLTIP_APPEND_MOD).value().get() && RoughlyEnoughItemsCore.getConfigManager().getConfig().shouldAppendModNames()) { final String modString = ClientHelper.getInstance().getFormattedModFromIdentifier(Registry.FLUID.getId(fluid)); diff --git a/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java index 37480fdd3..fd013ae51 100644 --- a/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java +++ b/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java @@ -251,14 +251,25 @@ public class RecipeHelperImpl implements RecipeHelper { Version reiVersion = FabricLoader.getInstance().getModContainer("roughlyenoughitems").get().getMetadata().getVersion(); if (!(reiVersion instanceof SemanticVersion)) RoughlyEnoughItemsCore.LOGGER.warn("[REI] Roughly Enough Items is not using semantic versioning, will be ignoring plugins' minimum versions!"); - plugins.forEach(plugin -> { + for (REIPluginEntry plugin : plugins) { + try { + if (reiVersion instanceof SemanticVersion) + if (plugin.getMinimumVersion().compareTo((SemanticVersion) reiVersion) > 0) { + throw new IllegalStateException("Requires " + plugin.getMinimumVersion().getFriendlyString() + " version of REI!"); + } + if (plugin instanceof REIPluginV0) + ((REIPluginV0) plugin).preRegister(); + } catch (Exception e) { + RoughlyEnoughItemsCore.LOGGER.error("[REI] " + plugin.getPluginIdentifier().toString() + " plugin failed to pre register!", e); + } + } + for (REIPluginEntry plugin : plugins) { Identifier identifier = plugin.getPluginIdentifier(); try { + if (reiVersion instanceof SemanticVersion) + if (plugin.getMinimumVersion().compareTo((SemanticVersion) reiVersion) > 0) + return; if (plugin instanceof REIPluginV0) { - if (reiVersion instanceof SemanticVersion) - if (((REIPluginV0) plugin).getMinimumVersion().compareTo((SemanticVersion) reiVersion) > 0) { - throw new IllegalStateException("Requires " + ((REIPluginV0) plugin).getMinimumVersion().getFriendlyString() + " version of REI!"); - } ((REIPluginV0) plugin).registerBounds(RoughlyEnoughItemsCore.getDisplayHelper()); ((REIPluginV0) plugin).registerEntries(RoughlyEnoughItemsCore.getEntryRegistry()); ((REIPluginV0) plugin).registerPluginCategories(this); @@ -270,7 +281,18 @@ public class RecipeHelperImpl implements RecipeHelper { } catch (Exception e) { RoughlyEnoughItemsCore.LOGGER.error("[REI] " + identifier.toString() + " plugin failed to load!", e); } - }); + } + for (REIPluginEntry plugin : plugins) { + try { + if (reiVersion instanceof SemanticVersion) + if (plugin.getMinimumVersion().compareTo((SemanticVersion) reiVersion) > 0) + return; + if (plugin instanceof REIPluginV0) + ((REIPluginV0) plugin).postRegister(); + } catch (Exception e) { + RoughlyEnoughItemsCore.LOGGER.error("[REI] " + plugin.getPluginIdentifier().toString() + " plugin failed to post register!", e); + } + } if (!recipeFunctions.isEmpty()) { List<Recipe> allSortedRecipes = getAllSortedRecipes(); Collections.reverse(allSortedRecipes); diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java index ca3d49953..77a139f98 100644 --- a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java +++ b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java @@ -10,10 +10,7 @@ import com.google.common.collect.Maps; import it.unimi.dsi.fastutil.objects.Object2FloatMap; import me.shedaniel.math.api.Rectangle; import me.shedaniel.rei.RoughlyEnoughItemsCore; -import me.shedaniel.rei.api.DisplayHelper; -import me.shedaniel.rei.api.EntryRegistry; -import me.shedaniel.rei.api.EntryStack; -import me.shedaniel.rei.api.RecipeHelper; +import me.shedaniel.rei.api.*; import me.shedaniel.rei.api.plugins.REIPluginV0; import me.shedaniel.rei.gui.RecipeViewingScreen; import me.shedaniel.rei.gui.VillagerRecipeViewingScreen; @@ -47,10 +44,7 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.fluid.EmptyFluid; import net.minecraft.fluid.Fluid; -import net.minecraft.item.Item; -import net.minecraft.item.ItemConvertible; -import net.minecraft.item.ItemStack; -import net.minecraft.item.Items; +import net.minecraft.item.*; import net.minecraft.potion.PotionUtil; import net.minecraft.recipe.*; import net.minecraft.util.Identifier; @@ -95,7 +89,7 @@ public class DefaultPlugin implements REIPluginV0 { @Override public void registerEntries(EntryRegistry entryRegistry) { - if (!RoughlyEnoughItemsCore.getConfigManager().getConfig().isLoadingDefaultPlugin()) { + if (!ConfigManager.getInstance().getConfig().isLoadingDefaultPlugin()) { return; } for (Item item : Registry.ITEM) { @@ -124,7 +118,7 @@ public class DefaultPlugin implements REIPluginV0 { @Override public void registerPluginCategories(RecipeHelper recipeHelper) { - if (!RoughlyEnoughItemsCore.getConfigManager().getConfig().isLoadingDefaultPlugin()) { + if (!ConfigManager.getInstance().getConfig().isLoadingDefaultPlugin()) { return; } recipeHelper.registerCategory(new DefaultCraftingCategory()); @@ -140,7 +134,7 @@ public class DefaultPlugin implements REIPluginV0 { @Override public void registerRecipeDisplays(RecipeHelper recipeHelper) { - if (!RoughlyEnoughItemsCore.getConfigManager().getConfig().isLoadingDefaultPlugin()) { + if (!ConfigManager.getInstance().getConfig().isLoadingDefaultPlugin()) { return; } recipeHelper.registerRecipes(CRAFTING, ShapelessRecipe.class, DefaultShapelessDisplay::new); @@ -154,7 +148,7 @@ public class DefaultPlugin implements REIPluginV0 { recipeHelper.registerDisplay(BREWING, display); } List<EntryStack> arrowStack = Collections.singletonList(EntryStack.create(Items.ARROW)); - for (EntryStack entry : RoughlyEnoughItemsCore.getEntryRegistry().getStacksList()) { + for (EntryStack entry : EntryRegistry.getInstance().getStacksList()) { if (entry.getItem() == Items.LINGERING_POTION) { List<List<EntryStack>> input = new ArrayList<>(); for (int i = 0; i < 4; i++) @@ -193,8 +187,32 @@ public class DefaultPlugin implements REIPluginV0 { } @Override + public void postRegister() { + // Sit tight! This will be a fast journey! + long time = System.currentTimeMillis(); + for (EntryStack stack : EntryRegistry.getInstance().getStacksList()) + applyPotionTransformer(stack); + for (List<RecipeDisplay> displays : RecipeHelper.getInstance().getAllRecipes().values()) { + for (RecipeDisplay display : displays) { + for (List<EntryStack> entries : display.getInputEntries()) + for (EntryStack stack : entries) + applyPotionTransformer(stack); + for (EntryStack stack : display.getOutputEntries()) + applyPotionTransformer(stack); + } + } + time = System.currentTimeMillis() - time; + RoughlyEnoughItemsCore.LOGGER.info("[REI] Applied Check Tags for potion in %dms.", time); + } + + private void applyPotionTransformer(EntryStack stack) { + if (stack.getItem() instanceof PotionItem) + stack.addSetting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE); + } + + @Override public void registerBounds(DisplayHelper displayHelper) { - if (!RoughlyEnoughItemsCore.getConfigManager().getConfig().isLoadingDefaultPlugin()) { + if (!ConfigManager.getInstance().getConfig().isLoadingDefaultPlugin()) { return; } displayHelper.getBaseBoundsHandler().registerExclusionZones(AbstractInventoryScreen.class, new DefaultPotionEffectExclusionZones()); @@ -269,7 +287,7 @@ public class DefaultPlugin implements REIPluginV0 { @Override public void registerOthers(RecipeHelper recipeHelper) { - if (!RoughlyEnoughItemsCore.getConfigManager().getConfig().isLoadingDefaultPlugin()) { + if (!ConfigManager.getInstance().getConfig().isLoadingDefaultPlugin()) { return; } recipeHelper.registerWorkingStations(CRAFTING, EntryStack.create(Items.CRAFTING_TABLE)); diff --git a/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java b/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java index 5516c0560..21ca07b14 100644 --- a/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java +++ b/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java @@ -11,7 +11,6 @@ import me.shedaniel.rei.api.RecipeDisplay; import me.shedaniel.rei.plugin.DefaultPlugin; import net.minecraft.client.resource.language.I18n; import net.minecraft.item.ItemStack; -import net.minecraft.item.PotionItem; import net.minecraft.recipe.Ingredient; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; @@ -27,19 +26,13 @@ public class DefaultBrewingDisplay implements RecipeDisplay { public DefaultBrewingDisplay(ItemStack input, Ingredient reactant, ItemStack output) { this.input = EntryStack.create(input).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.brewing.input"))); - if (this.input.getItem() instanceof PotionItem) - this.input = this.input.setting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE); this.reactant = new ArrayList<>(); for (ItemStack stack : reactant.getMatchingStacksClient()) { EntryStack entryStack = EntryStack.create(stack); - if (stack.getItem() instanceof PotionItem) - entryStack.setting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE); entryStack.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, s -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.brewing.reactant"))); this.reactant.add(entryStack); } this.output = EntryStack.create(output).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.brewing.result"))); - if (this.output.getItem() instanceof PotionItem) - this.output = this.output.setting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE); } @Override diff --git a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java index bb11a8447..8165f0a7a 100644 --- a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java +++ b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java @@ -12,7 +12,7 @@ import me.shedaniel.math.api.Rectangle; import me.shedaniel.rei.api.EntryStack; import me.shedaniel.rei.api.TransferRecipeCategory; import me.shedaniel.rei.gui.entries.RecipeEntry; -import me.shedaniel.rei.gui.renderers.SimpleRecipeEntry; +import me.shedaniel.rei.gui.entries.SimpleRecipeEntry; import me.shedaniel.rei.gui.widget.EntryWidget; import me.shedaniel.rei.gui.widget.RecipeArrowWidget; import me.shedaniel.rei.gui.widget.RecipeBaseWidget; diff --git a/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapedDisplay.java b/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapedDisplay.java index 7858e3f31..b470d5574 100644 --- a/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapedDisplay.java +++ b/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapedDisplay.java @@ -7,7 +7,6 @@ package me.shedaniel.rei.plugin.crafting; import me.shedaniel.rei.api.EntryStack; import net.minecraft.item.ItemStack; -import net.minecraft.item.PotionItem; import net.minecraft.recipe.Recipe; import net.minecraft.recipe.ShapedRecipe; import net.minecraft.util.Identifier; @@ -29,15 +28,11 @@ public class DefaultShapedDisplay implements DefaultCraftingDisplay { this.input = recipe.getPreviewInputs().stream().map(i -> { List<EntryStack> entries = new ArrayList<>(); for (ItemStack stack : i.getMatchingStacksClient()) { - if (stack.getItem() instanceof PotionItem) - entries.add(EntryStack.create(stack).setting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE)); - else entries.add(EntryStack.create(stack)); + entries.add(EntryStack.create(stack)); } return entries; }).collect(Collectors.toList()); - if (recipe.getOutput().getItem() instanceof PotionItem) - this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()).setting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE)); - else this.output = Collections.singletonList(EntryStack.create(recipe.getOutput())); + this.output = Collections.singletonList(EntryStack.create(recipe.getOutput())); } @Override diff --git a/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapelessDisplay.java b/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapelessDisplay.java index 65fbd5fd7..c62708323 100644 --- a/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapelessDisplay.java +++ b/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapelessDisplay.java @@ -7,7 +7,6 @@ package me.shedaniel.rei.plugin.crafting; import me.shedaniel.rei.api.EntryStack; import net.minecraft.item.ItemStack; -import net.minecraft.item.PotionItem; import net.minecraft.recipe.Recipe; import net.minecraft.recipe.ShapelessRecipe; import net.minecraft.util.Identifier; @@ -29,15 +28,11 @@ public class DefaultShapelessDisplay implements DefaultCraftingDisplay { this.input = recipe.getPreviewInp |
