Salandora / SophisticatedBackpacks

Sophisticated backpacks is yet another minecraft backpack mod this time with backpack you can place in world, color in different color combinations, upgrade with more inventory and enhance with many functional upgrades.
https://www.curseforge.com/minecraft/mc-mods/sophisticated-backpacks-unofficial-fabric-port
GNU General Public License v3.0
18 stars 7 forks source link

1.20.1 port #1

Open LangYueMc opened 9 months ago

LangYueMc commented 9 months ago

Hello, I forked the code and upgraded to 1.20.1.

https://github.com/LangYueMc/SophisticatedWorkspace

The reason for submitting an issue instead of a PR is because I have not use the streamlined porting lib that you have modified. I think there will be problems with direct PR, so I will record the problems encountered in the upgrade in this issue.

Also, can I distribute it on forums in China for testing?

LangYueMc commented 9 months ago

The porting lib needs to be consistent with create fabric, otherwise it will be incompatible.

And LogicalSidedProvider.WORKQUEUE.get(EnvType.SERVER).isSameThread() will be NPE, need to be replaced with !LogicalSidedProvider.WORKQUEUE.get(EnvType.CLIENT).isSameThread()

LangYueMc commented 9 months ago

src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/common/gui/BackpackContainer.java

@Override
protected boolean shouldSlotItemBeDroppedFromStorage(Slot slot) {
    return !LogicalSidedProvider.WORKQUEUE.get(EnvType.CLIENT).isSameThread() && slot.getItem().getItem() instanceof BackpackItem &&
        !storageWrapper.getInventoryHandler().isItemValid(0, slot.getItemVariant());
}

Added !LogicalSidedProvider.WORKQUEUE.get(EnvType.CLIENT).isSameThread() because if executed by the client, it will cause false movement of items.

LangYueMc commented 9 months ago

Porting lib loot has a lot of bugs, and the latest version conflicts with create. IMHO, the version management mechanism of Porting lib is terrible, so I gave up using it and switched to fabric api.

https://github.com/LangYueMc/SophisticatedBackpacks/commit/b940a56256d8a12d92bbe89439a4ad0e8323f5de

Salandora commented 7 months ago

Hey sorry for the late reply, I somehow did not notice this issue until now.

I want to get away from porting-lib, as soon as 1.20.1, in 1.19.4 it's not an issue as create was never released for that version, but it was a good way to start the port and get it running.

About your second comment, I also had some problems with this in server environments and opted to change it completely.

I'll have a look at fabrics loot injection system. Thanks for the tip.

Atlantis520 commented 5 months ago

错误报告-2024-4-30_10.58.03.zip Fabric Error -> fabric-loader-0.15.9

Salandora commented 5 months ago

@Atlantis520 please update sodium, version 0.4.10 is not supported in the 1.20.1 version of this mod

hinzyboii commented 4 months ago

ETA on the fix?

Salandora commented 4 months ago

What fix?

hinzyboii commented 4 months ago

Create compatibility fix. There are some forks which fix it by replacing the porting thing with fabric api but I can't get any of them to compile and from what I can see they aren't on curse forge or modrinth

hinzyboii commented 4 months ago

never mind? i switched to modrinth and everything is working now??