Skip to content

Commit

Permalink
feat(command): add feedback to reset cooldown command
Browse files Browse the repository at this point in the history
  • Loading branch information
danorris709 committed Apr 19, 2023
1 parent b201154 commit 5ce7871
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import com.envyful.battle.tower.command.tab.ForgePlayerCompleter;
import com.envyful.battle.tower.player.BattleTowerAttribute;
import net.minecraft.command.ICommandSource;
import net.minecraft.util.Util;
import net.minecraft.util.text.StringTextComponent;

@Command(
value = "resetcooldown",
Expand All @@ -27,10 +29,11 @@ public void onCommand(@Sender ICommandSource sender,
BattleTowerAttribute attribute = target.getAttribute(EnvyBattleTower.class);

if (attribute == null) {
sender.sendMessage(new StringTextComponent("Failed to reset cooldown for " + target.getName() + " please try again in a minute!"), Util.NIL_UUID);
return;
}

attribute.setLastAttempt(null);

sender.sendMessage(new StringTextComponent("Cooldown reset for " + target.getName()), Util.NIL_UUID);
}
}

0 comments on commit 5ce7871

Please sign in to comment.