Brewin' And Chewin'

Brewin' And Chewin'

9M Downloads

container items disappearing

HarbingerOfCrazy opened this issue ยท 5 comments

commented

vers: 1.20.1- 3.2.1 forge
"container" items like tankards, honeycombs etc. disappear on recipe completion without being filled.
Steps to reproduce: have containers inside their slot when a craft completes in a keg (with non neutral temperature?)

Notes: experienced in the Create: Spectral Cuisine modpack

commented

I discovered this myself. More accurately, the keg consumes one more serving item than it's supposed to if the serving item is already inserted.

Thank god this is already reported.

commented

Can confirm this is an issue under NeoForge 21.1.184 for MC 1.21.1, with Brewin' and Chewin' 4.4.1.

commented

I think i found the culprit:
in
src/main/java/umpaz/brewinandchewin/common/block/entity/KegBlockEntity.java

private boolean processFermenting(KegFermentingRecipe recipe, KegBlockEntity keg) {         
...
        for (int i = 0; i < OUTPUT_SLOT; ++i) {
            ItemStack slotStack = inventory.getStackInSlot(i);
            if (slotStack.hasCraftingRemainingItem()) {
                ejectIngredientRemainder(slotStack.getCraftingRemainingItem());
            }
            if (!slotStack.isEmpty())
                slotStack.shrink(1);
        }
...
for (int i = 0; i < OUTPUT_SLOT; ++i)

the OUTPUT_SLOT is 5 and CONTAINER_SLOT is 4, so it shrinks it too by one

commented

Also i don't think i ever heard the keg make the potion sound because the fermenting ticker is only ever registered on the server side and the sound checks if it isn't.

commented

I think i found the culprit: in src/main/java/umpaz/brewinandchewin/common/block/entity/KegBlockEntity.java

private boolean processFermenting(KegFermentingRecipe recipe, KegBlockEntity keg) {
...
for (int i = 0; i < OUTPUT_SLOT; ++i) {
ItemStack slotStack = inventory.getStackInSlot(i);
if (slotStack.hasCraftingRemainingItem()) {
ejectIngredientRemainder(slotStack.getCraftingRemainingItem());
}
if (!slotStack.isEmpty())
slotStack.shrink(1);
}
...

for (int i = 0; i < OUTPUT_SLOT; ++i)

the OUTPUT_SLOT is 5 and CONTAINER_SLOT is 4, so it shrinks it too by one

Thank you so much for investigating, will hopefully get a fix out soonish.