Merge commands with their tab completers

This commit is contained in:
Daniil Z committed 2021-03-01 00:07:57 +03:00
1 parent 8b4c0bb6e4
commit cc065c8dde
37 files changed
+470 -512

No files matched your search

@@ -0,0 +1,27 @@
package me.william278.huskhomes2.commands;
import me.william278.huskhomes2.dataManager;
import me.william278.huskhomes2.messageManager;
import me.william278.huskhomes2.objects.TeleportationPoint;
import me.william278.huskhomes2.teleportManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class BackCommand extends CommandBase {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
TeleportationPoint lastPosition = dataManager.getPlayerLastPosition(p);
if (lastPosition != null) {
teleportManager.queueTimedTeleport(p, lastPosition);
} else {
messageManager.sendMessage(p, "error_no_last_position");
}
return true;
}
return false;
}
}