Skip to content

Commit

Permalink
= Auto Repellant - Another possible fix
Browse files Browse the repository at this point in the history
= Pest Destroyer - Fixed not flying after tp'ing to water
+ Logs
  • Loading branch information
May2Beez committed Dec 16, 2023
1 parent 8e79069 commit c6c4c56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AutoRepellent implements IFeature {
private static AutoRepellent instance;

public final static Clock repellentFailsafeClock = new Clock();
private final Pattern repellentRegex = Pattern.compile("(\\d+)m\\s(\\d+)s");
private final Pattern repellentRegex = Pattern.compile("(\\d+?)m?\\s?(\\d+)s");

private int savedSlot = 0;

Expand Down Expand Up @@ -391,7 +391,7 @@ public void onChatReceived(ClientChatReceivedEvent event) {
} else if (state == State.WAIT_FOR_REPELLENT) {
System.out.println(message);
if (message.startsWith("YUM! Pests will now spawn")) {
repellentFailsafeClock.schedule(TimeUnit.MILLISECONDS.convert(1, TimeUnit.HOURS));
repellentFailsafeClock.schedule(TimeUnit.MILLISECONDS.convert(1, TimeUnit.HOURS) + 5_000);
LogUtils.sendDebug("Repellent used!");
if (this.hotbarSlot == -1) {
state = State.NONE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,13 +817,10 @@ private void flyAwayFromGround() {
stop();
return;
}
if (mc.thePlayer.motionY == 0) {
delayClock.schedule(400);
return;
}

if (mc.thePlayer.onGround && !PlayerUtils.isPlayerSuffocating()) {
KeyBindUtils.holdThese(mc.gameSettings.keyBindJump);
Multithreading.schedule(KeyBindUtils::stopMovement, 150, TimeUnit.MILLISECONDS);
Multithreading.schedule(KeyBindUtils::stopMovement, 280, TimeUnit.MILLISECONDS);
Multithreading.schedule(() -> {
if (!mc.thePlayer.capabilities.isFlying && !mc.thePlayer.onGround) {
mc.thePlayer.capabilities.isFlying = true;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/jelly/farmhelperv2/util/PlayerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ public static void getTool() {
LogUtils.sendDebug("No tool found!");
return;
}
LogUtils.sendDebug("Tool id: " + id);
LogUtils.sendDebug("Current item: " + mc.thePlayer.inventory.currentItem);
LogUtils.sendDebug("Tool id: " + id + " current item: " + mc.thePlayer.inventory.currentItem);
if (id == mc.thePlayer.inventory.currentItem) return;
mc.thePlayer.inventory.currentItem = id;
}
Expand Down

0 comments on commit c6c4c56

Please sign in to comment.