From 212eb07131cdb920dc87a2e3738a507ec3050782 Mon Sep 17 00:00:00 2001 From: altrisi Date: Sat, 8 Jan 2022 21:12:23 +0100 Subject: [PATCH] Give feedback when stepping ticks (#1234) --- src/main/java/carpet/commands/TickCommand.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/carpet/commands/TickCommand.java b/src/main/java/carpet/commands/TickCommand.java index b4ada51e..78a8af5d 100644 --- a/src/main/java/carpet/commands/TickCommand.java +++ b/src/main/java/carpet/commands/TickCommand.java @@ -51,10 +51,10 @@ public class TickCommand then(literal("deep").executes( (c)-> setFreeze(c.getSource(), true, true)))). then(literal("off").executes( (c) -> setFreeze(c.getSource(), false, false)))). then(literal("step"). - executes((c) -> step(1)). + executes((c) -> step(c.getSource(), 1)). then(argument("ticks", integer(1,72000)). suggests( (c, b) -> suggestMatching(new String[]{"20"},b)). - executes((c) -> step(getInteger(c,"ticks"))))). + executes((c) -> step(c.getSource(), getInteger(c,"ticks"))))). then(literal("superHot").executes( (c)-> toggleSuperHot(c.getSource()))). then(literal("health"). executes( (c) -> healthReport(c.getSource(), 100)). @@ -130,9 +130,10 @@ public class TickCommand return setFreeze(source, isDeep, !TickSpeed.isPaused()); } - private static int step(int advance) + private static int step(ServerCommandSource source, int advance) { TickSpeed.add_ticks_to_run_in_pause(advance); + Messenger.m(source, "gi Stepping " + advance + " tick" + (advance != 1 ? "s" : "")); return 1; }