codady submission complete

This commit is contained in:
Leijurv 2018-10-27 16:18:03 -07:00
parent 1dee8ef355
commit c4b0e0a810
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
4 changed files with 42 additions and 50 deletions

View File

@ -33,41 +33,45 @@ import java.util.*;
*/ */
public final class CachedChunk implements IBlockTypeAccess, Helper { public final class CachedChunk implements IBlockTypeAccess, Helper {
public static final Set<Block> BLOCKS_TO_KEEP_TRACK_OF = Collections.unmodifiableSet(new HashSet<Block>() {{ public static final Set<Block> BLOCKS_TO_KEEP_TRACK_OF;
add(Blocks.DIAMOND_ORE);
add(Blocks.DIAMOND_BLOCK);
//add(Blocks.COAL_ORE);
add(Blocks.COAL_BLOCK);
//add(Blocks.IRON_ORE);
add(Blocks.IRON_BLOCK);
//add(Blocks.GOLD_ORE);
add(Blocks.GOLD_BLOCK);
add(Blocks.EMERALD_ORE);
add(Blocks.EMERALD_BLOCK);
add(Blocks.ENDER_CHEST); static {
add(Blocks.FURNACE); HashSet<Block> temp = new HashSet<>();
add(Blocks.CHEST); temp.add(Blocks.DIAMOND_ORE);
add(Blocks.TRAPPED_CHEST); temp.add(Blocks.DIAMOND_BLOCK);
add(Blocks.END_PORTAL); //temp.add(Blocks.COAL_ORE);
add(Blocks.END_PORTAL_FRAME); temp.add(Blocks.COAL_BLOCK);
add(Blocks.MOB_SPAWNER); //temp.add(Blocks.IRON_ORE);
temp.add(Blocks.IRON_BLOCK);
//temp.add(Blocks.GOLD_ORE);
temp.add(Blocks.GOLD_BLOCK);
temp.add(Blocks.EMERALD_ORE);
temp.add(Blocks.EMERALD_BLOCK);
temp.add(Blocks.ENDER_CHEST);
temp.add(Blocks.FURNACE);
temp.add(Blocks.CHEST);
temp.add(Blocks.TRAPPED_CHEST);
temp.add(Blocks.END_PORTAL);
temp.add(Blocks.END_PORTAL_FRAME);
temp.add(Blocks.MOB_SPAWNER);
// TODO add all shulker colors // TODO add all shulker colors
add(Blocks.PORTAL); temp.add(Blocks.PORTAL);
add(Blocks.HOPPER); temp.add(Blocks.HOPPER);
add(Blocks.BEACON); temp.add(Blocks.BEACON);
add(Blocks.BREWING_STAND); temp.add(Blocks.BREWING_STAND);
add(Blocks.SKULL); temp.add(Blocks.SKULL);
add(Blocks.ENCHANTING_TABLE); temp.add(Blocks.ENCHANTING_TABLE);
add(Blocks.ANVIL); temp.add(Blocks.ANVIL);
add(Blocks.LIT_FURNACE); temp.add(Blocks.LIT_FURNACE);
add(Blocks.BED); temp.add(Blocks.BED);
add(Blocks.DRAGON_EGG); temp.add(Blocks.DRAGON_EGG);
add(Blocks.JUKEBOX); temp.add(Blocks.JUKEBOX);
add(Blocks.END_GATEWAY); temp.add(Blocks.END_GATEWAY);
add(Blocks.WEB); temp.add(Blocks.WEB);
add(Blocks.NETHER_WART); temp.add(Blocks.NETHER_WART);
}}); BLOCKS_TO_KEEP_TRACK_OF = Collections.unmodifiableSet(temp);
}
/** /**
* The size of the chunk data in bits. Equal to 16 KiB. * The size of the chunk data in bits. Equal to 16 KiB.

View File

@ -87,10 +87,7 @@ public class CalculationContext implements Helper {
if (!allowBreak()) { if (!allowBreak()) {
return false; return false;
} }
if (isPossiblyProtected(x, y, z)) { return !isPossiblyProtected(x, y, z);
return false;
}
return true;
} }
public boolean isPossiblyProtected(int x, int y, int z) { public boolean isPossiblyProtected(int x, int y, int z) {

View File

@ -226,7 +226,7 @@ public interface MovementHelper extends ActionCosts, Helper {
return true; return true;
} }
return facing == playerFacing == open; return (facing == playerFacing) == open;
} }
static boolean avoidWalkingInto(Block block) { static boolean avoidWalkingInto(Block block) {
@ -295,10 +295,7 @@ public interface MovementHelper extends ActionCosts, Helper {
} }
return true; return true;
} }
if (block instanceof BlockStairs) { return block instanceof BlockStairs;
return true;
}
return false;
} }
static boolean canWalkOn(BetterBlockPos pos, IBlockState state) { static boolean canWalkOn(BetterBlockPos pos, IBlockState state) {

View File

@ -326,10 +326,7 @@ public class PathExecutor implements IPathExecutor, Helper {
// when we're midair in the middle of a fall, we're very far from both the beginning and the end, but we aren't actually off path // when we're midair in the middle of a fall, we're very far from both the beginning and the end, but we aren't actually off path
if (path.movements().get(pathPosition) instanceof MovementFall) { if (path.movements().get(pathPosition) instanceof MovementFall) {
BlockPos fallDest = path.positions().get(pathPosition + 1); // .get(pathPosition) is the block we fell off of BlockPos fallDest = path.positions().get(pathPosition + 1); // .get(pathPosition) is the block we fell off of
if (VecUtils.entityFlatDistanceToCenter(player(), fallDest) < leniency) { // ignore Y by using flat distance return VecUtils.entityFlatDistanceToCenter(player(), fallDest) >= leniency; // ignore Y by using flat distance
return false;
}
return true;
} else { } else {
return true; return true;
} }
@ -433,10 +430,7 @@ public class PathExecutor implements IPathExecutor, Helper {
if (next instanceof MovementTraverse && next.getDirection().down().equals(current.getDirection()) && MovementHelper.canWalkOn(next.getDest().down())) { if (next instanceof MovementTraverse && next.getDirection().down().equals(current.getDirection()) && MovementHelper.canWalkOn(next.getDest().down())) {
return true; return true;
} }
if (next instanceof MovementDiagonal && Baritone.settings().allowOvershootDiagonalDescend.get()) { return next instanceof MovementDiagonal && Baritone.settings().allowOvershootDiagonalDescend.get();
return true;
}
return false;
} }
private void onChangeInPathPosition() { private void onChangeInPathPosition() {