Don't try backplacing against water under carpet/lilypad

This commit is contained in:
ZacSharp 2022-09-30 22:41:09 +02:00
parent eb697b7a17
commit 43ee86b4fe
No known key found for this signature in database
GPG Key ID: 9453647B005083A3
1 changed files with 3 additions and 0 deletions

View File

@ -150,6 +150,9 @@ public class MovementTraverse extends Movement {
if (!standingOnABlock) { // standing on water / swimming
return COST_INF; // this is obviously impossible
}
if (srcDown instanceof BlockLiquid && (context.getBlock(x,y,z) == Blocks.WATERLILY || context.getBlock(x,y,z) == Blocks.CARPET)) {
return COST_INF; // we can stand on these but can't place against them
}
WC = WC * (SNEAK_ONE_BLOCK_COST / WALK_ONE_BLOCK_COST);//since we are sneak backplacing, we are sneaking lol
return WC + placeCost + hardness1 + hardness2;
}