Open wHazem opened 5 days ago
Fixed not working quarry modules after reloading the world. it is not using cache of modules in quarry.
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());
}
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