diff options
21 files changed, 232 insertions, 109 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Tooltip.java b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Tooltip.java index 099061658..919644e09 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Tooltip.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Tooltip.java @@ -26,6 +26,7 @@ package me.shedaniel.rei.api.client.gui.widgets; import dev.architectury.utils.EnvExecutor; import me.shedaniel.math.Point; import me.shedaniel.rei.api.client.REIRuntime; +import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.api.common.util.CollectionUtils; import me.shedaniel.rei.impl.ClientInternals; import net.fabricmc.api.EnvType; @@ -128,6 +129,10 @@ public interface Tooltip { return this; } + EntryStack<?> getContextStack(); + + Tooltip withContextStack(EntryStack<?> stack); + default void queue() { EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> REIRuntime.getInstance().queueTooltip(this)); } diff --git a/build.gradle b/build.gradle index e16f723dc..c888cb901 100755 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id("architectury-plugin") version("3.2-SNAPSHOT") - id("dev.architectury.loom") version("0.9.0-SNAPSHOT") apply false + id("architectury-plugin") version("3.3-SNAPSHOT") + id("dev.architectury.loom") version("0.7.4-SNAPSHOT") apply false id("org.cadixdev.licenser") version("0.5.0") id("com.matthewprenger.cursegradle") version("1.4.0") id("java") diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/recipebook/DefaultRecipeBookHandler.java index 6406429d1..9de8162ae 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/recipebook/DefaultRecipeBookHandler.java @@ -21,7 +21,7 @@ * SOFTWARE. */ -package me.shedaniel.rei.plugin.autocrafting; +package me.shedaniel.rei.plugin.autocrafting.recipebook; import me.shedaniel.rei.api.client.ClientHelper; import me.shedaniel.rei.api.client.registry.transfer.TransferHandler; 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 ae38726c3..2bb9c0925 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 @@ -48,7 +48,7 @@ import me.shedaniel.rei.api.common.util.CollectionUtils; import me.shedaniel.rei.api.common.util.EntryIngredients; import me.shedaniel.rei.api.common.util.EntryStacks; import me.shedaniel.rei.impl.ClientInternals; -import me.shedaniel.rei.plugin.autocrafting.DefaultRecipeBookHandler; +import me.shedaniel.rei.plugin.autocrafting.recipebook.DefaultRecipeBookHandler; import me.shedaniel.rei.plugin.client.categories.*; import me.shedaniel.rei.plugin.client.categories.beacon.DefaultBeaconBaseCategory; import me.shedaniel.rei.plugin.client.categories.beacon.DefaultBeaconPaymentCategory; diff --git a/fabric/src/main/java/me/shedaniel/rei/impl/client/gui/fabric/ScreenOverlayImplImpl.java b/fabric/src/main/java/me/shedaniel/rei/impl/client/gui/fabric/ScreenOverlayImplImpl.java new file mode 100644 index 000000000..2e25b84b4 --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/rei/impl/client/gui/fabric/ScreenOverlayImplImpl.java @@ -0,0 +1,72 @@ +/* + * 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.impl.client.gui.fabric; + +import com.mojang.blaze3d.vertex.PoseStack; +import me.shedaniel.rei.api.client.gui.widgets.Tooltip; +import me.shedaniel.rei.impl.ClientInternals; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.locale.Language; +import net.minecraft.network.chat.Style; +import net.minecraft.world.inventory.tooltip.TooltipComponent; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class ScreenOverlayImplImpl { + public static void renderTooltipInner(Screen screen, PoseStack matrices, Tooltip tooltip, int mouseX, int mouseY) { + List<ClientTooltipComponent> lines = tooltip.entries().stream() + .flatMap(component -> { + if (component.isText()) { + return Minecraft.getInstance().font.getSplitter().splitLines(component.getAsText(), 100000, Style.EMPTY).stream() + .map(Language.getInstance()::getVisualOrder) + .map(ClientTooltipComponent::create); + } else { + return Stream.of(component.getAsComponent()); + } + }) + .collect(Collectors.toList()); + for (TooltipComponent component : tooltip.components()) { + try { + ClientInternals.getClientTooltipComponent(lines, component); + } catch (Throwable exception) { + throw new IllegalArgumentException("Failed to add tooltip component! " + component + ", Class: " + (component == null ? null : component.getClass().getCanonicalName()), exception); + } + } + renderTooltipInner(matrices, lines, tooltip.getX(), tooltip.getY()); + } + + public static void renderTooltipInner(PoseStack matrices, List<ClientTooltipComponent> lines, int mouseX, int mouseY) { + if (lines.isEmpty()) { + return; + } + matrices.pushPose(); + matrices.translate(0, 0, 500); + Minecraft.getInstance().screen.renderTooltipInternal(matrices, lines, mouseX, mouseY); + matrices.popPose(); + } +} diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 4c417b3af..75b337f06 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -24,9 +24,9 @@ ], "rei": [ "me.shedaniel.rei.plugin.common.DefaultPlugin", - "me.shedaniel.rei.plugin.common.DefaultRuntimePlugin", + "me.shedaniel.rei.plugin.common.runtime.DefaultRuntimePlugin", "me.shedaniel.rei.plugin.client.DefaultClientPlugin", - "me.shedaniel.rei.plugin.client.DefaultClientRuntimePlugin" + "me.shedaniel.rei.plugin.client.runtime.DefaultClientRuntimePlugin" ] }, "accessWidener": "roughlyenoughitems.accessWidener", diff --git a/forge/build.gradle b/forge/build.gradle index 031a5db6f..8f6f01ea8 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,5 +1,5 @@ plugins { - id "com.github.johnrengelman.shadow" version "5.0.0" + id "com.github.johnrengelman.shadow" version "7.0.0" } configurations { @@ -33,35 +33,35 @@ repositories { dependencies { forge("net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}") modApi("me.shedaniel.cloth:cloth-config-forge:${cloth_config_version}") - modApi("me.shedaniel:architectury-forge:${architectury_version}") + modApi("dev.architectury:architectury-forge:${architectury_version}") implementation(project(path: ":api")) { transitive = false } implementation(project(path: ":default-plugin")) { transitive = false } implementation(project(path: ":runtime")) { transitive = false } implementation(project(path: ":jei-compatibility-layer")) { transitive = false } - implementation(project(path: ":jei-internals-workaround")) { transitive = false } + // implementation(project(path: ":jei-internals-workaround")) { transitive = false } developmentForge(project(path: ":api")) { transitive = false } developmentForge(project(path: ":default-plugin")) { transitive = false } developmentForge(project(path: ":runtime")) { transitive = false } developmentForge(project(path: ":jei-compatibility-layer")) { transitive = false } - developmentForge(project(path: ":jei-internals-workaround")) { transitive = false } + // developmentForge(project(path: ":jei-internals-workaround")) { transitive = false } shadowCommon(project(path: ":api", configuration: "transformProductionForge")) { transitive = false } shadowCommon(project(path: ":default-plugin", configuration: "transformProductionForge")) { transitive = false } shadowCommon(project(path: ":runtime", configuration: "transformProductionForge")) { transitive = false } shadowCommon(project(path: ":jei-compatibility-layer")) { transitive = false } - modRuntime("curse.maven:chiselsbits-231095:3176033") - modRuntime("curse.maven:jumbofurnace-390880:3120970") - modRuntime("curse.maven:cyclic-239286:3221427") - modRuntime("curse.maven:mekanism-268560:3206392") - modRuntime("curse.maven:refined-storage-243076:3196167") - modRuntime("appeng:appliedenergistics2:8.2.0") - modRuntime("curse.maven:tcon-74072:3273213") - modRuntime("curse.maven:mantle-74924:3273201") - modRuntime("curse.maven:jer-240630:3066754") - modRuntime("curse.maven:jep-417645:3198370") - modRuntime("curse.maven:simple-storage-network-268495:3257204") + // modRuntime("curse.maven:chiselsbits-231095:3176033") + // modRuntime("curse.maven:jumbofurnace-390880:3120970") + // modRuntime("curse.maven:cyclic-239286:3221427") + // modRuntime("curse.maven:mekanism-268560:3206392") + // modRuntime("curse.maven:refined-storage-243076:3196167") + // modRuntime("appeng:appliedenergistics2:8.2.0") + // modRuntime("curse.maven:tcon-74072:3273213") + // modRuntime("curse.maven:mantle-74924:3273201") + // modRuntime("curse.maven:jer-240630:3066754") + // modRuntime("curse.maven:jep-417645:3198370") + // modRuntime("curse.maven:simple-storage-network-268495:3257204") } shadowJar { @@ -84,11 +84,11 @@ curseforge { apiKey = project.hasProperty('danielshe_curse_api_key') ? project.property('danielshe_curse_api_key') : System.getenv('danielshe_curse_api_key') project { id = "392060" - releaseType = "beta" + releaseType = "release" changelogType = "html" changelog = rootProject.releaseChangelog - addGameVersion "1.16.4" - addGameVersion "1.16.5" + addGameVersion "1.17" + addGameVersion "1.17.1" addGameVersion "Java 8" addGameVersion "Forge" relations { diff --git a/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java b/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java index e299054c0..8ee7a0a99 100644 --- a/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java +++ b/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java @@ -32,8 +32,9 @@ import me.shedaniel.rei.api.common.plugins.REIServerPlugin; import me.shedaniel.rei.impl.ClientInternals; import me.shedaniel.rei.jeicompat.JEIPluginDetector; import me.shedaniel.rei.plugin.client.DefaultClientPlugin; -import me.shedaniel.rei.plugin.client.DefaultClientRuntimePlugin; +import me.shedaniel.rei.plugin.client.runtime.DefaultClientRuntimePlugin; import me.shedaniel.rei.plugin.common.DefaultPlugin; +import me.shedaniel.rei.plugin.common.runtime.DefaultRuntimePlugin; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @@ -69,6 +70,7 @@ public class PluginDetectorImpl { public static void detectServerPlugins() { PluginView.getServerInstance().registerPlugin(wrapPlugin(Collections.singletonList("roughlyenoughitems"), new DefaultPlugin())); + PluginView.getServerInstance().registerPlugin(wrapPlugin(Collections.singletonList("roughlyenoughitems"), new DefaultRuntimePlugin())); RoughlyEnoughItemsForge.<REIPlugin, REIServerPlugin>scanAnnotation(REIPlugin.class, REIServerPlugin.class::isAssignableFrom, (modId, plugin) -> { ((PluginView<REIServerPlugin>) PluginManager.getServerInstance()).registerPlugin(wrapPlugin(modId, plugin.get())); }); diff --git a/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java b/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java index 61593fd84..db5da78bd 100644 --- a/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java +++ b/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java @@ -67,21 +67,21 @@ public class RoughlyEnoughItemsForge { .map(IModInfo::getModId) .collect(Collectors.toList()); for (ModFileScanData.AnnotationData annotation : data.getAnnotations()) { - if (annotationType.equals(annotation.getAnnotationType())) { + if (annotationType.equals(annotation.targetType())) { try { - Class<T> clazz = (Class<T>) Class.forName(annotation.getMemberName()); + Class<T> clazz = (Class<T>) Class.forName(annotation.memberName()); if (predicate.test(clazz)) { instances.add(new ImmutablePair<>(modIds, () -> { try { return clazz.getDeclaredConstructor().newInstance(); } catch (Throwable throwable) { - LOGGER.error("Failed to load plugin: " + annotation.getMemberName(), throwable); + LOGGER.error("Failed to load plugin: " + annotation.memberName(), throwable); return null; } })); } } catch (Throwable throwable) { - LOGGER.error("Failed to load plugin: " + annotation.getMemberName(), throwable); + LOGGER.error("Failed to load plugin: " + annotation.memberName(), throwable); } } } diff --git a/forge/src/main/java/me/shedaniel/rei/impl/client/gui/forge/ScreenOverlayImplImpl.java b/forge/src/main/java/me/shedaniel/rei/impl/client/gui/forge/ScreenOverlayImplImpl.java new file mode 100644 index 000000000..1b27ecf80 --- /dev/null +++ b/forge/src/main/java/me/shedaniel/rei/impl/client/gui/forge/ScreenOverlayImplImpl.java @@ -0,0 +1,45 @@ +/* + * 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.impl.client.gui.forge; + +import com.mojang.blaze3d.vertex.PoseStack; +import me.shedaniel.rei.api.client.gui.widgets.Tooltip; +import me.shedaniel.rei.api.common.entry.EntryStack; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.fmlclient.gui.GuiUtils; + +public class ScreenOverlayImplImpl { + public static void renderTooltipInner(Screen screen, PoseStack matrices, Tooltip tooltip, int mouseX, int mouseY) { + matrices.pushPose(); + matrices.translate(0, 0, 500); + EntryStack<?> stack = tooltip.getContextStack(); + ItemStack itemStack = stack.getValue() instanceof ItemStack ? stack.castValue() : ItemStack.EMPTY; + GuiUtils.preItemToolTip(itemStack); + GuiUtils.drawHoveringText(matrices, tooltip.getText(), mouseX, mouseY, screen.width, screen.height, screen.width, Minecraft.getInstance().font); + GuiUtils.postItemToolTip(); + matrices.popPose(); + } +} diff --git a/forge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java b/forge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java index 7c47d1c84..9ad85f452 100644 --- a/forge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java +++ b/forge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java @@ -42,9 +42,9 @@ public class DefaultClientPluginImpl { Set<Potion> potions = Sets.newLinkedHashSet(); for (Ingredient container : PotionBrewing.ALLOWED_CONTAINERS) { for (PotionBrewing.Mix<Potion> mix : PotionBrewing.POTION_MIXES) { - IRegistryDelegate<Potion> from = mix.from; + IRegistryDelegate<Potion> from = mix.f_43532_; Ingredient ingredient = mix.ingredient; - IRegistryDelegate<Potion> to = mix.to; + IRegistryDelegate<Potion> to = mix.f_43534_; Ingredient base = Ingredient.of(Arrays.stream(container.getItems()) .map(ItemStack::copy) .map(stack -> PotionUtils.setPotion(stack, from.get()))); @@ -59,9 +59,9 @@ public class DefaultClientPluginImpl { } for (Potion potion : potions) { for (PotionBrewing.Mix<Item> mix : PotionBrewing.CONTAINER_MIXES) { - IRegistryDelegate<Item> from = mix.from; + IRegistryDelegate<Item> from = mix.f_43532_; Ingredient ingredient = mix.ingredient; - IRegistryDelegate<Item> to = mix.to; + IRegistryDelegate<Item> to = mix.f_43534_; Ingredient base = Ingredient.of(PotionUtils.setPotion(new ItemStack(from.get()), potion)); ItemStack output = PotionUtils.setPotion(new ItemStack(to.get()), potion); clientPlugin.registerBrewingRecipe(base, ingredient, output); diff --git a/forge/src/main/java/me/shedaniel/rei/plugin/common/forge/DefaultPluginImpl.java b/forge/src/main/java/me/shedaniel/rei/plugin/common/forge/DefaultPluginImpl.java index bc7780d11..cc87da5b9 100644 --- a/forge/src/main/java/me/shedaniel/rei/plugin/common/forge/DefaultPluginImpl.java +++ b/forge/src/main/java/me/shedaniel/rei/plugin/common/forge/DefaultPluginImpl.java @@ -24,10 +24,10 @@ package me.shedaniel.rei.plugin.common.forge; import com.google.common.base.Predicates; -import dev.architectury.hooks.forge.FluidStackHooksForge; +import dev.architectury.event.CompoundEventResult; +import dev.architectury.hooks.fluid.forge.FluidStackHooksForge; import me.shedaniel.rei.api.common.fluid.FluidSupportProvider; import me.shedaniel.rei.api.common.util.EntryStacks; -import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.item.ItemStack; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.fluids.FluidStack; @@ -44,7 +44,7 @@ public class DefaultPluginImpl { if (handlerOptional.isPresent()) { IFluidHandlerItem handler = handlerOptional.orElse(null); if (handler.getTanks() > 0) { - return InteractionResultHolder.success(IntStream.range(0, handler.getTanks()) + return CompoundEventResult.interruptTrue(IntStream.range(0, handler.getTanks()) .mapToObj(handler::getFluidInTank) .filter(Predicates.not(FluidStack::isEmpty)) .map(FluidStackHooksForge::fromForge) @@ -52,7 +52,7 @@ public class DefaultPluginImpl { } } - return InteractionResultHolder.pass(null); + return CompoundEventResult.pass(); }); } } diff --git a/forge/src/main/resources/META-INF/accesstransformer.cfg b/forge/src/main/resources/META-INF/accesstransformer.cfg index 572494c09..908d28af2 100644 --- a/forge/src/main/resources/META-INF/accesstransformer.cfg +++ b/forge/src/main/resources/META-INF/accesstransformer.cfg @@ -1,32 +1,39 @@ -public net.minecraft.client.gui.FontRenderer$CharacterRenderer -public net.minecraft.potion.PotionBrewing$MixPredicate -public net.minecraft.client.gui.widget.button.ImageButton field_191750_o -public net.minecraft.client.gui.screen.inventory.ContainerScreen field_147006_u -public net.minecraft.client.gui.screen.inventory.ContainerScreen field_147000_g -public net.minecraft.client.gui.screen.inventory.ContainerScreen field_146999_f -public net.minecraft.client.gui.screen.inventory.ContainerScreen field_147007_t -public net.minecraft.client.gui.screen.inventory.ContainerScreen field_147003_i -public net.minecraft.client.gui.screen.inventory.ContainerScreen field_147009_r -public net.minecraft.client.gui.DisplayEffectsScreen field_147045_u -public net.minecraft.client.gui.recipebook.RecipeBookGui field_191915_z -public net.minecraft.client.gui.recipebook.RecipeBookGui field_193962_q -public net.minecraft.client.gui.recipebook.RecipeBookGui field_193018_j -public net.minecraft.util.text.CharacterManager field_238347_a_ -public net.minecraft.entity.player.PlayerInventory field_184440_g -public net.minecraft.potion.PotionBrewing field_185215_c -public net.minecraft.potion.PotionBrewing field_185214_b -public net.minecraft.potion.PotionBrewing field_185213_a -public net.minecraft.potion.PotionBrewing$MixPredicate field_185198_a -public net.minecraft.potion.PotionBrewing$MixPredicate field_185199_b -public net.minecraft.potion.PotionBrewing$MixPredicate field_185200_c -public net.minecraft.item.BucketItem field_77876_a -public net.minecraft.item.crafting.SmithingRecipe field_234838_b_ -public net.minecraft.item.crafting.SmithingRecipe field_234837_a_ -public net.minecraft.item.ItemGroup field_78034_o -public net.minecraft.nbt.CompoundNBT field_74784_a -public net.minecraft.client.gui.AbstractGui func_238461_a_(Lnet/minecraft/util/math/vector/Matrix4f;IIIIIFFFF)V -public net.minecraft.client.gui.screen.Screen func_230480_a_(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget; -public net.minecraft.client.gui.screen.Screen func_230481_d_(Lnet/minecraft/client/gui/IGuiEventListener;)Lnet/minecraft/client/gui/IGuiEventListener; -public net.minecraft.client.gui.screen.Screen func_231160_c_()V -public net.minecraft.client.gui.screen.Screen func_231155_a_(Ljava/lang/String;Z)V -public net.minecraft.client.gui.screen.Screen func_231154_a_(Ljava/lang/String;CI)Z
\ No newline at end of file +public net.minecraft.client.gui.Font$StringRenderOutput +public net.minecraft.world.item.alchemy.PotionBrewing$Mix +public net.minecraft.client.gui.components.ImageButton f_94223_ +public net.minecraft.client.gui.screens.inventory.AbstractContainerScreen f_97734_ +public net.minecraft.client.gui.screens.inventory.AbstractContainerScreen f_97727_ +public net.minecraft.client.gui.screens.inventory.AbstractContainerScreen f_97726_ +public net.minecraft.client.gui.screens.inventory.AbstractContainerScreen f_97738_ +public net.minecraft.client.gui.screens.inventory.AbstractContainerScreen f_97735_ +public net.minecraft.client.gui.screens.inventory.AbstractContainerScreen f_97736_ +public net.minecraft.client.gui.screens.inventory.EffectRenderingInventoryScreen f_98699_ +public net.minecraft.client.gui.screens.recipebook.RecipeBookComponent f_100269_ +public net.minecraft.client.gui.screens.recipebook.RecipeBookComponent f_100281_ +public net.minecraft.client.gui.screens.recipebook.RecipeBookComponent f_100279_ +public net.minecraft.client.StringSplitter f_92333_ +public net.minecraft.nbt.CompoundTag f_128329_ +public net.minecraft.world.entity.player.Inventory f_35979_ +public net.minecraft.world.item.alchemy.PotionBrewing f_43496_ +public net.minecraft.world.item.alchemy.PotionBrewing f_43495_ +public net.minecraft.world.item.alchemy.PotionBrewing f_43494_ +public net.minecraft.world.item.alchemy.PotionBrewing$Mix f_43532_ +public net.minecraft.world.item.alchemy.PotionBrewing$Mix f_43533_ +public net.minecraft.world.item.alchemy.PotionBrewing$Mix f_43534_ +public net.minecraft.world.item.BucketItem f_40687_ +public net.minecraft.world.item.crafting.UpgradeRecipe f_44519_ +public net.minecraft.world.item.crafting.UpgradeRecipe f_44518_ +public net.minecraft.world.item.CreativeModeTab f_40763_ +public net.minecraft.client.gui.GuiComponent m_93112_(Lcom/mojang/math/Matrix4f;IIIIIFFFF)V +public net.minecraft.client.gui.screens.Screen m_7787_(Lnet/minecraft/client/gui/components/events/GuiEventListener;)Lnet/minecraft/client/gui/components/events/GuiEventListener; +public net.minecraft.client.gui.screens.Screen m_7856_()V +public net.minecraft.client.gui.screens.Screen m_6697_(Ljava/lang/String;Z)V +public net.minecraft.client.gui.screens.Screen m_96583_(Ljava/lang/String;CI)Z +public-f net.minecraft.client.gui.screens.inventory.AbstractContainerScreen f_97711_ +protected net.minecraft.client.gui.screens.Screen m_6575_(Lnet/minecraft/client/Minecraft;II)V +public net.minecraft.client.gui.screens.Screen m_142416_(Lnet/minecraft/client/gui/components/events/GuiEventListener;)Lnet/minecraft/client/gui/components/events/GuiEventListener; +public net.minecraft.client.gui.screens.Screen m_169394_(Lnet/minecraft/client/gui/components/Widget;)Lnet/minecraft/client/gui/components/Widget; +public net.minecraft.client.gui.screens.Screen m_169383_(Lcom/mojang/blaze3d/vertex/PoseStack;Ljava/util/List;II)V +public net.minecraft.client.renderer.RenderType m_173209_(Ljava/lang/String;Lcom/mojang/blaze3d/vertex/VertexFormat;Lcom/mojang/blaze3d/vertex/VertexFormat$Mode;ILnet/minecraft/client/renderer/RenderType$CompositeState;)Lnet/minecraft/client/renderer/RenderType$CompositeRenderType; +public net.minecraft.client.renderer.RenderType$OutlineProperty +public net.minecraft.client.renderer.RenderType$CompositeState
\ No newline at end of file diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 6aebf09b4..1a89466fd 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -24,13 +24,13 @@ To allow players to view items and recipes. [[dependencies.roughlyenoughitems]] modId = "architectury" mandatory = true -versionRange = "[1.10.139,)" +versionRange = "[2.3.22,)" ordering = "NONE" side = "BOTH" [[dependencies.roughlyenoughitems]] -modId = "cloth-config" +modId = "cloth_config" mandatory = true -versionRange = "[4.11.18,)" +versionRange = "[5.0.36,)" ordering = "NONE" side = "BOTH" diff --git a/gradle.properties b/gradle.properties index a989f9f6e..dacf56056 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,14 @@ org.gradle.jvmargs=-Xmx3G base_version=6.0 unstable=true -supported_version=1.17 -minecraft_version=1.17 -forgeEnabled=false -forge_version=36.0.43 +supported_version=1.17.1 +minecraft_version=1.17.1 +forgeEnabled=true +forge_version=37.0.18 fabricloader_version=0.11.6 -cloth_config_version=5.0.34 +cloth_config_version=5.0.37 modmenu_version=2.0.2 fabric_api=0.35.2+1.17 -architectury_version=2.0.9 +architectury_version=2.3.22 api_exculde= #api_include=me.shedaniel.cloth:cloth-events,me.shedaniel.cloth:config-2,me.sargunvohra.mcmods:autoconfig1u,org.jetbrains:annotations,net.fabricmc.fabric-api:fabric diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java index 628e823fc..b6dc4028d 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java @@ -28,6 +28,7 @@ import com.mojang.blaze3d.platform.Window; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Vector4f; +import dev.architectury.injectables.annotations.ExpectPlatform; import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; import me.shedaniel.math.impl.PointHelper; @@ -551,35 +552,12 @@ public class ScreenOverlayImpl extends ScreenOverlay { } public void renderTooltip(PoseStack matrices, Tooltip tooltip) { - List<ClientTooltipComponent> lines = tooltip.entries().stream() - .flatMap(component -> { - if (component.isText()) { - return Minecraft.getInstance().font.getSplitter().splitLines(component.getAsText(), 100000, Style.EMPTY).stream() - .map(Language.getInstance()::getVisualOrder) - .map(ClientTooltipComponent::create); - } else { - return Stream.of(component.getAsComponent()); - } - }) - .collect(Collectors.toList()); - for (TooltipComponent component : tooltip.components()) { - try { - ClientInternals.getClientTooltipComponent(lines, component); - } catch (Throwable exception) { - throw new IllegalArgumentException("Failed to add tooltip component! " + component + ", Class: " + (component == null ? null : component.getClass().getCanonicalName()), exception); - } - } - renderTooltipInner(matrices, lines, tooltip.getX(), tooltip.getY()); + renderTooltipInner(minecraft.screen, matrices, tooltip, tooltip.getX(), tooltip.getY()); } - public void renderTooltipInner(PoseStack matrices, List<ClientTooltipComponent> lines, int mouseX, int mouseY) { - if (lines.isEmpty()) { - return; - } - matrices.pushPose(); - matrices.translate(0, 0, 500); - minecraft.screen.renderTooltipInternal(matrices, |
