Grab block only once

This commit is contained in:
ZacSharp 2022-12-30 16:09:45 +01:00
parent b2f66241d5
commit e59bf9ab97
No known key found for this signature in database
GPG Key ID: 9453647B005083A3

View File

@ -150,7 +150,8 @@ 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)) {
Block blockSrc = context.getBlock(x, y, z);
if (srcDown instanceof BlockLiquid && (blockSrc == Blocks.WATERLILY || blockSrc == 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