mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 22:17:17 +00:00
Let's use some more of CommandBase
This commit is contained in:
29 files changed
+541
-643
No files matched your search
@@ -4,26 +4,21 @@ import me.william278.huskhomes2.HuskHomes;
|
||||
import me.william278.huskhomes2.MessageManager;
|
||||
import me.william278.huskhomes2.teleport.TeleportManager;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class SpawnCommand extends CommandBase {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (sender instanceof Player) {
|
||||
Player p = (Player) sender;
|
||||
if (HuskHomes.settings.doSpawnCommand()) {
|
||||
if (TeleportManager.spawnLocation != null) {
|
||||
TeleportManager.queueTimedTeleport(p, TeleportManager.spawnLocation);
|
||||
} else {
|
||||
MessageManager.sendMessage(p, "error_spawn_undefined");
|
||||
}
|
||||
protected boolean onCommand(Player p, Command command, String label, String[] args) {
|
||||
if (HuskHomes.settings.doSpawnCommand()) {
|
||||
if (TeleportManager.spawnLocation != null) {
|
||||
TeleportManager.queueTimedTeleport(p, TeleportManager.spawnLocation);
|
||||
} else {
|
||||
MessageManager.sendMessage(p, "error_command_disabled");
|
||||
MessageManager.sendMessage(p, "error_spawn_undefined");
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
MessageManager.sendMessage(p, "error_command_disabled");
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user