Supplementaries

Supplementaries

110M Downloads

causes exceptions when mods try to create a client sided resource manager for loot tables and such

wagyourtail opened this issue ยท 4 comments

commented

mc vers: 1.19.2 fabric
mod vers: 2.2.4

logs:

exception with baritone:

latest.log

code snippet from baritone where crash happens:

PackRepository rpl = new PackRepository(PackType.SERVER_DATA, new ServerPacksSource());
            rpl.reload();
            PackResources thePack = rpl.getAvailablePacks().iterator().next().open();
            ReloadableResourceManager resourceManager = new ReloadableResourceManager(PackType.SERVER_DATA); // this line
            manager = new LootTables(predicate);
            resourceManager.registerReloadListener(manager);
            try {
                resourceManager.createReload(new ThreadPerTaskExecutor(Thread::new), new ThreadPerTaskExecutor(Thread::new), CompletableFuture.completedFuture(Unit.INSTANCE), Collections.singletonList(thePack)).done().get();
            } catch (Exception exception) {
                throw new RuntimeException(exception);
            }

I'd expect this to be a problem with various other client side mods as well if they need to access this class from client side

commented

yeah. that looks like it fixed it. thanks!

commented

Not exactly sure how to fix this. First mod I ever encountered that has a client side resource manager for server side stuff. It's failing as it expects that to contain loot tables and other jsons ok creation like vanilla one does while this one is empty. I could make it only apply to the vanilla one but I fear it might break with mods that change asset reloading

commented

I have a fix in mind, a bit ugly but should work

commented

Can you verify this is fixed with latest moonlight version?