Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
onixiya1337 committed Dec 22, 2023
1 parent 9f0c52e commit d8c5531
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
mcVersion=1.8.9
modid=farmhelperv2
modName=FarmHelper
version=2.2.9-pre1
version=2.2.9-pre2
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,7 @@ public class FarmHelperConfig extends Config {
text = "Sell Inventory Now"
)
Runnable autoSellFunction = () -> {
if (mc.currentScreen != null && mc.thePlayer != null) {
PlayerUtils.closeScreen();
}
PlayerUtils.closeScreen();
AutoSell.getInstance().enable(true);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ public void stop() {
activating = false;
autoCookieDelay.reset();
timeoutClock.reset();
if (mc.currentScreen != null && mc.thePlayer != null) {
PlayerUtils.closeScreen();
}
PlayerUtils.closeScreen();
KeyBindUtils.stopMovement();
if (MacroHandler.getInstance().isMacroToggled())
MacroHandler.getInstance().resumeMacro();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ public boolean shouldStartAtMacroStart() {
@Override
public void start() {
if (enabled) return;
if (!mc.thePlayer.capabilities.allowFlying) {
LogUtils.sendError("[Pests Destroyer] You need to be able to fly!");
FarmHelperConfig.enablePestsDestroyer = false;
return;
}
lastKilledEntity = null;
preparing = true;
if (MacroHandler.getInstance().isMacroToggled()) {
Expand Down Expand Up @@ -152,9 +147,7 @@ public void stop() {
}
}
lastKilledEntity = null;
if (mc.currentScreen != null && mc.thePlayer != null) {
PlayerUtils.closeScreen();
}
PlayerUtils.closeScreen();
resetStatesAfterMacroDisabled();
KeyBindUtils.stopMovement();
}
Expand Down Expand Up @@ -204,16 +197,17 @@ public boolean canEnableMacro(boolean manually) {
LogUtils.sendError("[Pests Destroyer] You need higher tier (at least second) of Vacuum to use Pests Destroyer!");
return false;
}

if (!mc.thePlayer.capabilities.allowFlying) {
LogUtils.sendError("[Pests Destroyer] You need to be able to fly!");
return false;
}
if (manually) {
return true;
}

if (!PlayerUtils.isStandingOnSpawnPoint() && !PlayerUtils.isStandingOnRewarpLocation()) {
LogUtils.sendError("[Pests Destroyer] You need to be standing on spawn point or rewarp point to use Pests Destroyer!");
return false;
}

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@ public void stop() {
manuallyStarted = false;
LogUtils.sendDebug("[Visitors Macro] Macro stopped");
rotation.reset();
if (mc.currentScreen != null && mc.thePlayer != null) {
PlayerUtils.closeScreen();
}
PlayerUtils.closeScreen();
KeyBindUtils.stopMovement();
BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().cancelEverything();
}
Expand Down Expand Up @@ -1411,9 +1409,7 @@ public void onReceiveChat(ClientChatReceivedEvent event) {
}
if (buyState == BuyState.CLICK_CROP || buyState == BuyState.OPEN_BZ) {
if (msg.startsWith("You need the Cookie Buff")) {
if (mc.currentScreen != null && mc.thePlayer != null) {
PlayerUtils.closeScreen();
}
PlayerUtils.closeScreen();
LogUtils.sendDebug("[Visitors Macro] Cookie buff is needed. Skipping...");
setBuyState(BuyState.NONE);
setVisitorsState(VisitorsState.NONE);
Expand Down

0 comments on commit d8c5531

Please sign in to comment.