PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

Tank Dupe bug

MuteTiefling opened this issue ยท 2 comments

commented

Minecraft Version

1.15.2

Forge Version

forge-31.1.74

Mod Version

pneumaticcraft-repressurized-1.15.2-1.1.1-11

Describe your problem, including steps to reproduce it

Right clicking a Cooking for Blockheads sink with a tank simultaneously fills the tank and places an empty one in the world, effectively duplicating it.

Any other comments?

https://streamable.com/4n0fkt

commented

I'm going to blame Cooking For Blockheads for this one, specifically because of this line:

https://github.com/blay09/CookingForBlockheads/blob/1.15.x/src/main/java/net/blay09/mods/cookingforblockheads/block/SinkBlock.java#L102

return !heldItem.isEmpty() && !(heldItem.getItem() instanceof BlockItem) ? ActionResultType.SUCCESS : ActionResultType.FAIL;

The sink checks to see if the held item (in this case the tank) is a BlockItem, and if so returns ActionResultType.FAIL - and the tank is indeed a BlockItem. So it's both filled the tank, and returned a value that indicates the tank could not be filled.

PNC:R (actually, Minecraft itself) on seeing the FAIL value, assumes the right-click operation on the sink failed, and therefore proceeds to place the tank as a block.

I presume blay09 has a reason for the !(heldItem.getItem() instanceof BlockItem) test but it's wrong in this case...

commented

Confirmed as a bug in CFB, closing this. Note that Mekanism's tank is affected in exactly the same way.