BuildCraft|Core

BuildCraft|Core

7M Downloads

Gate triggers don't work as expected with double chests

buttilda opened this issue ยท 17 comments

commented

Pipes work just fine, but triggers don't.

For example:
The trigger "Inventory is Empty" might be active even though the double chest contain items. That could happen if the items where in the "side" that the gate isn't touching.

Okay, I fail to explain myself... I hope that made any sense whatsoever.

PS.: I know CJ is rewriting the gates so I don't know if this is happening because they are still a work in progress.
PPS.: Gates are also reseting after you log out and back in. My autarchic gate turned into a normal gate, and the triggers set in it were lost. Again, I know they are in the process of being re-written so this might be a known issue.

commented

That has been fixed - closing.

commented

what version of buildcraft and forge are you using?

commented

@AEnterprise It's on my dev environment with forge 953 and the the updated source from BC

commented

source, so you downloaded it here or from the official site? cause the version on the official site if from before the start of the gate rewrite

commented

@AEnterprise I forked it from this repo...

commented

Ok that explained my question. I have the newest version of BC (not source) and i did not have any of these bugs xD

commented

Branch "marmot"?

commented

@CovertJaguar yup. That's the one I was testing with because it's the one with the latest commits.

commented

@AEnterprise How's that going to solve the problem....?
I'm not trying to play with a in-dev version (I'm smart like that). I'm just reporting what I think is a potential bug...

commented

and that is the one with the gate rewrite, try reverting those commits

commented

I think CJ understood that so don't worry.

commented

cause gates are undergoing a rewrite, i'm not sure about the exact stuff cause i'm not working on it but that might be what is causing the problem cause it worked in the past

commented

Yes I know that.
I said it on the first post.

And I didn't ask for a solution, I was just reporting what I thought was an overlooked bug :)

commented

The only possible bug, is the double chest thing, not sure what's up with that, the rest is just unfinished.

commented

@CovertJaguar I think I found what could be the problem...
The InventoryIterator doesn't take double chests into consideration
There should be a check like this one:

public static Iterable getIterable(IInventory inv, ForgeDirection side) {
        if (inv instanceof ISidedInventory) {
            return new InventoryIteratorSided((ISidedInventory) inv, side);
        } else if(inv instanceof TileEntityChest) {
            TileEntityChest tileChest = (TileEntityChest) inv;
            return new InventoryIteratorSimple(Block.chest.getInventory(tileChest.worldObj, tileChest.xCoord, tileChest.yCoord, tileChest.zCoord));
        }
        return new InventoryIteratorSimple(inv);
    }
        return new InventoryIteratorSimple(inv);
    }

I believe that would fix it. If you like it I can make the PR myself.

commented

@CovertJaguar Well it was a quick suggestion :3 But at least it will get fixed XD

commented

@ganymedes01 yes, but we have a simpler more efficient function in one of the Utils classes for this, I'll fix it =P