diff options
| author | shedaniel <daniel@shedaniel.me> | 2024-04-25 22:29:22 +0900 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2024-04-25 22:29:22 +0900 |
| commit | d372f03dbec88fedb9e0e3cffb766c2bb3b0f8a4 (patch) | |
| tree | 0109ba9dace1b1ae12fa996bb292abca5be20a3b /neoforge/src | |
| parent | 1a86c46219b873313085ba384903b1077c832c4e (diff) | |
| download | RoughlyEnoughItems-d372f03dbec88fedb9e0e3cffb766c2bb3b0f8a4.tar.gz RoughlyEnoughItems-d372f03dbec88fedb9e0e3cffb766c2bb3b0f8a4.tar.bz2 RoughlyEnoughItems-d372f03dbec88fedb9e0e3cffb766c2bb3b0f8a4.zip | |
Update to 1.20.5
Diffstat (limited to 'neoforge/src')
| -rw-r--r-- | neoforge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java | 19 | ||||
| -rw-r--r-- | neoforge/src/main/resources/META-INF/accesstransformer.cfg | 6 |
2 files changed, 12 insertions, 13 deletions
diff --git a/neoforge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java b/neoforge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java index e379ff5a8..3131c2658 100644 --- a/neoforge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java +++ b/neoforge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java @@ -27,6 +27,7 @@ import com.google.gson.internal.LinkedTreeMap; import me.shedaniel.rei.api.client.registry.display.DisplayRegistry; import me.shedaniel.rei.plugin.client.BuiltinClientPlugin; import me.shedaniel.rei.plugin.client.DefaultClientPlugin; +import net.minecraft.client.Minecraft; import net.minecraft.core.Holder; import net.minecraft.core.component.DataComponents; import net.minecraft.world.item.Item; @@ -36,9 +37,7 @@ import net.minecraft.world.item.alchemy.PotionBrewing; import net.minecraft.world.item.alchemy.PotionContents; import net.minecraft.world.item.crafting.Ingredient; import net.neoforged.neoforge.common.brewing.BrewingRecipe; -import net.neoforged.neoforge.common.brewing.BrewingRecipeRegistry; import net.neoforged.neoforge.common.brewing.IBrewingRecipe; -import net.neoforged.neoforge.common.brewing.VanillaBrewingRecipe; import java.util.Arrays; import java.util.Collections; @@ -48,20 +47,20 @@ import java.util.Set; public class DefaultClientPluginImpl extends DefaultClientPlugin { @Override public void registerForgePotions(DisplayRegistry registry, BuiltinClientPlugin clientPlugin) { - for (IBrewingRecipe recipe : BrewingRecipeRegistry.getRecipes()) { - if (recipe instanceof VanillaBrewingRecipe) { - registerVanillaPotions(registry, clientPlugin); - } else if (recipe instanceof BrewingRecipe) { + PotionBrewing brewing = Minecraft.getInstance().level.potionBrewing(); + registerVanillaPotions(brewing, registry, clientPlugin); + for (IBrewingRecipe recipe : brewing.getRecipes()) { + if (recipe instanceof BrewingRecipe) { BrewingRecipe brewingRecipe = (BrewingRecipe) recipe; clientPlugin.registerBrewingRecipe(brewingRecipe.getInput(), brewingRecipe.getIngredient(), brewingRecipe.getOutput().copy()); } } } - private static void registerVanillaPotions(DisplayRegistry registry, BuiltinClientPlugin clientPlugin) { + private static void registerVanillaPotions(PotionBrewing brewing, DisplayRegistry registry, BuiltinClientPlugin clientPlugin) { Set<Holder<Potion>> potions = Collections.newSetFromMap(new LinkedTreeMap<>(Comparator.comparing(Holder::getRegisteredName), false)); - for (Ingredient container : PotionBrewing.ALLOWED_CONTAINERS) { - for (PotionBrewing.Mix<Potion> mix : PotionBrewing.POTION_MIXES) { + for (Ingredient container : brewing.containers) { + for (PotionBrewing.Mix<Potion> mix : brewing.potionMixes) { Holder<Potion> from = mix.from(); Ingredient ingredient = mix.ingredient; Holder<Potion> to = mix.to(); @@ -78,7 +77,7 @@ public class DefaultClientPluginImpl extends DefaultClientPlugin { } } for (Holder<Potion> potion : potions) { - for (PotionBrewing.Mix<Item> mix : PotionBrewing.CONTAINER_MIXES) { + for (PotionBrewing.Mix<Item> mix : brewing.containerMixes) { Holder<Item> from = mix.from(); Ingredient ingredient = mix.ingredient(); Holder<Item> to = mix.to(); diff --git a/neoforge/src/main/resources/META-INF/accesstransformer.cfg b/neoforge/src/main/resources/META-INF/accesstransformer.cfg index d3cd4b3a0..d1b35d717 100644 --- a/neoforge/src/main/resources/META-INF/accesstransformer.cfg +++ b/neoforge/src/main/resources/META-INF/accesstransformer.cfg @@ -14,9 +14,9 @@ public net.minecraft.client.gui.screens.recipebook.RecipeBookComponent tabButton public net.minecraft.client.StringSplitter widthProvider public net.minecraft.nbt.CompoundTag tags public net.minecraft.world.entity.player.Inventory compartments -public net.minecraft.world.item.alchemy.PotionBrewing ALLOWED_CONTAINERS -public net.minecraft.world.item.alchemy.PotionBrewing CONTAINER_MIXES -public net.minecraft.world.item.alchemy.PotionBrewing POTION_MIXES +public net.minecraft.world.item.alchemy.PotionBrewing containers +public net.minecraft.world.item.alchemy.PotionBrewing containerMixes +public net.minecraft.world.item.alchemy.PotionBrewing potionMixes public net.minecraft.world.item.alchemy.PotionBrewing$Mix from public net.minecraft.world.item.alchemy.PotionBrewing$Mix ingredient public net.minecraft.world.item.alchemy.PotionBrewing$Mix to |
