Modern Industrialization

Modern Industrialization

4M Downloads

Crafter may stop when server reload

aria1th opened this issue ยท 4 comments

commented

2022-05-11_00 18 27
2022-05-11_00 18 46
2022-05-11_00 18 31

It says it has active recipe in terminal, but it does not craft anything, it does not do anything, it can't use energy, it can't decrease efficiency tick too. but it has active recipe, means tickRecipe() method is never called in this crafter somehow.

It only happens for multiblocks : EBF, Vacuum freezer, etc. so it means allowNormalOperation var is always set to false.

Its fixed when multiblock shape is invalidated : which means shapeMatcher.needsRematch() returned false.

.... as an conclusion, the code should change:

        if (shapeMatcher == null) {
            shapeMatcher = new ShapeMatcher(level, worldPosition, orientation.facingDirection, getActiveShape());
            shapeMatcher.registerListeners(level);
        }
        if (shapeMatcher.needsRematch()) {
            allowNormalOperation = false;
            shapeValid.shapeValid = false;
            shapeMatcher.rematch(level);

            if (shapeMatcher.isMatchSuccessful()) {
                inventory.rebuild(shapeMatcher);

                onSuccessfulMatch(shapeMatcher);
                shapeValid.shapeValid = true;

                // If there was an active recipe, we have to make sure the output fits, and lock
                // the hatches.
            }

            if (shapeValid.update()) {
                sync(false);
            }
        }
		if (shapeValid.shapeValid){
			if (crafter.tryContinueRecipe()) {
				allowNormalOperation = true;
			}
		}
    }```
commented

Hello, I can't reproduce this issue in singleplayer with an EBF turning uncooked steel into steel. Do you have more insight? (Sorry for the delay)

commented

Can you provide reproduction steps?

commented

It only happens when server reboots : and any other tech* mods are not responsible for this, it happened with very large forceloaded area + very many crafters (multiblocks, machines... in total 2500+)
It didn't happen when there were only small amount of it.
I suspect if it could be lithium / chunk access fault, somehow... or... blockPos hash collision thingy?

Mostly it happens in same positions : same multiblock concept gets error again, but another one works normally, almost consistent.

commented

If anyone encounters the issue again, I will need some reproduction steps. For now I don't really want to deal with it, sorry. ๐Ÿ˜