Fuzss / universalenchants

Better enchantments! Use them on all tools and weapons. Infinity crossbow, or looting trident anyone?
https://www.curseforge.com/minecraft/mc-mods/universal-enchants-forge
Mozilla Public License 2.0
3 stars 3 forks source link

[Bug]: Compatibility problem with Just Enough Resources #63

Open SiverDX opened 1 year ago

SiverDX commented 1 year ago

Mod Loader (Required)

Forge

Minecraft Version (Required)

1.19.2

Mod Version (Required)

v4.2.15

Notes (Required)

Due to this the plugins / tabs are not present in JEI

[23Oct2023 11:24:02.859] [Render thread/ERROR] [mezz.jei.library.load.PluginCaller/]: Caught an error from mod plugin: class jeresources.jei.JEIConfig minecraft:jeresources
java.lang.IllegalArgumentException: value already present: UNIVERSAL_ENCHANTS_MINECRAFT_MENDING
    at com.google.common.collect.HashBiMap.put(HashBiMap.java:310) ~[guava-31.0.1-jre.jar%23116!/:?]
    at com.google.common.collect.HashBiMap.put(HashBiMap.java:290) ~[guava-31.0.1-jre.jar%23116!/:?]
    at java.util.Map.computeIfAbsent(Unknown Source) ~[?:?]
    at fuzs.universalenchants.world.item.enchantment.data.BuiltInEnchantmentDataManager.getOrBuildCustomCategory(BuiltInEnchantmentDataManager.java:68) ~[UniversalEnchants-v4.2.15-1.19.2-Forge.jar%23846!/:4.2.15]
    at fuzs.universalenchants.world.item.enchantment.serialize.EnchantmentHolder.<init>(EnchantmentHolder.java:33) ~[UniversalEnchants-v4.2.15-1.19.2-Forge.jar%23846!/:4.2.15]
    at java.util.Map.computeIfAbsent(Unknown Source) ~[?:?]
    at fuzs.universalenchants.world.item.enchantment.serialize.EnchantmentHoldersManager.getEnchantmentHolder(EnchantmentHoldersManager.java:63) ~[UniversalEnchants-v4.2.15-1.19.2-Forge.jar%23846!/:4.2.15]
    at fuzs.universalenchants.world.item.enchantment.serialize.EnchantmentHoldersManager.isCompatibleWith(EnchantmentHoldersManager.java:35) ~[UniversalEnchants-v4.2.15-1.19.2-Forge.jar%23846!/:4.2.15]
    at net.minecraft.world.item.enchantment.Enchantment.handler$hlc000$isCompatibleWith$head(Enchantment.java:2015) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.world.item.enchantment.Enchantment.m_44695_(Enchantment.java:79) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.world.item.enchantment.EnchantmentHelper.m_44859_(EnchantmentHelper.java:401) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at jeresources.registry.EnchantmentRegistry.getEnchantments(EnchantmentRegistry.java:36) ~[JustEnoughResources-1.19.2-1.2.2.236.jar%23699!/:1.2.2.236]
    at jeresources.jei.enchantment.EnchantmentWrapper.create(EnchantmentWrapper.java:31) ~[JustEnoughResources-1.19.2-1.2.2.236.jar%23699!/:1.2.2.236]
    at jeresources.jei.enchantment.EnchantmentMaker.createRecipes(EnchantmentMaker.java:13) ~[JustEnoughResources-1.19.2-1.2.2.236.jar%23699!/:1.2.2.236]
    at jeresources.jei.JEIConfig.registerRecipes(JEIConfig.java:74) ~[JustEnoughResources-1.19.2-1.2.2.236.jar%23699!/:1.2.2.236]
    at mezz.jei.library.load.PluginLoader.lambda$createRecipeManager$10(PluginLoader.java:140) ~[jei-1.19.2-forge-11.6.0.1018.jar%23695!/:11.6.0.1018]
    at mezz.jei.library.load.PluginCaller.redirect$cmc000$callOnPlugins(PluginCaller.java:540) ~[jei-1.19.2-forge-11.6.0.1018.jar%23695!/:11.6.0.1018]
    at mezz.jei.library.load.PluginCaller.callOnPlugins(PluginCaller.java:25) ~[jei-1.19.2-forge-11.6.0.1018.jar%23695!/:11.6.0.1018]
    at mezz.jei.library.load.PluginLoader.createRecipeManager(PluginLoader.java:140) ~[jei-1.19.2-forge-11.6.0.1018.jar%23695!/:11.6.0.1018]
    at mezz.jei.library.startup.JeiStarter.start(JeiStarter.java:114) ~[jei-1.19.2-forge-11.6.0.1018.jar%23695!/:11.6.0.1018]
    at mezz.jei.forge.startup.StartEventObserver.transitionState(StartEventObserver.java:137) ~[jei-1.19.2-forge-11.6.0.1018.jar%23695!/:11.6.0.1018]
    at mezz.jei.forge.startup.StartEventObserver.onEvent(StartEventObserver.java:100) ~[jei-1.19.2-forge-11.6.0.1018.jar%23695!/:11.6.0.1018]
    at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.3.jar%23134!/:?]
    at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.3.jar%23134!/:?]
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.3.jar%23134!/:?]
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.3.jar%23134!/:?]
    at net.minecraft.client.multiplayer.ClientPacketListener.m_5859_(ClientPacketListener.java:1321) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.network.protocol.game.ClientboundUpdateTagsPacket.m_5797_(ClientboundUpdateTagsPacket.java:35) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.network.protocol.game.ClientboundUpdateTagsPacket.m_5797_(ClientboundUpdateTagsPacket.java:11) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.network.protocol.PacketUtils.m_131356_(PacketUtils.java:22) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:157) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:131) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:116) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1072) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:700) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.client.main.Main.m_239872_(Main.java:212) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at net.minecraft.client.main.Main.main(Main.java:51) ~[client-1.19.2-20220805.130853-srg.jar%23879!/:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
    at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.2-43.3.0.jar%23150!/:?]
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-10.0.8.jar%23137!/:?]
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-10.0.8.jar%23137!/:?]
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-10.0.8.jar%23137!/:?]
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-10.0.8.jar%23137!/:?]
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-10.0.8.jar%23137!/:?]
    at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-10.0.8.jar%23137!/:?]
    at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-10.0.8.jar%23137!/:?]
    at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) [bootstraplauncher-1.1.2.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
    at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:58) [ForgeWrapper-1.5.6-prism.jar:1.5.6-prism]
    at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:87) [NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.listen(EntryPoint.java:130) [NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) [NewLaunch.jar:?]

latest.log (Optional)

No response

SiverDX commented 1 year ago

Currently using this workaround:

    @Overwrite
    public EnchantmentCategory getOrBuildCustomCategory(final Enchantment enchantment, final Predicate<Item> canApplyTo) {
        EnchantmentCategory enchantmentCategory;

        try {
            enchantmentCategory = this.customEnchantmentCategories.computeIfAbsent(enchantment, category -> ModServices.ABSTRACTIONS.createEnchantmentCategory(createCategoryName(category), canApplyTo));
        } catch (IllegalArgumentException exception) {
            TrialAndError.LOG.warn("Tried to create a duplicate enchantment category: [{}]", exception.getMessage());
            enchantmentCategory = this.customEnchantmentCategories.get(enchantment);
        }

        return enchantmentCategory;
    }

Got the following errors:

[23Oct2023 18:01:20.925] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_KNOCKBACK]
[23Oct2023 18:01:20.925] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_BANE_OF_ARTHROPODS]
[23Oct2023 18:01:20.925] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_LOOTING]
[23Oct2023 18:01:20.925] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_SMITE]
[23Oct2023 18:01:20.926] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_SHARPNESS]
[23Oct2023 18:01:20.926] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_FIRE_ASPECT]
[23Oct2023 18:01:20.926] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_MENDING]
[23Oct2023 18:01:20.973] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_THORNS]
[23Oct2023 18:01:20.973] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_FROST_WALKER]
[23Oct2023 18:01:20.973] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_PROTECTION]
[23Oct2023 18:01:20.973] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_BLAST_PROTECTION]
[23Oct2023 18:01:20.973] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_FIRE_PROTECTION]
[23Oct2023 18:01:20.973] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_PROJECTILE_PROTECTION]
[23Oct2023 18:01:20.973] [Render thread/WARN] [Trial and Error/]: Tried to create duplicate enchantment category: [value already present: UNIVERSAL_ENCHANTS_MINECRAFT_FEATHER_FALLING]