/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/SpawnCommand.java
ViewVC logotype

Contents of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/SpawnCommand.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1848 - (show annotations) (download)
Sat Sep 22 14:58:13 2012 UTC (11 years, 7 months ago) by torben
File size: 681 byte(s)
added /spawn command
1 package dk.thoerup.bukkit.hoeruputils;
2
3 import org.bukkit.ChatColor;
4 import org.bukkit.Location;
5 import org.bukkit.World;
6 import org.bukkit.command.Command;
7 import org.bukkit.command.CommandExecutor;
8 import org.bukkit.command.CommandSender;
9 import org.bukkit.entity.Player;
10
11 public class SpawnCommand implements CommandExecutor {
12
13 @Override
14 public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {
15
16 if (!(sender instanceof Player)) { // it's not a console command
17 return false;
18 }
19
20 Player p = (Player) sender;
21 Location spawn = p.getLocation().getWorld().getSpawnLocation();
22
23
24 p.teleport( spawn );
25
26 return true;
27 }
28 }

  ViewVC Help
Powered by ViewVC 1.1.20