Removed qinspect from Bungee due to large refactor requirement

This commit is contained in:
Rsl1122 2017-12-07 14:06:29 +02:00
parent dbb3fd50da
commit a598ad75fc
3 changed files with 16 additions and 10 deletions

View File

@ -1,7 +1,9 @@
package main.java.com.djrapitops.plan.command; package main.java.com.djrapitops.plan.command;
import com.djrapitops.plugin.api.Check;
import com.djrapitops.plugin.utilities.Verify; import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.PlanBungee;
import java.util.UUID; import java.util.UUID;
@ -27,6 +29,15 @@ public class ConditionUtils {
* @return has the player played before, false if uuid is null. * @return has the player played before, false if uuid is null.
*/ */
public static boolean playerHasPlayed(UUID uuid) { public static boolean playerHasPlayed(UUID uuid) {
return Verify.notNull(uuid) && Plan.getInstance().getServer().getOfflinePlayer(uuid).hasPlayedBefore(); if ( Verify.containsNull(uuid)) {
return false;
}
boolean hasPlayed;
if (Check.isBukkitAvailable()) {
hasPlayed = Plan.getInstance().getServer().getOfflinePlayer(uuid).hasPlayedBefore();
} else {
hasPlayed = PlanBungee.getInstance().getDB().wasSeenBefore(uuid);
}
return hasPlayed;
} }
} }

View File

@ -40,7 +40,6 @@ public class PlanBungeeCommand extends TreeCommand<PlanBungee> {
@Override @Override
public void addCommands() { public void addCommands() {
add( add(
new QInspectCommand(plugin),
new ReloadCommand(plugin), new ReloadCommand(plugin),
new StatusCommand<>(plugin, Permissions.MANAGE.getPermission(), plugin.getColorScheme()), new StatusCommand<>(plugin, Permissions.MANAGE.getPermission(), plugin.getColorScheme()),
new ListCommand() new ListCommand()

View File

@ -10,7 +10,6 @@ import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.task.RunnableFactory; import com.djrapitops.plugin.task.RunnableFactory;
import com.djrapitops.plugin.utilities.Verify; import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.api.IPlan; import main.java.com.djrapitops.plan.api.IPlan;
import main.java.com.djrapitops.plan.command.ConditionUtils;
import main.java.com.djrapitops.plan.data.PlayerProfile; import main.java.com.djrapitops.plan.data.PlayerProfile;
import main.java.com.djrapitops.plan.settings.Permissions; import main.java.com.djrapitops.plan.settings.Permissions;
import main.java.com.djrapitops.plan.settings.locale.Locale; import main.java.com.djrapitops.plan.settings.locale.Locale;
@ -71,9 +70,6 @@ public class QInspectCommand extends SubCommand {
if (!Condition.isTrue(Verify.notNull(uuid), Locale.get(Msg.CMD_FAIL_USERNAME_NOT_VALID).toString(), sender)) { if (!Condition.isTrue(Verify.notNull(uuid), Locale.get(Msg.CMD_FAIL_USERNAME_NOT_VALID).toString(), sender)) {
return; return;
} }
if (!Condition.isTrue(ConditionUtils.playerHasPlayed(uuid), Locale.get(Msg.CMD_FAIL_USERNAME_NOT_SEEN).toString(), sender)) {
return;
}
if (!Condition.isTrue(plugin.getDB().wasSeenBefore(uuid), Locale.get(Msg.CMD_FAIL_USERNAME_NOT_KNOWN).toString(), sender)) { if (!Condition.isTrue(plugin.getDB().wasSeenBefore(uuid), Locale.get(Msg.CMD_FAIL_USERNAME_NOT_KNOWN).toString(), sender)) {
return; return;
} }
@ -107,11 +103,11 @@ public class QInspectCommand extends SubCommand {
double activityIndex = profile.getActivityIndex(now); double activityIndex = profile.getActivityIndex(now);
sender.sendMessage(colT + ball + " " + colM + " Activity Index: " + colS + FormatUtils.cutDecimals(activityIndex) + " | " + FormatUtils.readableActivityIndex(activityIndex)[1]); sender.sendMessage(colT + ball + " " + colM + " Activity Index: " + colS + FormatUtils.cutDecimals(activityIndex) + " | " + FormatUtils.readableActivityIndex(activityIndex)[1]);
sender.sendMessage(colT + ball + " " + colM + " Registered: " + colS + profile.getRegistered()); sender.sendMessage(colT + ball + " " + colM + " Registered: " + colS + FormatUtils.formatTimeStampYear(profile.getRegistered()));
sender.sendMessage(colT + ball + " " + colM + " Last Seen: " + colS + profile.getLastSeen()); sender.sendMessage(colT + ball + " " + colM + " Last Seen: " + colS + FormatUtils.formatTimeStampYear(profile.getLastSeen()));
sender.sendMessage(colT + ball + " " + colM + " Logged in from: " + colS + profile.getMostRecentGeoInfo().getGeolocation()); sender.sendMessage(colT + ball + " " + colM + " Logged in from: " + colS + profile.getMostRecentGeoInfo().getGeolocation());
sender.sendMessage(colT + ball + " " + colM + " Playtime: " + colS + profile.getTotalPlaytime()); sender.sendMessage(colT + ball + " " + colM + " Playtime: " + colS + FormatUtils.formatTimeAmount(profile.getTotalPlaytime()));
sender.sendMessage(colT + ball + " " + colM + " Longest Session: " + colS + profile.getLongestSession(0, now)); sender.sendMessage(colT + ball + " " + colM + " Longest Session: " + colS + FormatUtils.formatTimeAmount(profile.getLongestSession(0, now)));
sender.sendMessage(colT + ball + " " + colM + " Times Kicked: " + colS + profile.getTimesKicked()); sender.sendMessage(colT + ball + " " + colM + " Times Kicked: " + colS + profile.getTimesKicked());
sender.sendMessage(""); sender.sendMessage("");
sender.sendMessage(colT + ball + " " + colM + " Player Kills : " + colS + profile.getPlayerKills().count()); sender.sendMessage(colT + ball + " " + colM + " Player Kills : " + colS + profile.getPlayerKills().count());