RazorPlay01 / InvView_Forge

MIT License
0 stars 0 forks source link

Unable to view curios #3

Closed Dr-WeiAL closed 1 month ago

Dr-WeiAL commented 4 months ago

Minecraft version: 1.20.1 Forge version: 47.2.20

I'm getting an error when using the /view curios command, the message in the log is as follows

[11:30:14] [Server thread/ERROR]: Command exception: /view curios WeiAL
java.lang.ArrayIndexOutOfBoundsException: Index 27 out of bounds for length 27
    at java.util.Arrays$ArrayList.set(Arrays.java:4170) ~[?:?]
    at net.minecraft.core.NonNullList.set(NonNullList.java:54) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.world.SimpleContainer.m_6836_(SimpleContainer.java:140) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.razorplay.invview_forge.container.PlayerCuriosInventoryScreenHandler.lambda$new$0(PlayerCuriosInventoryScreenHandler.java:43) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1]
    at java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[?:?]
    at java.util.Collections$UnmodifiableMap.forEach(Collections.java:1553) ~[?:?]
    at net.razorplay.invview_forge.container.PlayerCuriosInventoryScreenHandler.lambda$new$1(PlayerCuriosInventoryScreenHandler.java:34) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1]
    at net.minecraftforge.common.util.LazyOptional.ifPresent(LazyOptional.java:137) ~[forge-1.20.1-47.2.20-universal.jar%23763!/:?]
    at net.razorplay.invview_forge.container.PlayerCuriosInventoryScreenHandler.<init>(PlayerCuriosInventoryScreenHandler.java:34) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1]
    at net.razorplay.invview_forge.command.InvViewCommands$2.m_7208_(InvViewCommands.java:116) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1]
    at net.minecraftforge.network.NetworkHooks.openScreen(NetworkHooks.java:204) ~[forge-1.20.1-47.2.20-universal.jar%23763!/:?]
    at net.minecraftforge.network.NetworkHooks.openScreen(NetworkHooks.java:158) ~[forge-1.20.1-47.2.20-universal.jar%23763!/:?]
    at net.razorplay.invview_forge.command.InvViewCommands.executeCuriosCheck(InvViewCommands.java:121) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1]
    at net.razorplay.invview_forge.command.InvViewCommands.lambda$new$3(InvViewCommands.java:43) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1]
    at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[brigadier-1.1.8.jar%23113!/:?]
    at net.minecraft.commands.Commands.m_242674_(Commands.java:257) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.server.network.ServerGamePacketListenerImpl.m_246958_(ServerGamePacketListenerImpl.java:1246) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.server.network.ServerGamePacketListenerImpl.m_244885_(ServerGamePacketListenerImpl.java:1223) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.util.thread.BlockableEventLoop.m_18693_(BlockableEventLoop.java:67) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
    at net.minecraft.server.TickTask.run(TickTask.java:18) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:770) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:161) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:753) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:747) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:115) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:732) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:665) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
ColdTearsYY commented 3 months ago

same problem with same version.

[20:44:26 ERROR]: Command exception: /view curios Colpax_HP

java.lang.ArrayIndexOutOfBoundsException: Index 27 out of bounds for length 27 at java.util.Arrays$ArrayList.set(Arrays.java:4271) ~[?:?] at net.minecraft.core.NonNullList.set(NonNullList.java:54) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.world.SimpleContainer.m6836(SimpleContainerMixin.java:140) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.razorplay.invview_forge.container.PlayerCuriosInventoryScreenHandler.lambda$new$0(PlayerCuriosInventoryScreenHandler.java:43) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1] at java.util.LinkedHashMap.forEach(LinkedHashMap.java:986) ~[?:?] at java.util.Collections$UnmodifiableMap.forEach(Collections.java:1707) ~[?:?] at net.razorplay.invview_forge.container.PlayerCuriosInventoryScreenHandler.lambda$new$1(PlayerCuriosInventoryScreenHandler.java:34) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1] at net.minecraftforge.common.util.LazyOptional.ifPresent(LazyOptional.java:137) ~[forge-1.20.1-47.2.20-universal.jar%23850!/:?] at net.razorplay.invview_forge.container.PlayerCuriosInventoryScreenHandler.(PlayerCuriosInventoryScreenHandler.java:34) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1] at net.razorplay.invview_forge.command.InvViewCommands$2.m7208(InvViewCommands.java:116) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1] at net.minecraftforge.network.NetworkHooks.openScreen(NetworkHooksMixin.java:204) ~[forge-1.20.1-47.2.20-universal.jar%23850!/:?] at net.minecraftforge.network.NetworkHooks.openScreen(NetworkHooksMixin.java:158) ~[forge-1.20.1-47.2.20-universal.jar%23850!/:?] at net.razorplay.invview_forge.command.InvViewCommands.executeCuriosCheck(InvViewCommands.java:121) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1] at net.razorplay.invview_forge.command.InvViewCommands.lambda$new$3(InvViewCommands.java:43) ~[inv_view_forge-1.3.0-1.20.1.jar%23660!/:1.3.0-1.20.1] at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[brigadier-1.1.8.jar%23110!/:?] at net.minecraft.commands.Commands.m242674(CommandsMixin.java:257) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.m246958(ServerPlayNetHandlerMixin.java:2853) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.m244885(ServerPlayNetHandlerMixin.java:1223) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.util.thread.BlockableEventLoop.m18693(BlockableEventLoop.java:67) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.util.thread.BlockableEventLoop.m6367(BlockableEventLoop.java:156) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.util.thread.ReentrantBlockableEventLoop.m6367(ReentrantBlockableEventLoop.java:23) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.server.MinecraftServer.m6367(MinecraftServerMixin.java:770) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.server.MinecraftServer.m6367(MinecraftServerMixin.java:161) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.util.thread.BlockableEventLoop.m7245(BlockableEventLoop.java:130) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.server.MinecraftServer.m129961(MinecraftServerMixin.java:753) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.server.MinecraftServer.m7245(MinecraftServerMixin.java:747) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.util.thread.BlockableEventLoop.m18701(BlockableEventLoop.java:139) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.server.MinecraftServer.m130012(MinecraftServerMixin.java:733) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.server.MinecraftServer.m130011(MinecraftServerMixin.java:2075) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at net.minecraft.server.MinecraftServer.m206580(MinecraftServerMixin.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23845!/:?] at java.lang.Thread.run(Thread.java:1583) ~[?:?]

RazorPlay01 commented 3 months ago

The code to access the API curios inventories must be rewritten as it does not use best practices and can cause many problems

RazorPlay01 commented 1 month ago

I have already completed the rewrite of the curios code in case you would like to try it.

Dr-WeiAL commented 1 month ago

I'm able to view curios, but it only looks at the first 27 frames of items at most 和 can't view more, any solutions? image image

RazorPlay01 commented 1 month ago

I should scale the screen depending on the number of items, it may be failing because I didn't do many tests to be honest. If I free myself up a bit in a while I'll check it out and fix it.

RazorPlay01 commented 1 month ago

There will always be a maximum of 6*9 since I use the default Minecraft menus

Dr-WeiAL commented 1 month ago

Currently this limitation is still a bit big, such as not knowing where the curios are located, and the fact that there are api's that use curios for deeper levels of curios, such as the curse of pandora, which is always inadequate

RazorPlay01 commented 1 month ago

Try this version and let me know if it works well Alpha Release

Dr-WeiAL commented 1 month ago

Try this version and let me know if it works well Alpha Release

Uh... Not only does it not work, it's misaligned. And there is also a bug that copies the items from the shortcut bar to the item bar, repeat it a few times and the item bar will be full of items from the shortcut bar. image image

RazorPlay01 commented 1 month ago

I forgot to reset the player's inventory.

RazorPlay01 commented 1 month ago

Try the new version I just uploaded and it should work fine. Alpha Release

Dr-WeiAL commented 1 month ago

I forgot to reply a few days ago, sorry, it's true that viewing curios is no longer a problem, but the display is still incomplete for such additional curios image image image

RazorPlay01 commented 1 month ago

I know, maybe I will think about how to add the missing ones in the future. I don't think that too many users will exceed the limit.

RazorPlay01 commented 1 month ago

I still want to see what happens with curios since the original creator abandoned the project as of 1.21.