From 5e9b43959147b14ec2d5775f74df73c3e4d6e6ed Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 10 Oct 2019 17:47:26 -0700 Subject: [PATCH] avery byte scuff btfo --- src/main/java/baritone/behavior/InventoryBehavior.java | 4 ++-- src/main/java/baritone/utils/ToolSet.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/baritone/behavior/InventoryBehavior.java b/src/main/java/baritone/behavior/InventoryBehavior.java index 63e6c91ea..b21cec033 100644 --- a/src/main/java/baritone/behavior/InventoryBehavior.java +++ b/src/main/java/baritone/behavior/InventoryBehavior.java @@ -151,7 +151,7 @@ public boolean selectThrowawayForLocation(boolean select, int x, int y, int z) { public boolean throwaway(boolean select, Predicate desired) { EntityPlayerSP p = ctx.player(); NonNullList inv = p.inventory.mainInventory; - for (byte i = 0; i < 9; i++) { + for (int i = 0; i < 9; i++) { ItemStack item = inv.get(i); // this usage of settings() is okay because it's only called once during pathing // (while creating the CalculationContext at the very beginning) @@ -171,7 +171,7 @@ public boolean throwaway(boolean select, Predicate desired) { // we've already checked above ^ and the main hand can't possible have an acceptablethrowawayitem // so we need to select in the main hand something that doesn't right click // so not a shovel, not a hoe, not a block, etc - for (byte i = 0; i < 9; i++) { + for (int i = 0; i < 9; i++) { ItemStack item = inv.get(i); if (item.isEmpty() || item.getItem() instanceof ItemPickaxe) { if (select) { diff --git a/src/main/java/baritone/utils/ToolSet.java b/src/main/java/baritone/utils/ToolSet.java index 90f06bb08..b6446b30d 100644 --- a/src/main/java/baritone/utils/ToolSet.java +++ b/src/main/java/baritone/utils/ToolSet.java @@ -99,15 +99,15 @@ public boolean hasSilkTouch(ItemStack stack) { * Calculate which tool on the hotbar is best for mining * * @param b the blockstate to be mined - * @return A byte containing the index in the tools array that worked best + * @return An int containing the index in the tools array that worked best */ - public byte getBestSlot(Block b, boolean preferSilkTouch) { - byte best = 0; + public int getBestSlot(Block b, boolean preferSilkTouch) { + int best = 0; double highestSpeed = Double.NEGATIVE_INFINITY; int lowestCost = Integer.MIN_VALUE; boolean bestSilkTouch = false; IBlockState blockState = b.getDefaultState(); - for (byte i = 0; i < 9; i++) { + for (int i = 0; i < 9; i++) { ItemStack itemStack = player.inventory.getStackInSlot(i); double speed = calculateSpeedVsBlock(itemStack, blockState); boolean silkTouch = hasSilkTouch(itemStack);