fooeyround / FilledToTheBrim

A Minecraft mod that allows you to put empty Shulker Boxes inside Shulker Boxes
MIT License
3 stars 0 forks source link

[Datapack] Incompatibility with Supplementaries #1

Open Ultimushadow opened 1 year ago

Ultimushadow commented 1 year ago

Bug description

**Any mention of Supplementaries sack item also affects Supplementaries Safe item

Supplementaries adds its own "shulker box lite" in the form of the sack. These items have 9 slots and are severely underpowered compared to shulker boxes, however, FTTB seems to be messing with the tags Supplementaries uses or vice versa. With Supplementaries but without FTTB, empty sacks and shulker boxes can not be added to the inventories of other sacks or shulker boxes. With Supplementaries, FTTB, and the default datapack enabled, empty shulker boxes can't nest in other shulker boxes, and sacks (including ones with items) can be nested into shulker boxes without having touched anything in the datapack/tags. However, attempting to put anything into a sack immediately crashes the client.

Steps to reproduce

Fabric 1.20.1, FTTB 1.20-v1.2.5, Supplementaries 1.20-2.5.17 (and Supplementaries Squared 1.20-1.1.5 if it matters) Log into a single player world, enable the datapack for FTTB, place down a sack from Supplementaries and attempt to put any item in.

Expected behavior

Sacks should accept items without crashing, shulker boxes should accept empty shulker boxes, and sacks should not be able to be put into shulker boxes without altering the default datapack

Actual behavior

Attempting to put items into a sack crashes the game, and sacks are able to be put into shulker boxes without changing anything about the default datapack, while shulker boxes cannot be nested

Relevant logs

The relevant crash from the log:

[06:11:51] [Render thread/ERROR] (Minecraft) Reported exception thrown! net.minecraft.class_148: Container click at net.minecraft.class_437.method_25412(class_437.java:414) ~[client-intermediary.jar:?] at net.minecraft.class_312.method_1601(class_312.java:100) ~[client-intermediary.jar:?] at net.minecraft.class_312.method_22686(class_312.java:169) ~[client-intermediary.jar:?] at net.minecraft.class_1255.execute(class_1255.java:102) ~[client-intermediary.jar:?] at net.minecraft.class_312.method_22684(class_312.java:169) ~[client-intermediary.jar:?] at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43) ~[lwjgl-glfw-3.3.1.jar:?] at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.3.1.jar:?] at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3403) ~[lwjgl-glfw-3.3.1.jar:?] at com.mojang.blaze3d.systems.RenderSystem.pollEvents(RenderSystem.java:201) ~[client-intermediary.jar:?] at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:212) ~[client-intermediary.jar:?] at net.minecraft.class_1041.method_15998(class_1041.java:288) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1523(class_310.java:1241) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1514(class_310.java:802) ~[client-intermediary.jar:?] at net.minecraft.client.main.Main.main(Main.java:250) ~[minecraft-1.20.1-client.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468) ~[fabric-loader-0.14.21.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.14.21.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.14.21.jar:?] at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:88) ~[NewLaunch.jar:?] at org.prismlauncher.EntryPoint.listen(EntryPoint.java:126) ~[NewLaunch.jar:?] at org.prismlauncher.EntryPoint.main(EntryPoint.java:71) ~[NewLaunch.jar:?] Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1937.method_8320(net.minecraft.class_2338)" because the return value of "net.minecraft.class_2586.method_10997()" is null at net.minecraft.class_2627.handler$dgb001$filledtothebrim$canInsert(class_2627.java:532) ~[client-intermediary.jar:?] at net.minecraft.class_2627.method_5492(class_2627.java) ~[client-intermediary.jar:?] at net.mehvahdjukaar.supplementaries.common.utils.MiscUtils.isAllowedInShulker(MiscUtils.java:132) ~[supplementaries-1.20-2.5.17-fabric.jar:?] at net.mehvahdjukaar.supplementaries.common.block.tiles.SafeBlockTile.method_5437(SafeBlockTile.java:241) ~[supplementaries-1.20-2.5.17-fabric.jar:?] at net.mehvahdjukaar.supplementaries.common.inventories.DelegatingSlot.method_7680(DelegatingSlot.java:16) ~[supplementaries-1.20-2.5.17-fabric.jar:?] at net.minecraft.class_1735.method_32755(class_1735.java:149) ~[client-intermediary.jar:?] at net.minecraft.class_1703.method_30010(class_1703.java:412) ~[client-intermediary.jar:?] at net.minecraft.class_1703.method_7593(class_1703.java:294) ~[client-intermediary.jar:?] at net.minecraft.class_636.method_2906(class_636.java:450) ~[client-intermediary.jar:?] at net.minecraft.class_465.method_2383(class_465.java:548) ~[client-intermediary.jar:?] at net.minecraft.class_465.method_25406(class_465.java:512) ~[client-intermediary.jar:?] at net.minecraft.class_312.method_1605(class_312.java:100) ~[client-intermediary.jar:?] at net.minecraft.class_437.method_25412(class_437.java:409) ~[client-intermediary.jar:?] ... 19 more

Minecraft version

1.20.1

TemplateMod version

1.2.5

Other information

I can see that Supplementaries uses their own tag system, which I imagine could be modified to allow for empty sack/shulker box nesting.

I also messed around to experiment with what breaks, I managed to get items into a sack with FTTB disabled, relaunched the game with FTTB enabled again, and the sack with items was able to stack in a shulker box I tried to use a hopper to push items into a sack which caused a ticking block entity, luckily Neruina stopped the game from crashing but it resulted in pretty much the same crash, just with a log of the hopper trying to push the item in. It could pull items out of a sack with items just fine though interestingly, I assume it doesn't need to check the tags to see what's allowed when that happens.

@MehVahdJukaar Any ideas on how this might be remedied?

Check list

fooeyround commented 1 year ago

Oh my, I am so sorry, I did not get a notification and have been away.. I'll fix it as soon as I can. Sorry.

fooeyround commented 1 year ago

@Ultimushadow Sorry for the delay, does this work? (Unzip and use the version you are running)

Ultimushadow commented 1 year ago

Hey no worries, modding can take a lot of time and it's probably for the best you aren't chronically online like some of us (me, the some of us) I'll test it out now and see how it goes, thanks for the work!

Ultimushadow commented 1 year ago

Okay, it looks like everything is working as intended, for the most part! Shulker boxes and all colored variations are able to be nested into other shulker boxes including colored, Safes, Sacks, and colored Sacks from Supp Squared. I did notice a weird bit of interaction with the Supplementaries items though. When messing with the "nestable_when_empty" tag, when I did not have the safe/sack/colored sack items, I could nest empty and full items into other containers. When I did add those items to the tag, I couldn't add empty or full items into other containers. Maybe I'm doing something wrong though - I saw on the other issue report you guys were talking about tags and stuff, I currently have Supp 2.5.21, SuppSquared 1.1.6, and the FTTB version you just sent me running on 1.20.1 in case it's important. At present, it's no longer that big a deal as the crash is avoided and the shulker nesting works as intended, I don't see my players needing to carry large amounts of sacks or safes the same way they carry shulker boxes, however, depending on whether or not this is specific to Supplementaries this might pose a problem with other mods that add containers. I've yet to really test this by sticking it on a server and letting my players have a go at things so for now, I don't see the need to press you to pull your hair out over a minor issue and will probably just be using this mod as it is now, but I'll let you know if we run into anything!

fooeyround commented 1 year ago

Yeah. That seems right based on the current implement. I need to rethink it to allow for modded items and such. It works for bundles and shulkers, but nothing else. I need to find a more dynamic way of doing things. Problem is, mods could technically name the NBT Compound anything. But I might just base it on Minecraft's Inventories code.

fooeyround commented 1 year ago

Leaving this open of course because of the datapack compatibly issues

fooeyround commented 1 year ago

Is the new title okay?

fooeyround commented 1 year ago

Also, again, sorry for the over 20 day wait. I was home for the first 10 🥲

Ultimushadow commented 1 year ago

Ticket looks good to me, if you find any progress I'll still be interested in updates so I'm good with leaving it open As for the possible solution it definitely seems tricky, I have had a look in the code too far in but I wonder if there's a way for mod authors to opt in rather than you handling every implementation of storage item that can exist. Personally I see the most use with mods like supplementaries, ones that are pretty close to vanilla in terms of game design and could probably make their items compatible with your system without you having to put too much work in handling a ton of variation. Of course, I'm speaking purely from a design standpoint so I wouldn't be of much help for specifics As for the time, don't worry about it, it comes with the territory and I'm glad you got to it at all since I wont have to drop it from my pack anymore!

fooeyround commented 1 year ago

Yeah. That's up to the supplementary dev(s), I'll ask them soon. Glad to see it can go back into your pack. I might have to try it out sometime :)