avery byte scuff btfo
This commit is contained in:
parent
42306055ee
commit
5e9b439591
@ -151,7 +151,7 @@ public final class InventoryBehavior extends Behavior {
|
|||||||
public boolean throwaway(boolean select, Predicate<? super ItemStack> desired) {
|
public boolean throwaway(boolean select, Predicate<? super ItemStack> desired) {
|
||||||
EntityPlayerSP p = ctx.player();
|
EntityPlayerSP p = ctx.player();
|
||||||
NonNullList<ItemStack> inv = p.inventory.mainInventory;
|
NonNullList<ItemStack> inv = p.inventory.mainInventory;
|
||||||
for (byte i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
ItemStack item = inv.get(i);
|
ItemStack item = inv.get(i);
|
||||||
// this usage of settings() is okay because it's only called once during pathing
|
// this usage of settings() is okay because it's only called once during pathing
|
||||||
// (while creating the CalculationContext at the very beginning)
|
// (while creating the CalculationContext at the very beginning)
|
||||||
@ -171,7 +171,7 @@ public final class InventoryBehavior extends Behavior {
|
|||||||
// we've already checked above ^ and the main hand can't possible have an acceptablethrowawayitem
|
// 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 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
|
// 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);
|
ItemStack item = inv.get(i);
|
||||||
if (item.isEmpty() || item.getItem() instanceof ItemPickaxe) {
|
if (item.isEmpty() || item.getItem() instanceof ItemPickaxe) {
|
||||||
if (select) {
|
if (select) {
|
||||||
|
@ -99,15 +99,15 @@ public class ToolSet {
|
|||||||
* Calculate which tool on the hotbar is best for mining
|
* Calculate which tool on the hotbar is best for mining
|
||||||
*
|
*
|
||||||
* @param b the blockstate to be mined
|
* @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) {
|
public int getBestSlot(Block b, boolean preferSilkTouch) {
|
||||||
byte best = 0;
|
int best = 0;
|
||||||
double highestSpeed = Double.NEGATIVE_INFINITY;
|
double highestSpeed = Double.NEGATIVE_INFINITY;
|
||||||
int lowestCost = Integer.MIN_VALUE;
|
int lowestCost = Integer.MIN_VALUE;
|
||||||
boolean bestSilkTouch = false;
|
boolean bestSilkTouch = false;
|
||||||
IBlockState blockState = b.getDefaultState();
|
IBlockState blockState = b.getDefaultState();
|
||||||
for (byte i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
ItemStack itemStack = player.inventory.getStackInSlot(i);
|
ItemStack itemStack = player.inventory.getStackInSlot(i);
|
||||||
double speed = calculateSpeedVsBlock(itemStack, blockState);
|
double speed = calculateSpeedVsBlock(itemStack, blockState);
|
||||||
boolean silkTouch = hasSilkTouch(itemStack);
|
boolean silkTouch = hasSilkTouch(itemStack);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user