Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/main/java/baritone/behavior/InventoryBehavior.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ public void onTick(TickEvent event) {
return;
}
ticksSinceLastInventoryMove++;
if (firstValidThrowaway() >= 9) { // aka there are none on the hotbar, but there are some in main inventory
requestSwapWithHotBar(firstValidThrowaway(), 8);
}
int pick = bestToolAgainst(Blocks.STONE, PickaxeItem.class);
if (pick >= 9) {
requestSwapWithHotBar(pick, 0);
if (baritone.getPathingBehavior().isPathing()) {
if (firstValidThrowaway() >= 9) { // aka there are none on the hotbar, but there are some in main inventory
requestSwapWithHotBar(firstValidThrowaway(), 8);
}
int pick = bestToolAgainst(Blocks.STONE, PickaxeItem.class);
if (pick >= 9) {
requestSwapWithHotBar(pick, 0);
}
}
if (lastTickRequestedMove != null) {
logDebug("Remembering to move " + lastTickRequestedMove[0] + " " + lastTickRequestedMove[1] + " from a previous tick");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import fi.dy.masa.litematica.schematic.placement.SchematicPlacement;
import fi.dy.masa.litematica.schematic.placement.SubRegionPlacement;
import fi.dy.masa.litematica.world.SchematicWorldHandler;
import fi.dy.masa.litematica.world.WorldSchematic;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Vec3i;
import net.minecraft.util.Tuple;
Expand All @@ -37,6 +36,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;

/**
* Helper class that provides access or processes data related to Litmatica schematics.
Expand Down Expand Up @@ -99,7 +99,11 @@ public static Tuple<IStaticSchematic, Vec3i> getSchematic(int i) {
int minY = Integer.MAX_VALUE;
int minZ = Integer.MAX_VALUE;
HashMap<Vec3i, StaticSchematic> subRegions = new HashMap<>();
Level schematicWorld = SchematicWorldHandler.getSchematicWorld();

// doing this the normal way class loaded WorldSchematic too early
Supplier<Level> supplier = SchematicWorldHandler::getSchematicWorld;
Level schematicWorld = supplier.get();

for (Map.Entry<String, SubRegionPlacement> entry : placement.getEnabledRelativeSubRegionPlacements().entrySet()) {
SubRegionPlacement subPlacement = entry.getValue();
Vec3i pos = transform(subPlacement.getPos(), placement.getMirror(), placement.getRotation());
Expand Down