/[projects]/miscJava/bukkit-minecraft-plugins/WaterWorld/src/dk/thoerup/bukkit/waterworld/WaterTeleportCommand.java
ViewVC logotype

Annotation of /miscJava/bukkit-minecraft-plugins/WaterWorld/src/dk/thoerup/bukkit/waterworld/WaterTeleportCommand.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1655 - (hide annotations) (download)
Sat Dec 10 13:07:43 2011 UTC (12 years, 5 months ago) by torben
File size: 877 byte(s)
Import waterworld plugin

1 torben 1655 package dk.thoerup.bukkit.waterworld;
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 WaterTeleportCommand 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    
22     if (!p.hasPermission("waterworld.tp") ) {
23     p.sendMessage("You don't have permission to TP directly into WaterWorld");
24     return true;
25     }
26    
27     World water = sender.getServer().getWorld("world_water");
28    
29     Location dest = new Location(water, 0, 65,0);
30    
31     p.teleport( dest );
32    
33     return true;
34     }
35     }

  ViewVC Help
Powered by ViewVC 1.1.20