Re implement tab completion list (Close #47)

This commit is contained in:
WiIIiam278 committed 2021-06-10 13:15:41 +01:00
1 parent 1601ce6949
commit 4cc19cb71b
14 files changed
+123 -47

No files matched your search

@@ -11,7 +11,6 @@ import me.william278.huskhomes2.commands.HomeCommand;
import me.william278.huskhomes2.commands.PublicHomeCommand;
import me.william278.huskhomes2.commands.WarpCommand;
import me.william278.huskhomes2.data.DataManager;
import me.william278.huskhomes2.integrations.Map.DynMap;
import me.william278.huskhomes2.integrations.VaultIntegration;
import me.william278.huskhomes2.teleport.points.Home;
import me.william278.huskhomes2.teleport.points.TeleportationPoint;
@@ -115,9 +115,9 @@ public class TeleportManager {
public static void queueRandomTeleport(Player player, Connection connection) throws SQLException {
if (!player.hasPermission("huskhomes.rtp.bypass_cooldown")) {
long currentTime = Instant.now().getEpochSecond();
long cooldownTime = DataManager.getPlayerRtpCooldown(player, connection);
if (currentTime < cooldownTime) {
long timeRemaining = cooldownTime - currentTime;
long coolDownTime = DataManager.getPlayerRtpCooldown(player, connection);
if (currentTime < coolDownTime) {
long timeRemaining = coolDownTime - currentTime;
long timeRemainingMinutes = timeRemaining / 60;
MessageManager.sendMessage(player, "error_rtp_cooldown", Long.toString(timeRemainingMinutes));
return;
@@ -28,7 +28,6 @@ public class TimedTeleport {
private final Location initialLocation;
private final double initialHealth;
private int timeRemaining;
private final int warmupTime = HuskHomes.getSettings().getTeleportWarmupTime();
public TimedTeleport(Player player, TeleportationPoint targetPoint, TargetType targetType) {
@@ -37,7 +36,6 @@ public class TimedTeleport {
this.initialHealth = player.getHealth();
this.targetType = targetType;
this.targetPoint = targetPoint;
this.timeRemaining = warmupTime;
MessageManager.sendMessage(player, "teleporting_countdown_start", Integer.toString(this.warmupTime));
MessageManager.sendMessage(player, "teleporting_please_stand_still");
@@ -48,7 +46,6 @@ public class TimedTeleport {
this.initialLocation = player.getLocation();
this.initialHealth = player.getHealth();
this.targetType = TargetType.RANDOM;
this.timeRemaining = warmupTime;
MessageManager.sendMessage(player, "teleporting_countdown_start", Integer.toString(this.warmupTime));
MessageManager.sendMessage(player, "teleporting_please_stand_still");
@@ -60,7 +57,6 @@ public class TimedTeleport {
this.initialHealth = player.getHealth();
this.targetType = TargetType.PLAYER;
this.targetPlayerName = targetPlayerName;
this.timeRemaining = warmupTime;
MessageManager.sendMessage(player, "teleporting_countdown_start", Integer.toString(this.warmupTime));
MessageManager.sendMessage(player, "teleporting_please_stand_still");
@@ -192,14 +188,6 @@ public class TimedTeleport {
return player;
}
public int getTimeRemaining() {
return timeRemaining;
}
public void decrementTimeRemaining() {
timeRemaining = timeRemaining - 1;
}
public enum TargetType {
POINT,
BACK,