mirror of https://github.com/cabaletta/baritone
write to a file to indicate success
This commit is contained in:
parent
277ba3643c
commit
2a8dcee028
|
@ -10,7 +10,7 @@ install:
|
|||
|
||||
script:
|
||||
- docker run --rm cabaletta/baritone ./gradlew javadoc
|
||||
- docker run --name baritone cabaletta/baritone /bin/sh -c "set -e; /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 128x128x24 -ac +extension GLX +render; DISPLAY=:99 BARITONE_AUTO_TEST=true ./gradlew runClient"
|
||||
- docker run --name baritone cabaletta/baritone /bin/sh -c "set -e; /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 128x128x24 -ac +extension GLX +render; DISPLAY=:99 BARITONE_AUTO_TEST=true ./gradlew runClient; cat /code/autotest/success"
|
||||
- docker cp baritone:/code/dist dist
|
||||
- ls dist
|
||||
- cat dist/checksums.txt
|
||||
|
|
|
@ -35,6 +35,10 @@ import net.minecraft.world.WorldSettings;
|
|||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
/**
|
||||
* Responsible for automatically testing Baritone's pathing algorithm by automatically creating a world with a specific
|
||||
* seed, setting a specified goal, and only allowing a certain amount of ticks to pass before the pathing test is
|
||||
|
@ -127,6 +131,11 @@ public class BaritoneAutoTest implements AbstractGameEventListener, Helper {
|
|||
// If we have reached our goal, print a message and safely close the game
|
||||
if (GOAL.isInGoal(ctx.playerFeet())) {
|
||||
System.out.println("Successfully pathed to " + ctx.playerFeet() + " in " + event.getCount() + " ticks");
|
||||
try {
|
||||
Files.write(Paths.get(Minecraft.getInstance().gameDir.toString()), "Success!".getBytes());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mc.shutdown();
|
||||
mc.shutdownMinecraftApplet();
|
||||
System.exit(0);
|
||||
|
|
Loading…
Reference in New Issue