diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-08-02 19:54:29 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-08-02 19:58:20 +0800 |
| commit | b866becfb620c02a74fb990915001e154b5d2b0b (patch) | |
| tree | 904a3cb692af8a8ec059852d6b450e2a00c58621 /forge | |
| parent | 9f29770195319484f534de09fb221c66f31e0247 (diff) | |
| download | RoughlyEnoughItems-b866becfb620c02a74fb990915001e154b5d2b0b.tar.gz RoughlyEnoughItems-b866becfb620c02a74fb990915001e154b5d2b0b.tar.bz2 RoughlyEnoughItems-b866becfb620c02a74fb990915001e154b5d2b0b.zip | |
Welcome, Forge 1.17
Diffstat (limited to 'forge')
8 files changed, 120 insertions, 66 deletions
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" |
