Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. @EventHandler
  2.     public void onDeath(PlayerDeathEvent e) {
  3.         Player p = e.getEntity();
  4.         int ostalo = cmds.igr.size();
  5.         if(cmds.igr.contains(p)) {
  6.             cmds.igr.remove(p);
  7.             cmds.mrtv.add(p);
  8.         } else if(ostalo == 1) {
  9.             Player win = cmds.igr.get(0);
  10.             int x = cmds.pl.getConfig().getInt("spawnX");
  11.             int y = cmds.pl.getConfig().getInt("spawnY");
  12.             int z = cmds.pl.getConfig().getInt("spawnZ");
  13.             World w = win.getWorld();
  14.             Location spawn = new Location(w, x,  y, z);
  15.             win.teleport(spawn);
  16.             this.clearInv(win);
  17.             this.loadInv(win);
  18.             cmds.igr.remove(win);
  19.             cmds.mrtv.add(p);
  20.             Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', cmds.pl.getConfig().getString("win").replaceAll("%igrac%", win.getName())));
  21.                    
  22.         } else return;
  23.        
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement