skippyall / CreateFabricFixes

MIT License
2 stars 1 forks source link

Dupe fix #2

Closed muriplz closed 7 months ago

muriplz commented 9 months ago

Thanks a lot for bringing this mod as a workaround for crashes!

I'm trying to fix a dupe bug https://github.com/Creators-of-Create/Create/issues/4880 that also happens on the fabric fork

I haven't been able to figure out what class/code is at wrong here, must be a hard issue since its open since may 2023, it would be cool to have this fix too!

you can contact me on discord (muriplz), I undertand anyways that this is out of scope of this mod since it is not a crash and a very specific dupe

skippyall commented 9 months ago

I think that I will include this. Thank you pointing it out.

skippyall commented 8 months ago

I found the bug in https://github.com/Fabricators-of-Create/Create/blob/mc1.18/fabric/dev/src/main/java/com/simibubi/create/content/contraptions/behaviour/dispenser/DropperMovementBehaviour.java in line 47 and following. Each stack is increased by the number of items that were extracted with ItemStack#sameItem method as a filter, which doesn't check for nbt data.

skippyall commented 8 months ago

They'd better use ItemStack#matches

skippyall commented 8 months ago

No they'd better use ItemStack#isSameItemSameTags because it should work with different counts

muriplz commented 8 months ago

https://pastes.io/rch9rjbdxv I tested this on a prod server and got this crash! I'm not sure as if this stacktrace is due to an issue with it or some other unrelated crash happened and made it throw an stacktrace. It's cut because I could only see it in console with it happened, wasn't pasted to any log file or crash file

skippyall commented 8 months ago

This is caused by this mod, however, the important part about what exactly caused the crash is missing, so I cannot fix this without more information.

skippyall commented 8 months ago

When did it crash? On startup or while playing?

muriplz commented 8 months ago

I'll try to replicate it to get the full log, its during the game, not startup

muriplz commented 8 months ago

ava.lang.NullPointerException: Cannot invoke "com.simibubi.create.content.logistics.filter.ItemAttribute.serializeNBT(net.minecraft.class_2487)" because the return value of "com.simibubi.create.foundation.utility.Pair.getFirst()" is null at com.simibubi.create.content.logistics.filter.AttributeFilterMenu.lambda$saveData$1(AttributeFilterMenu.java:152) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at com.simibubi.create.content.logistics.filter.AttributeFilterMenu.saveData(AttributeFilterMenu.java:147) at com.simibubi.create.content.logistics.filter.AttributeFilterMenu.saveData(AttributeFilterMenu.java:25) at com.simibubi.create.foundation.gui.menu.MenuBase.method_7595(MenuBase.java:59) at net.minecraft.class_3222.method_14247(class_3222.java:1089) at net.minecraft.class_1657.method_5650(class_1657.java:1412) at net.minecraft.class_3218.method_18770(class_3218.java:929) at net.minecraft.class_3324.method_14611(class_3324.java:413) at net.minecraft.class_3244.method_10839(class_3244.java:1228) at net.minecraft.class_2535.method_10768(class_2535.java:452) at net.minecraft.class_3242.method_14357(class_3242.java:185) at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:908) at net.minecraft.class_3176.method_3813(class_3176.java:283) at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:824) at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:671) at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:265) at java.base/java.lang.Thread.run(Thread.java:840)

skippyall commented 8 months ago

That's a separate issue

muriplz commented 8 months ago

My bad, it seems to work fine, the items are not longer duped, although:

No logs on console or anything

Sorry for the late response here

skippyall commented 8 months ago

It is intended that it doesn't do anything if there is no item with exact same data in the barrel and just one item in the dropper.