clean up benchmark branch
This commit is contained in:
@@ -270,8 +270,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
||||
* @param start
|
||||
* @param talkAboutIt
|
||||
*/
|
||||
private void findPathInNewThread(final BlockPos start, final boolean talkAboutIt,
|
||||
final Optional<IPath> previous) {
|
||||
private void findPathInNewThread(final BlockPos start, final boolean talkAboutIt, final Optional<IPath> previous) {
|
||||
synchronized (pathCalcLock) {
|
||||
if (isPathCalcInProgress) {
|
||||
throw new IllegalStateException("Already doing it");
|
||||
|
||||
@@ -342,14 +342,12 @@ public interface MovementHelper extends ActionCosts, Helper {
|
||||
return state.isBlockNormalCube();
|
||||
}
|
||||
|
||||
static double getMiningDurationTicks(CalculationContext context, BetterBlockPos position,
|
||||
boolean includeFalling) {
|
||||
static double getMiningDurationTicks(CalculationContext context, BetterBlockPos position, boolean includeFalling) {
|
||||
IBlockState state = BlockStateInterface.get(position);
|
||||
return getMiningDurationTicks(context, position.x, position.y, position.z, state, includeFalling);
|
||||
}
|
||||
|
||||
static double getMiningDurationTicks(CalculationContext context, BetterBlockPos position, IBlockState state,
|
||||
boolean includeFalling) {
|
||||
static double getMiningDurationTicks(CalculationContext context, BetterBlockPos position, IBlockState state, boolean includeFalling) {
|
||||
return getMiningDurationTicks(context, position.x, position.y, position.z, state, includeFalling);
|
||||
}
|
||||
|
||||
@@ -357,8 +355,7 @@ public interface MovementHelper extends ActionCosts, Helper {
|
||||
return getMiningDurationTicks(context, x, y, z, BlockStateInterface.get(x, y, z), includeFalling);
|
||||
}
|
||||
|
||||
static double getMiningDurationTicks(CalculationContext context, int x, int y, int z, IBlockState state,
|
||||
boolean includeFalling) {
|
||||
static double getMiningDurationTicks(CalculationContext context, int x, int y, int z, IBlockState state, boolean includeFalling) {
|
||||
Block block = state.getBlock();
|
||||
if (!canWalkThrough(x, y, z, state)) {
|
||||
if (!context.allowBreak()) {
|
||||
|
||||
@@ -40,6 +40,7 @@ import java.util.Objects;
|
||||
import static baritone.utils.pathing.MoveResult.IMPOSSIBLE;
|
||||
|
||||
public class MovementParkour extends Movement {
|
||||
|
||||
private static final EnumFacing[] HORIZONTALS_BUT_ALSO_DOWN____SO_EVERY_DIRECTION_EXCEPT_UP = {EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.EAST, EnumFacing.WEST, EnumFacing.DOWN};
|
||||
private static final BetterBlockPos[] EMPTY = new BetterBlockPos[]{};
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* This file is part of Baritone.
|
||||
*
|
||||
* Baritone is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Baritone is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package baritone.pathing.calc;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
//import static org.junit.Assert.*;
|
||||
|
||||
public class AbstractNodeCostSearchTest {
|
||||
@Test
|
||||
public void testPosHash() {
|
||||
|
||||
System.out.println(Long.toBinaryString(mix(0, 0)));
|
||||
System.out.println(Long.toBinaryString(mix(0, 1)));
|
||||
System.out.println(Long.toBinaryString(mix(1, 0)));
|
||||
System.out.println(Long.toBinaryString(mix(0, -1)));
|
||||
System.out.println(Long.toBinaryString(mix(-1, 0)));
|
||||
System.out.println(Long.toBinaryString(mix(1, -1)));
|
||||
System.out.println(Long.toBinaryString(mix(-1, 1)));
|
||||
|
||||
System.out.println(Long.toBinaryString(mix(-1, - 1)));
|
||||
System.out.println(Long.toBinaryString(mix(-30000000, -1)));
|
||||
System.out.println(Long.toBinaryString(mix(-15000000, -1)));
|
||||
System.out.println(Long.toBinaryString(mix(30000000, -1)));
|
||||
System.out.println(Long.toBinaryString(mix(15000000, -1)));
|
||||
System.out.println(Long.toBinaryString(mix(0, -1)));
|
||||
|
||||
}
|
||||
|
||||
public long mix(int x, int z) {
|
||||
long xzmask = (1L << 26L) - 1; // 38 zero bits, 26 one bits
|
||||
return (((long) x) & xzmask) | ((((long) z) & xzmask) << 26);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user