appease codacy
This commit is contained in:
parent
9703de86d3
commit
0ef3386ebf
@ -55,10 +55,7 @@ public class InventoryBehavior extends Behavior {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void swapWithHotBar(int inInventory, int inHotbar) {
|
private void swapWithHotBar(int inInventory, int inHotbar) {
|
||||||
if (inInventory < 9) {
|
ctx.playerController().windowClick(ctx.player().inventoryContainer.windowId, inInventory < 9 ? inInventory + 36 : inInventory, inHotbar, ClickType.SWAP, ctx.player());
|
||||||
inInventory += 36;
|
|
||||||
}
|
|
||||||
ctx.playerController().windowClick(ctx.player().inventoryContainer.windowId, inInventory, inHotbar, ClickType.SWAP, ctx.player());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int firstValidThrowaway() { // TODO offhand idk
|
private int firstValidThrowaway() { // TODO offhand idk
|
||||||
|
@ -116,12 +116,10 @@ public final class MemoryBehavior extends Behavior {
|
|||||||
|
|
||||||
System.out.println("Received packet " + packet.getGuiId() + " " + packet.getEntityId() + " " + packet.getSlotCount() + " " + packet.getWindowId());
|
System.out.println("Received packet " + packet.getGuiId() + " " + packet.getEntityId() + " " + packet.getSlotCount() + " " + packet.getWindowId());
|
||||||
System.out.println(packet.getWindowTitle());
|
System.out.println(packet.getWindowTitle());
|
||||||
if (packet.getWindowTitle() instanceof TextComponentTranslation) {
|
if (packet.getWindowTitle() instanceof TextComponentTranslation && ((TextComponentTranslation) packet.getWindowTitle()).getKey().equals("container.enderchest")) {
|
||||||
// title is not customized (i.e. this isn't just a renamed shulker)
|
// title is not customized (i.e. this isn't just a renamed shulker)
|
||||||
if (((TextComponentTranslation) packet.getWindowTitle()).getKey().equals("container.enderchest")) {
|
enderChestWindowId = packet.getWindowId();
|
||||||
enderChestWindowId = packet.getWindowId();
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
futureInventories.stream()
|
futureInventories.stream()
|
||||||
.filter(i -> i.type.equals(packet.getGuiId()) && i.slots == packet.getSlotCount())
|
.filter(i -> i.type.equals(packet.getGuiId()) && i.slots == packet.getSlotCount())
|
||||||
|
@ -123,7 +123,8 @@ public class ContainerMemory implements IContainerMemory {
|
|||||||
return out.array();
|
return out.array();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PacketBuffer writeItemStacks(List<ItemStack> write, PacketBuffer out) {
|
public static PacketBuffer writeItemStacks(List<ItemStack> write, PacketBuffer out2) {
|
||||||
|
PacketBuffer out = out2; // avoid reassigning an argument LOL
|
||||||
out = new PacketBuffer(out.writeInt(write.size()));
|
out = new PacketBuffer(out.writeInt(write.size()));
|
||||||
for (ItemStack stack : write) {
|
for (ItemStack stack : write) {
|
||||||
out = out.writeItemStack(stack);
|
out = out.writeItemStack(stack);
|
||||||
|
@ -23,16 +23,12 @@ import baritone.api.utils.BetterBlockPos;
|
|||||||
import baritone.api.utils.IPlayerContext;
|
import baritone.api.utils.IPlayerContext;
|
||||||
import it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap;
|
import it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public final class Favoring {
|
public final class Favoring {
|
||||||
private List<Avoidance> avoidances;
|
|
||||||
private final Long2DoubleOpenHashMap favorings;
|
private final Long2DoubleOpenHashMap favorings;
|
||||||
|
|
||||||
public Favoring(IPlayerContext ctx, IPath previous) {
|
public Favoring(IPlayerContext ctx, IPath previous) {
|
||||||
this(previous);
|
this(previous);
|
||||||
avoidances = Avoidance.create(ctx);
|
for (Avoidance avoid : Avoidance.create(ctx)) {
|
||||||
for (Avoidance avoid : avoidances) {
|
|
||||||
avoid.applySpherical(favorings);
|
avoid.applySpherical(favorings);
|
||||||
}
|
}
|
||||||
System.out.println("Favoring size: " + favorings.size());
|
System.out.println("Favoring size: " + favorings.size());
|
||||||
|
Loading…
Reference in New Issue
Block a user