Пример #1
0
 @Override
 public void handleKick(UUID uuid, C c) {
   Player player = Bukkit.getPlayer(uuid);
   if (player != null && player.isOnline()) {
     MainUtil.sendMessage(BukkitUtil.getPlayer(player), c);
     player.teleport(player.getWorld().getSpawnLocation());
   }
 }
 public static Location getHome(final PlotCluster cluster) {
   final BlockLoc home = cluster.settings.getPosition();
   Location toReturn;
   if (home.y == 0) {
     // default pos
     final PlotId center = getCenterPlot(cluster);
     toReturn = MainUtil.getPlotHome(cluster.world, center);
     if (toReturn.getY() == 0) {
       final PlotManager manager = PlotSquared.getPlotManager(cluster.world);
       final PlotWorld plotworld = PlotSquared.getPlotWorld(cluster.world);
       final Location loc = manager.getSignLoc(plotworld, MainUtil.getPlot(cluster.world, center));
       toReturn.setY(loc.getY());
     }
   } else {
     toReturn = getClusterBottom(cluster).add(home.x, home.y, home.z);
   }
   final int max = BukkitUtil.getHeighestBlock(cluster.world, toReturn.getX(), toReturn.getZ());
   if (max > toReturn.getY()) {
     toReturn.setY(max);
   }
   return toReturn;
 }
Пример #3
0
 @Override
 public void unregister(PlotPlayer player) {
   BukkitUtil.removePlayer(player.getName());
 }