Mekanism Generators

Mekanism Generators

97M Downloads

Bucket mode can place fluids that dont have an inworld block

Saereth opened this issue ยท 6 comments

commented

Issue description

When using the mekanis fluid tanks in "bucket mode", players can place a fluid block for fluids that don't have a corresponding fluid block. So, the placed block is an invisible block.

Steps to reproduce

Fill mekanism tank w/ a fluid/gas that doesn't have a world block. For this test I used lubricant from Modern Industrialization
Switch tank to "bucket mode"
Shift-Click to place block
Notice the transparent block
image

Minecraft version

1.20.x or earlier (No longer being developed)

NeoForge version

20.4.237

Mekanism version

Current Dev Branch (Manually Compiled, specify git commit hash)

Other relevant versions

Mekanism 10.5.240

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

commented

that looks like a valid block, given it's got a name and a mod name in the tooltip - perhaps MI doesn't have a valid texture?

commented

that looks like a valid block, given it's got a name and a mod name in the tooltip - perhaps MI doesn't have a valid texture?

You cant pour the bucket into the world nor can you pick it back up with a bucket or the mekanism tank once you place it. If you use /setblock yeah it does the same thing (invisible block that doesnt act like a liquid) potentially MI's side of things here yeah

commented

By doing a similar check that vanilla mc does in its BucketItem code (inside the emptyContents method), this can be fixed in Mekanism's tank code. A simple check to ensure that the Fluid is an instanceof FlowingFluid before being able to place it should be good enough.

commented

Yeah this seems to impact more than just MI, so a check on Mek's end would probably be the better route in this case

commented

I mean I see that bucket items now have a check for instanceof FlowingFluid, but I don't know if that is really the correct way to be solving this in case some mods add non flowing fluids fluids that they want to let be placed. In my opinion a more proper solution would be for them to return false from FluidType#canBePlacedInLevel for their fluid type. This defaults to false if the fluid block state is not air, so I am questioning why they have a fluid block state if they don't want it to actually be placed....

commented

Fixed in Modern Industrialization 2.2.15-beta