Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pest Farmer #274

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
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.9.1-pre2
version=2.9.11.1
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand;
import com.jelly.farmhelperv2.FarmHelper;
import com.jelly.farmhelperv2.config.FarmHelperConfig;
import com.jelly.farmhelperv2.feature.impl.AutoWardrobe;
import com.jelly.farmhelperv2.handler.GameStateHandler;
import com.jelly.farmhelperv2.pathfinder.FlyPathFinderExecutor;
import com.jelly.farmhelperv2.util.LogUtils;
Expand All @@ -15,6 +16,8 @@
import net.minecraft.util.Vec3;

import java.util.Optional;
import java.util.Arrays;
import java.lang.Float;

@Command(value = "fh", aliases = {"farmhelper"}, description = "FarmHelper main command")
public class FarmHelperMainCommand {
Expand Down Expand Up @@ -58,6 +61,21 @@ public void pathfind(int x, int y, int z,
FlyPathFinderExecutor.getInstance().findPath(new Vec3(x, y, z), follow, smooth);
}

@SubCommand(aliases = {"pf"})
public void pathfind(String x, String y, String z, String threshold,
@Description(value = "Tell the pathfinder, to constantly follow and recalibrate path until arrive", autoCompletesTo = {"true", "false"}) boolean follow,
@Description(value = "Tell the pathfinder, to smooth out the path", autoCompletesTo = {"true", "false"}) boolean smooth,
@Description(value = "Tell to pathfinder, to sprint while flying") boolean sprint) {
try {
FlyPathFinderExecutor.getInstance().setStoppingPositionThreshold(Float.valueOf(threshold));
FlyPathFinderExecutor.getInstance().setSprinting(sprint);
FlyPathFinderExecutor.getInstance().findPath(new Vec3(Float.valueOf(x), Float.valueOf(y), Float.valueOf(z)), follow, smooth);
} catch (Exception e) {
LogUtils.sendError("Could not. KYS");
e.printStackTrace();
}
}

@SubCommand(aliases = {"sp"})
public void stoppath() {
FlyPathFinderExecutor.getInstance().stop();
Expand All @@ -69,8 +87,13 @@ public void update() {
FarmHelperConfig.checkForUpdate();
}

@SubCommand
public void test(){
LogUtils.sendSuccess("SprayonatorState: " + GameStateHandler.getInstance().getSprayonatorState());
@SubCommand(aliases = {"stp"})
public void swapToPest() {
AutoWardrobe.instance.swapTo(FarmHelperConfig.pestFarmingSet0Slot, Arrays.asList(FarmHelperConfig.pestFarmingEq0.split("\\|")));
}

@SubCommand(aliases = {"stf"})
public void swapToFarm() {
AutoWardrobe.instance.swapTo(FarmHelperConfig.pestFarmingSet1Slot, Arrays.asList(FarmHelperConfig.pestFarmingEq1.split("\\|")));
}
}
Loading