Hardcore Questing Mode [FORGE/FABRIC]

Hardcore Questing Mode [FORGE/FABRIC]

16M Downloads

1.11.2 Crash when picking up items for quest

DingoX3 opened this issue ยท 8 comments

commented

I made the first quest 4 wood logs and turned on fuzzy for any type. then when testing it the game crashes as it tries to go into my inventory. I then removed the quests folder to check and was able to pick up wood without crashing.

full crash report: HERE

minecraft: 1.11.2
forge: 13.20.0.2230
hqm: 1.11.2-5.1.0alpha2

commented

Do you still need a list of mods or was Mcjty's comment the fix?

commented

His comment is enough

commented

Ok great. Thanks for looking into it. Keep up the great work.

commented

Is only hqm installed? I tried serval times to reproduce it the last days and I can't. I'll try with your explanation

commented

canitzp, this code is wrong:

        items = NonNullList.create();
        NonNullList<ItemStack> mainInventory = player.inventory.mainInventory;
        for (int i = 0; i < mainInventory.size(); i++) {
            items.set(i, mainInventory.get(i));
        }

Basically you make an empty list with NonNullList.create() and then you directly 'set' items in it. 'set' does not automatically grow the list. You need to use items.add(mainInventory.get(i)) instead

commented

@McJty can you look over the fix and say if it should work

commented

It seems ok at first glance but not very efficient as the code makes a copy of a list of items just to count something? If it isn't used much then that's fine

commented

I only fixing code at the time, there is a lot to rewrite. It is not an perfect port