Plan/Plan Advanced/src/com/djrapitops/plan/command/commands/SearchCommand.java
Rsl1122 f9fbf17fe6 Clean-up, Additions, PlanLite package change, Locations disabled, More Javadoc, Bugfixes
- Changed format of all BukkitRunnables to be the same.
- Added a delayed task for cache clearing if data is being saved.
- Changed PlanLite packages from com.djrapitops.plan to
com.djrapitops.planlite
- Moved useful utilities to com.djrapitops.plan.utilities and removed
rest
- Location Handling (and saving) disabled for now because of inefficient
saving to SQL.
- Added more javadocs

Fixed bugs:
- Locations not saved when player moves (Fixed, but location handling
will be disabled for now)

Known Bugs:
- Times don't update on inspect (Just need to call update if player is
online, one line missing.)
- ClassCastException on start-up when PlanLite is not installed. (Will
fix with try catch tomorrow.)
2017-01-10 00:05:37 +02:00

46 lines
1.6 KiB
Java

package com.djrapitops.plan.command.commands;
import com.djrapitops.plan.Phrase;
import com.djrapitops.plan.Plan;
import com.djrapitops.plan.command.CommandType;
import com.djrapitops.plan.command.SubCommand;
import com.djrapitops.plan.utilities.FormatUtils;
import java.util.Arrays;
import java.util.Date;
import java.util.Set;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
public class SearchCommand extends SubCommand {
private final Plan plugin;
public SearchCommand(Plan plugin) {
super("search", "plan.search", "Inspect specific data /plan <search terms> [-p]", CommandType.CONSOLE_WITH_ARGUMENTS);
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Date refreshDate = new Date();
ChatColor operatorColor = Phrase.COLOR_MAIN.color();
ChatColor textColor = Phrase.COLOR_SEC.color();
//header
sender.sendMessage(textColor + "-- [" + operatorColor + "PLAN - Search results: took " + FormatUtils.formatTimeAmountSinceDate(refreshDate, new Date()) + textColor + "] --");
sender.sendMessage(operatorColor + "Results for: " + Arrays.toString(args));
sender.sendMessage(textColor + "Matching player: ");
if (false) {
sender.sendMessage(operatorColor + "No results for " + textColor + Arrays.toString(args) + operatorColor + ".");
}
sender.sendMessage(textColor + "-- o --");
return true;
}
}