no need to get that twice

This commit is contained in:
Leijurv 2018-09-26 13:05:36 -07:00
parent 8ef89a8c80
commit 40a3177ae7
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -65,7 +65,8 @@ public class MovementDescend extends Movement {
} }
double totalCost = 0; double totalCost = 0;
totalCost += MovementHelper.getMiningDurationTicks(context, destX, y - 1, destZ, false); IBlockState destDown = BlockStateInterface.get(destX, y - 1, destZ);
totalCost += MovementHelper.getMiningDurationTicks(context, destX, y - 1, destZ, destDown, false);
if (totalCost >= COST_INF) { if (totalCost >= COST_INF) {
return IMPOSSIBLE; return IMPOSSIBLE;
} }
@ -93,8 +94,7 @@ public class MovementDescend extends Movement {
return dynamicFallCost(context, x, y, z, destX, destZ, totalCost, below); return dynamicFallCost(context, x, y, z, destX, destZ, totalCost, below);
} }
Block tmp1 = BlockStateInterface.get(destX, y - 1, destZ).getBlock(); if (destDown.getBlock() == Blocks.LADDER || destDown.getBlock() == Blocks.VINE) {
if (tmp1 == Blocks.LADDER || tmp1 == Blocks.VINE) {
return IMPOSSIBLE; return IMPOSSIBLE;
} }