Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelly298 committed Jul 2, 2022
1 parent 3e9808d commit a8545f7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/main/java/com/jelly/CaneBuilder/ThreadManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.jelly.CaneBuilder.utils.Utils;

import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.List;

public class ThreadManager {
Expand All @@ -21,11 +22,14 @@ public static void executeThread(Thread thread){
}).start();
}
public static void stopExistingThreads(){
for(Thread t : currentThreads){
Utils.addCustomLog("Threads interrupted");
t.interrupt();
currentThreads.remove(t);
for (Thread t : currentThreads) {
try {
Utils.addCustomLog("Threads interrupted");
t.interrupt();
} catch (Exception e) {
}
}
currentThreads.clear();
}


Expand Down
13 changes: 12 additions & 1 deletion src/main/java/com/jelly/CaneBuilder/processes/PlaceSC.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void onEnable() {
}
threadSleep(500);
mc.thePlayer.closeScreen();
//clear hotbar & set rancher's boots
//set rancher's boots
Utils.addCustomLog("Setting Rancher's boot's speed");
Thread.sleep(500);
InventoryUtils.openInventory();
Expand Down Expand Up @@ -199,6 +199,17 @@ public void onEnable() {
Thread.sleep(500);
KeyBinding.onTick(mc.gameSettings.keyBindUseItem.getKeyCode());
Thread.sleep(500);
//clear hotbar
InventoryUtils.openInventory();
for(int i = 0; i < 8; i++) {
if (mc.thePlayer.inventoryContainer.getSlot(i + 36).getHasStack()) {
clickWindow(mc.thePlayer.openContainer.windowId, 36 + i, 0, 1);
Thread.sleep(500);
}
}
Thread.sleep(500);
mc.thePlayer.closeScreen();
Thread.sleep(500);
//init pos
Utils.addCustomLog("Initializing place sugarcane");
rotation.easeTo(AngleUtils.parallelToC1(), 89f, 1000);
Expand Down

0 comments on commit a8545f7

Please sign in to comment.