From 73dd8da0bdda912c7482b34fb0dc4f2d680005bc Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sun, 5 Nov 2023 21:59:21 +0800 Subject: Fix cherrypick --- .../shedaniel/rei/plugin/client/DefaultClientPlugin.java | 14 +++++++------- .../crafting/filler/FireworkRocketRecipeFiller.java | 4 ++-- .../crafting/filler/MapExtendingRecipeFiller.java | 8 ++++---- .../crafting/filler/ShieldDecorationRecipeFiller.java | 5 +++-- .../crafting/filler/SuspiciousStewRecipeFiller.java | 4 ++-- 5 files changed, 18 insertions(+), 17 deletions(-) (limited to 'default-plugin') diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java index 98fc53f73..239b95e2e 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java @@ -160,19 +160,19 @@ public class DefaultClientPlugin implements REIClientPlugin, BuiltinClientPlugin @Override public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) { - registry.group(new ResourceLocation("roughlyenoughitems", "enchanted_book"), new TranslatableComponent("item.minecraft.enchanted_book"), + registry.group(new ResourceLocation("roughlyenoughitems", "enchanted_book"), Component.translatable("item.minecraft.enchanted_book"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.ENCHANTED_BOOK)); - registry.group(new ResourceLocation("roughlyenoughitems", "potion"), new TranslatableComponent("item.minecraft.potion"), + registry.group(new ResourceLocation("roughlyenoughitems", "potion"), Component.translatable("item.minecraft.potion"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.POTION)); - registry.group(new ResourceLocation("roughlyenoughitems", "splash_potion"), new TranslatableComponent("item.minecraft.splash_potion"), + registry.group(new ResourceLocation("roughlyenoughitems", "splash_potion"), Component.translatable("item.minecraft.splash_potion"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.SPLASH_POTION)); - registry.group(new ResourceLocation("roughlyenoughitems", "lingering_potion"), new TranslatableComponent("item.minecraft.lingering_potion"), + registry.group(new ResourceLocation("roughlyenoughitems", "lingering_potion"), Component.translatable("item.minecraft.lingering_potion"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.LINGERING_POTION)); - registry.group(new ResourceLocation("roughlyenoughitems", "spawn_egg"), new TranslatableComponent("text.rei.spawn_egg"), + registry.group(new ResourceLocation("roughlyenoughitems", "spawn_egg"), Component.translatable("text.rei.spawn_egg"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().getItem() instanceof SpawnEggItem); - registry.group(new ResourceLocation("roughlyenoughitems", "tipped_arrow"), new TranslatableComponent("item.minecraft.tipped_arrow"), + registry.group(new ResourceLocation("roughlyenoughitems", "tipped_arrow"), Component.translatable("item.minecraft.tipped_arrow"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().is(Items.TIPPED_ARROW)); - registry.group(new ResourceLocation("roughlyenoughitems", "music_disc"), new TranslatableComponent("text.rei.music_disc"), + registry.group(new ResourceLocation("roughlyenoughitems", "music_disc"), Component.translatable("text.rei.music_disc"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.castValue().getItem() instanceof RecordItem); } diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/FireworkRocketRecipeFiller.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/FireworkRocketRecipeFiller.java index 90357ca88..d4a689df1 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/FireworkRocketRecipeFiller.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/FireworkRocketRecipeFiller.java @@ -31,7 +31,7 @@ import me.shedaniel.rei.api.common.util.EntryIngredients; import me.shedaniel.rei.api.common.util.EntryStacks; import me.shedaniel.rei.plugin.common.displays.crafting.DefaultCustomShapelessDisplay; import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.FireworkRocketRecipe; @@ -72,7 +72,7 @@ public class FireworkRocketRecipeFiller implements CraftingRecipeFiller { - widgets.add(createInfoWidget(bounds, display, new TranslatableComponent("text.rei.crafting.firework.gunpowder.amount"))); + widgets.add(createInfoWidget(bounds, display, Component.translatable("text.rei.crafting.firework.gunpowder.amount"))); }); } } diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/MapExtendingRecipeFiller.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/MapExtendingRecipeFiller.java index 34a892e69..f5771ce5b 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/MapExtendingRecipeFiller.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/MapExtendingRecipeFiller.java @@ -30,7 +30,7 @@ import me.shedaniel.rei.api.common.util.EntryIngredients; import me.shedaniel.rei.plugin.common.displays.crafting.DefaultCustomDisplay; import net.minecraft.ChatFormatting; import net.minecraft.client.resources.language.I18n; -import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.network.chat.Component; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.MapExtendingRecipe; @@ -75,9 +75,9 @@ public class MapExtendingRecipeFiller implements CraftingRecipeFiller[] allPatterns = Registry.BANNER_PATTERN.holders().toArray(Holder[]::new); for (int j = 0; j < 2; j++) { - BannerPattern pattern = allPatterns[random.nextInt(allPatterns.length - 1) + 1]; + Holder pattern = allPatterns[random.nextInt(allPatterns.length - 1) + 1]; patternBuilder.addPattern(pattern, colors[random.nextInt(colors.length)]); } ItemStack banner = new ItemStack(bannerOptional.get()); diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/SuspiciousStewRecipeFiller.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/SuspiciousStewRecipeFiller.java index bfd82e763..fab4e4e70 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/SuspiciousStewRecipeFiller.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/SuspiciousStewRecipeFiller.java @@ -27,7 +27,7 @@ import me.shedaniel.rei.api.client.registry.category.CategoryRegistry; import me.shedaniel.rei.api.common.display.Display; import me.shedaniel.rei.api.common.util.EntryIngredients; import me.shedaniel.rei.plugin.common.displays.crafting.DefaultCustomShapelessDisplay; -import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.network.chat.Component; import net.minecraft.tags.ItemTags; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.SuspiciousStewRecipe; @@ -57,7 +57,7 @@ public class SuspiciousStewRecipeFiller implements CraftingRecipeFiller { - widgets.add(createInfoWidget(bounds, display, new TranslatableComponent("text.rei.crafting.suspicious_stew"))); + widgets.add(createInfoWidget(bounds, display, Component.translatable("text.rei.crafting.suspicious_stew"))); }); } } -- cgit