Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void Deaths(PlayerDeathEvent e) {
- e.setDeathMessage("");
- e.getDrops().clear();
- e.setDroppedExp(0);
- //long startTime = System.currentTimeMillis();
- if(plugin.playersIngame.containsKey(e.getEntity())) {
- if(e.getEntity().getKiller() != null) {
- if(plugin.playersIngame.containsKey(e.getEntity().getKiller())) {
- Player p = (Player)e.getEntity();
- Player killer = p.getKiller();
- String arena = plugin.playersIngame.get(killer);
- Game g = plugin.games.get(arena);
- g.AddPoints(killer, arena);
- plugin.sb.addDeath(p);
- //if(g != null && p != null) {
- if(g.killstreak.containsKey(p)) {
- g.killstreak.put(p, 0);
- }
- //}
- plugin.sb.updateScoreboard(p);
- plugin.sb.addKill(killer);
- if (plugin.games.get(arena) != null) {
- Game ga = plugin.games.get(arena);
- if (!ga.killstreak.containsKey(killer)) {
- ga.killstreak.put(killer, 1);
- } else { // ------------------------------------------------------
- // KILLSTREAKS
- int newold = (plugin.games.get(arena).killstreak
- .get(killer) + 1);
- // int newold = (old + 1);
- switch (newold) {
- case 6:
- ItemStack is = new ItemStack(
- Material.SLIME_BALL);
- ItemMeta im = is.getItemMeta();
- im.setDisplayName(ChatColor.GREEN + "Grenade");
- is.setItemMeta(im);
- killer.getInventory().addItem(is);
- killer.updateInventory();
- killer.sendMessage(ChatColor.DARK_GRAY
- + "["
- + ChatColor.GOLD
- + "LTPSidesBattle"
- + ChatColor.DARK_GRAY
- + "] "
- + ChatColor.GREEN
- + "Du hast deine 6er Killstreak erreicht");
- killer.sendMessage(ChatColor.DARK_GRAY + "["
- + ChatColor.GOLD + "LTPSidesBattle"
- + ChatColor.DARK_GRAY + "] "
- + ChatColor.GREEN
- + "Du hast eine Granate erhalten");
- // Iterator itr =
- // plugin.games.get(arena).players.iterator();
- // while (itr.hasNext()) {
- // Player player = (Player) itr.next();
- // player.sendMessage(ChatColor.RED +
- // killer.getName() +
- // ChatColor.GOLD +
- // " hat seine 6er Killstreak erreicht");
- // }
- break;
- case 4:
- ItemStack issl = new ItemStack(
- Material.NETHER_STAR);
- ItemMeta imml = issl.getItemMeta();
- imml.setDisplayName(ChatColor.GREEN + "Flash");
- issl.setItemMeta(imml);
- killer.getInventory().addItem(issl);
- killer.updateInventory();
- killer.sendMessage(ChatColor.DARK_GRAY
- + "["
- + ChatColor.GOLD
- + "LTPSidesBattle"
- + ChatColor.DARK_GRAY
- + "] "
- + ChatColor.GREEN
- + "Du hast deine 4er Killstreak erreicht");
- killer.sendMessage(ChatColor.DARK_GRAY + "["
- + ChatColor.GOLD + "LTPSidesBattle"
- + ChatColor.DARK_GRAY + "] "
- + ChatColor.GREEN
- + "Du hast eine Flash-Granate erhalten");
- // Iterator itr =
- // plugin.games.get(arena).players.iterator();
- // while (itr.hasNext()) {
- // Player player = (Player) itr.next();
- // player.sendMessage(ChatColor.RED +
- // killer.getName() +
- // ChatColor.GOLD +
- // " hat seine 4er Killstreak erreicht");
- // }
- break;
- default:
- break;
- }
- if (newold != 6)
- plugin.games.get(arena).killstreak.put(killer,
- newold);
- else if (newold >= 6) {
- plugin.games.get(arena).killstreak.put(killer,
- 0);
- plugin.sb.updateScoreboard(killer);
- }
- // KillStreakLogic(killer, arena, p);
- }
- }
- plugin.sb.updateScoreboard(killer);
- if(plugin.games.get(arena) != null) {
- //if(killer != null && p != null) {
- plugin.games.get(arena).addKillMessage(p, killer, KillMessageType.Normal);
- //}
- }
- //e.setDeathMessage(ChatColor.GOLD + e.getEntity().getKiller().getName() + ChatColor.YELLOW + " [" + ChatColor.GOLD + "Bow" + ChatColor.YELLOW + "] " + ChatColor.GOLD + e.getEntity().getName());
- }
- }
- }
- //long endTime = System.currentTimeMillis();
- //long duration = endTime - startTime;
- //Bukkit.broadcastMessage("Time(ms):" + duration);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement