PTOM76 / EnhancedQuarries

開発中です。
Mozilla Public License 2.0
1 stars 3 forks source link

Quarry Modules Are Not Retained After Reloading the World #33

Open wHazem opened 5 days ago

wHazem commented 5 days ago

Test Scenario: I added a Silk Touch module to the Quarry. However, after exiting and reopening the world, the Quarry operated without the Silk Touch functionality.

Fabric Version: 0.109.0+1.21.1 EnhancedQuarries Version: 1.5.3

PTOM76 commented 1 day ago

Fixed not working quarry modules after reloading the world. it is not using cache of modules in quarry.

kilroythethird commented 23 hours ago

I was just now hunting this bug too. Haven't tested your last commit, but what i got to is that readNbt wasn't able to load the modules because there was a check if getWorld() returns null, which it always did in my tests at load time. BUT args still has a valid registryLookup.

So i simply changed it to the following and it seem to work fine.

if (!args.hasRegistryLookup() && getWorld() != null){
    args.registryLookup = RegistryLookupUtil.getRegistryLookup(getWorld());
}
if(args.hasRegistryLookup()){
    InventoryUtil.readNbt(args.registryLookup, moduleNbt, getModuleStacks());
}