|
|
@ -79,37 +79,43 @@ public class PlayerListener implements Listener { |
|
|
|
private BukkitTask task; |
|
|
|
|
|
|
|
public void sendArrowParticle(Player p, Entity e) { |
|
|
|
if (plugin.getPam().getParticleByName("arrow", PlayerStat.getPlayerStat(p).getArrow_trail()).getTrail() |
|
|
|
.equalsIgnoreCase("EMPTY")) |
|
|
|
return; |
|
|
|
task = Bukkit.getServer().getScheduler().runTaskTimerAsynchronously(this.plugin, () -> { |
|
|
|
Location loc = e.getLocation(); |
|
|
|
if (e.isOnGround() || e.getLocation().getY() < 10) { |
|
|
|
if (e.isOnGround() || e.getLocation().getY() < 10 || leaving.contains(p)) { |
|
|
|
task.cancel(); |
|
|
|
return; |
|
|
|
} |
|
|
|
createTrail(loc, plugin.getPam().getParticleByName("arrow", PlayerStat.getPlayerStat(p).getArrow_trail())); |
|
|
|
}, 0, 1); |
|
|
|
} |
|
|
|
|
|
|
|
public void sendFeetParticle(Player p) { |
|
|
|
if (p.isFlying() || p.hasPotionEffect(PotionEffectType.INVISIBILITY) || p.getGameMode() == GameMode.SPECTATOR) { |
|
|
|
if (plugin.getPam().getParticleByName("arrow", PlayerStat.getPlayerStat(p).getArrow_trail()).getTrail() |
|
|
|
.equalsIgnoreCase("EMPTY")) |
|
|
|
return; |
|
|
|
if (p.isFlying() || p.hasPotionEffect(PotionEffectType.INVISIBILITY) || p.getGameMode() == GameMode.SPECTATOR |
|
|
|
|| leaving.contains(p)) |
|
|
|
return; |
|
|
|
} |
|
|
|
Location loc = p.getLocation(); |
|
|
|
createTrail(loc, plugin.getPam().getParticleByName("feet", PlayerStat.getPlayerStat(p).getFeet_trail())); |
|
|
|
} |
|
|
|
|
|
|
|
public void createTrail(Location loc, cx.sfy.TheBridge.cosmetics.Particle particle) { |
|
|
|
plugin.getNms().sendParticle(ParticleType.valueOf(particle.getTrail()), 1, particle.getAmmount(), 0.05) |
|
|
|
.sendToLocation(loc); |
|
|
|
.sendToLocation(loc); |
|
|
|
} |
|
|
|
|
|
|
|
@EventHandler |
|
|
|
@EventHandler(ignoreCancelled = true) |
|
|
|
public void onShoot(ProjectileLaunchEvent e) { |
|
|
|
if (e.getEntity().getShooter() instanceof Player) { |
|
|
|
if (e.getEntity().getShooter() instanceof Player) |
|
|
|
if (e.getEntity() instanceof Arrow) { |
|
|
|
Player p = (Player) e.getEntity().getShooter(); |
|
|
|
if (plugin.getGm().getGameByPlayer(p) != null || plugin.getGm().getGameFourByPlayer(p) != null) |
|
|
|
sendArrowParticle(p, e.getEntity()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@EventHandler |
|
|
@ -300,7 +306,7 @@ public class PlayerListener implements Listener { |
|
|
|
} |
|
|
|
if (item.getType().equals(Material.REDSTONE_COMPARATOR) |
|
|
|
|| item.getType().equals(Material.REDSTONE_COMPARATOR_OFF) && item.getItemMeta().getDisplayName() |
|
|
|
.equals(plugin.getLang().get("items.config.nameItem"))) { |
|
|
|
.equals(plugin.getLang().get("items.config.nameItem"))) { |
|
|
|
e.setCancelled(true); |
|
|
|
plugin.getSom().openOptionsMenu(p); |
|
|
|
} |
|
|
@ -319,6 +325,7 @@ public class PlayerListener implements Listener { |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 20); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (plugin.getGm().getGameByPlayer(p) != null) { |
|
|
@ -339,16 +346,19 @@ public class PlayerListener implements Listener { |
|
|
|
if (!leaving.contains(p)) { |
|
|
|
leaving.add(p); |
|
|
|
new BukkitRunnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
leaving.remove(p); |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 20); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (plugin.getGm().getGameFourByPlayer(p) == null && plugin.getGm().getGameByPlayer(p) == null) { |
|
|
|
if (p.getItemInHand() != null && p.getItemInHand().getType() != Material.AIR) { |
|
|
|
|
|
|
|
final ItemStack item = p.getItemInHand(); |
|
|
|
if (item.hasItemMeta()) { |
|
|
|
if (plugin.getConfig().getBoolean("items.menu.enabled")) { |
|
|
@ -370,23 +380,42 @@ public class PlayerListener implements Listener { |
|
|
|
plugin.getConfig().getString("items.random.nameItem").replaceAll("&", "§"), |
|
|
|
plugin.getConfig().getString("items.random.loreItem").replaceAll("&", "§")); |
|
|
|
if (item.equals(random)) { |
|
|
|
GameDuo g = null; |
|
|
|
int alto = 0; |
|
|
|
for (final GameDuo game : plugin.getGm().getGames()) { |
|
|
|
if (game.isState(State.FINISH) || game.isState(State.INGAME) |
|
|
|
|| game.isState(State.RESTARTING) || game.isState(State.PREGAME)) |
|
|
|
continue; |
|
|
|
if (game.getPlayers() == game.getMax()) |
|
|
|
continue; |
|
|
|
if (game.getPlayers() <= alto) { |
|
|
|
g = game; |
|
|
|
alto = game.getPlayers(); |
|
|
|
int rand = (int) (Math.random() * 1); |
|
|
|
if (rand == 0) { |
|
|
|
GameDuo g = null; |
|
|
|
for (final GameDuo game : plugin.getGm().getGames()) { |
|
|
|
if (game.isState(State.FINISH) || game.isState(State.INGAME) |
|
|
|
|| game.isState(State.RESTARTING) || game.isState(State.PREGAME)) |
|
|
|
continue; |
|
|
|
if (game.getPlayers() == game.getMax()) |
|
|
|
continue; |
|
|
|
if (game.getPlayers() < game.getMax()) { |
|
|
|
g = game; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (g != null) |
|
|
|
plugin.getGm().addPlayerGame(p, g); |
|
|
|
else |
|
|
|
p.sendMessage(plugin.getLang().get("messages.noGames")); |
|
|
|
} else if (rand == 1) { |
|
|
|
GameFour g = null; |
|
|
|
for (final GameFour game : plugin.getGm().getGamesFour()) { |
|
|
|
if (game.isState(FState.FINISH) || game.isState(FState.INGAME) |
|
|
|
|| game.isState(FState.RESTARTING) || game.isState(FState.PREGAME)) |
|
|
|
continue; |
|
|
|
if (game.getPlayers().size() == game.getMax()) |
|
|
|
continue; |
|
|
|
if (game.getPlayers().size() < game.getMax()) { |
|
|
|
g = game; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (g != null) |
|
|
|
plugin.getGm().addPlayerGameFour(p, g); |
|
|
|
else |
|
|
|
p.sendMessage(plugin.getLang().get("messages.noGames")); |
|
|
|
} |
|
|
|
if (g != null) |
|
|
|
plugin.getGm().addPlayerGame(p, g); |
|
|
|
else |
|
|
|
p.sendMessage(plugin.getLang().get("messages.noGames")); |
|
|
|
} |
|
|
|
} |
|
|
|
if (plugin.getConfig().getBoolean("items.hotbar.enabled")) { |
|
|
@ -440,9 +469,9 @@ public class PlayerListener implements Listener { |
|
|
|
} catch (Exception ex) { |
|
|
|
ex.printStackTrace(); |
|
|
|
plugin.getServer().getConsoleSender() |
|
|
|
.sendMessage(ChatColor.RED + "Server " + ChatColor.YELLOW |
|
|
|
+ plugin.getConfig().getString("items.lobby.server") + ChatColor.RED |
|
|
|
+ " not found... Please check you config!"); |
|
|
|
.sendMessage(ChatColor.RED + "Server " + ChatColor.YELLOW |
|
|
|
+ plugin.getConfig().getString("items.lobby.server") + ChatColor.RED |
|
|
|
+ " not found... Please check you config!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -489,9 +518,8 @@ public class PlayerListener implements Listener { |
|
|
|
final Player p = e.getPlayer(); |
|
|
|
if (plugin.getGm().getGameByPlayer(p) != null) { |
|
|
|
final GameDuo game = plugin.getGm().getGameByPlayer(p); |
|
|
|
if (e.getFrom() != e.getTo()) { |
|
|
|
if (e.getFrom() != e.getTo()) |
|
|
|
sendFeetParticle(p); |
|
|
|
} |
|
|
|
if (game.isState(State.WAITING) || game.isState(State.STARTING) || game.isState(State.FINISH)) |
|
|
|
if (p.getLocation().getY() < 30) |
|
|
|
p.teleport(game.getLobby()); |
|
|
@ -516,9 +544,8 @@ public class PlayerListener implements Listener { |
|
|
|
} |
|
|
|
if (plugin.getGm().getGameFourByPlayer(p) != null) { |
|
|
|
final GameFour game = plugin.getGm().getGameFourByPlayer(p); |
|
|
|
if (e.getFrom() != e.getTo()) { |
|
|
|
if (e.getFrom() != e.getTo()) |
|
|
|
sendFeetParticle(p); |
|
|
|
} |
|
|
|
if (game.isState(FState.WAITING) || game.isState(FState.STARTING) || game.isState(FState.FINISH)) |
|
|
|
if (p.getLocation().getY() < 30) |
|
|
|
p.teleport(game.getLobby()); |
|
|
@ -527,28 +554,28 @@ public class PlayerListener implements Listener { |
|
|
|
if (!game.getTeams().get(ChatColor.RED).getDeath() |
|
|
|
&& !game.getTeamPlayer(p).getColor().equals(ChatColor.RED) |
|
|
|
&& game.getTeams().get(ChatColor.RED).getPortal() |
|
|
|
.contains(p.getLocation().getBlock().getLocation())) { |
|
|
|
.contains(p.getLocation().getBlock().getLocation())) { |
|
|
|
game.celebrateGoal(game.getTeamPlayer(p), game.getTeams().get(ChatColor.RED), p); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!game.getTeams().get(ChatColor.BLUE).getDeath() |
|
|
|
&& !game.getTeamPlayer(p).getColor().equals(ChatColor.BLUE) |
|
|
|
&& game.getTeams().get(ChatColor.BLUE).getPortal() |
|
|
|
.contains(p.getLocation().getBlock().getLocation())) { |
|
|
|
.contains(p.getLocation().getBlock().getLocation())) { |
|
|
|
game.celebrateGoal(game.getTeamPlayer(p), game.getTeams().get(ChatColor.BLUE), p); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!game.getTeams().get(ChatColor.YELLOW).getDeath() |
|
|
|
&& !game.getTeamPlayer(p).getColor().equals(ChatColor.YELLOW) |
|
|
|
&& game.getTeams().get(ChatColor.YELLOW).getPortal() |
|
|
|
.contains(p.getLocation().getBlock().getLocation())) { |
|
|
|
.contains(p.getLocation().getBlock().getLocation())) { |
|
|
|
game.celebrateGoal(game.getTeamPlayer(p), game.getTeams().get(ChatColor.YELLOW), p); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!game.getTeams().get(ChatColor.GREEN).getDeath() |
|
|
|
&& !game.getTeamPlayer(p).getColor().equals(ChatColor.GREEN) |
|
|
|
&& game.getTeams().get(ChatColor.GREEN).getPortal() |
|
|
|
.contains(p.getLocation().getBlock().getLocation())) { |
|
|
|
.contains(p.getLocation().getBlock().getLocation())) { |
|
|
|
game.celebrateGoal(game.getTeamPlayer(p), game.getTeams().get(ChatColor.GREEN), p); |
|
|
|
return; |
|
|
|
} |
|
|
@ -714,7 +741,7 @@ public class PlayerListener implements Listener { |
|
|
|
e.setCancelled(true); |
|
|
|
if (e.getClickedInventory().getTitle().equals(plugin.getLang().get("menus.hotbar.title"))) |
|
|
|
if (e.getSlot() == 53 || e.getSlot() == 52 || e.getSlot() == 51 || e.getSlot() == 48 |
|
|
|
|| e.getSlot() == 47 || e.getSlot() == 46 || e.getSlot() == 45) |
|
|
|
|| e.getSlot() == 47 || e.getSlot() == 46 || e.getSlot() == 45) |
|
|
|
e.setCancelled(true); |
|
|
|
} |
|
|
|
} |
|
|
@ -845,7 +872,7 @@ public class PlayerListener implements Listener { |
|
|
|
else if (cage.isBuy() && cage.getPrice() <= PlayerStat.getPlayerStat(p).getCoins()) { |
|
|
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), |
|
|
|
plugin.getConfig().getString("permFormat").replaceAll("<name>", p.getName()) |
|
|
|
.replaceAll("<permission>", cage.getPermission())); |
|
|
|
.replaceAll("<permission>", cage.getPermission())); |
|
|
|
PlayerStat.getPlayerStat(p).removeCoins(cage.getPrice()); |
|
|
|
p.getOpenInventory().close(); |
|
|
|
new BukkitRunnable() { |
|
|
@ -879,10 +906,11 @@ public class PlayerListener implements Listener { |
|
|
|
else if (arrow.isBuy() && arrow.getPrice() <= PlayerStat.getPlayerStat(p).getCoins()) { |
|
|
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), |
|
|
|
plugin.getConfig().getString("permFormat").replaceAll("<name>", p.getName()) |
|
|
|
.replaceAll("<permission>", arrow.getPermission())); |
|
|
|
.replaceAll("<permission>", arrow.getPermission())); |
|
|
|
PlayerStat.getPlayerStat(p).removeCoins(arrow.getPrice()); |
|
|
|
p.getOpenInventory().close(); |
|
|
|
new BukkitRunnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
plugin.getAtm().createArrowMenu(p); |
|
|
@ -903,7 +931,9 @@ public class PlayerListener implements Listener { |
|
|
|
e.setCancelled(true); |
|
|
|
if (e.getCurrentItem() == null || e.getCurrentItem().getType() == Material.AIR) |
|
|
|
return; |
|
|
|
for (final cx.sfy.TheBridge.cosmetics.Particle feet : plugin.getPam().getFeet_trails().values()) |
|
|
|
for ( |
|
|
|
|
|
|
|
final cx.sfy.TheBridge.cosmetics.Particle feet : plugin.getPam().getFeet_trails().values()) |
|
|
|
if (feet.getSlot() == e.getSlot()) |
|
|
|
if (!p.hasPermission(feet.getPermission())) { |
|
|
|
if (!feet.isBuy()) |
|
|
@ -913,7 +943,7 @@ public class PlayerListener implements Listener { |
|
|
|
else if (feet.isBuy() && feet.getPrice() <= PlayerStat.getPlayerStat(p).getCoins()) { |
|
|
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), |
|
|
|
plugin.getConfig().getString("permFormat").replaceAll("<name>", p.getName()) |
|
|
|
.replaceAll("<permission>", feet.getPermission())); |
|
|
|
.replaceAll("<permission>", feet.getPermission())); |
|
|
|
PlayerStat.getPlayerStat(p).removeCoins(feet.getPrice()); |
|
|
|
p.getOpenInventory().close(); |
|
|
|
new BukkitRunnable() { |
|
|
@ -1108,11 +1138,11 @@ public class PlayerListener implements Listener { |
|
|
|
game.removeAllPlayerTeam(p); |
|
|
|
if (game.getTeams().get(ChatColor.BLUE).getTeamSize() < game.getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.BLUE).getTeamSize() <= game.getTeams().get(ChatColor.RED) |
|
|
|
.getTeamSize() |
|
|
|
.getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.BLUE).getTeamSize() <= game.getTeams() |
|
|
|
.get(ChatColor.YELLOW).getTeamSize() |
|
|
|
.get(ChatColor.YELLOW).getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.BLUE).getTeamSize() <= game.getTeams().get(ChatColor.GREEN) |
|
|
|
.getTeamSize()) { |
|
|
|
.getTeamSize()) { |
|
|
|
game.addPlayerTeam(p, game.getTeams().get(ChatColor.BLUE)); |
|
|
|
p.sendMessage(plugin.getLang().get("messages.joinedTeam").replaceAll("<team>", |
|
|
|
"§9" + plugin.getConfig().getString("names.blue"))); |
|
|
@ -1134,11 +1164,11 @@ public class PlayerListener implements Listener { |
|
|
|
game.removeAllPlayerTeam(p); |
|
|
|
if (game.getTeams().get(ChatColor.RED).getTeamSize() < game.getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.RED).getTeamSize() <= game.getTeams().get(ChatColor.BLUE) |
|
|
|
.getTeamSize() |
|
|
|
.getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.RED).getTeamSize() <= game.getTeams().get(ChatColor.YELLOW) |
|
|
|
.getTeamSize() |
|
|
|
.getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.RED).getTeamSize() <= game.getTeams().get(ChatColor.GREEN) |
|
|
|
.getTeamSize()) { |
|
|
|
.getTeamSize()) { |
|
|
|
game.addPlayerTeam(p, game.getTeams().get(ChatColor.RED)); |
|
|
|
p.sendMessage(plugin.getLang().get("messages.joinedTeam").replaceAll("<team>", |
|
|
|
"§c" + plugin.getConfig().getString("names.red"))); |
|
|
@ -1160,11 +1190,11 @@ public class PlayerListener implements Listener { |
|
|
|
game.removeAllPlayerTeam(p); |
|
|
|
if (game.getTeams().get(ChatColor.GREEN).getTeamSize() < game.getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.GREEN).getTeamSize() <= game.getTeams().get(ChatColor.RED) |
|
|
|
.getTeamSize() |
|
|
|
.getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.GREEN).getTeamSize() <= game.getTeams() |
|
|
|
.get(ChatColor.YELLOW).getTeamSize() |
|
|
|
.get(ChatColor.YELLOW).getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.GREEN).getTeamSize() <= game.getTeams().get(ChatColor.BLUE) |
|
|
|
.getTeamSize()) { |
|
|
|
.getTeamSize()) { |
|
|
|
game.addPlayerTeam(p, game.getTeams().get(ChatColor.GREEN)); |
|
|
|
p.sendMessage(plugin.getLang().get("messages.joinedTeam").replaceAll("<team>", |
|
|
|
"§a" + plugin.getConfig().getString("names.green"))); |
|
|
@ -1186,11 +1216,11 @@ public class PlayerListener implements Listener { |
|
|
|
game.removeAllPlayerTeam(p); |
|
|
|
if (game.getTeams().get(ChatColor.YELLOW).getTeamSize() < game.getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.YELLOW).getTeamSize() <= game.getTeams().get(ChatColor.RED) |
|
|
|
.getTeamSize() |
|
|
|
.getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.YELLOW).getTeamSize() <= game.getTeams() |
|
|
|
.get(ChatColor.BLUE).getTeamSize() |
|
|
|
.get(ChatColor.BLUE).getTeamSize() |
|
|
|
&& game.getTeams().get(ChatColor.YELLOW).getTeamSize() <= game.getTeams() |
|
|
|
.get(ChatColor.GREEN).getTeamSize()) { |
|
|
|
.get(ChatColor.GREEN).getTeamSize()) { |
|
|
|
game.addPlayerTeam(p, game.getTeams().get(ChatColor.YELLOW)); |
|
|
|
p.sendMessage(plugin.getLang().get("messages.joinedTeam").replaceAll("<team>", |
|
|
|
"§e" + plugin.getConfig().getString("names.yellow"))); |
|
|
@ -1206,7 +1236,7 @@ public class PlayerListener implements Listener { |
|
|
|
public void onShoot(EntityShootBowEvent e) { |
|
|
|
if (e.getEntity() instanceof Player) { |
|
|
|
final Player p = (Player) e.getEntity(); |
|
|
|
if (plugin.getGm().getGameFourByPlayer(p) != null || plugin.getGm().getGameByPlayer(p) != null) { |
|
|
|
if (plugin.getGm().getGameFourByPlayer(p) != null || plugin.getGm().getGameByPlayer(p) != null) |
|
|
|
if (bow.contains(p)) { |
|
|
|
p.sendMessage(plugin.getLang().get("messages.noShoot")); |
|
|
|
e.setCancelled(true); |
|
|
@ -1214,7 +1244,6 @@ public class PlayerListener implements Listener { |
|
|
|
timeBow(p); |
|
|
|
bow.add(p); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -1339,37 +1368,39 @@ public class PlayerListener implements Listener { |
|
|
|
p.setHealth(p.getMaxHealth()); |
|
|
|
if (plugin.getConfig().getBoolean("remove.absorption") == true) |
|
|
|
new BukkitRunnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
p.removePotionEffect(PotionEffectType.ABSORPTION); |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 1); |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
p.removePotionEffect(PotionEffectType.ABSORPTION); |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 1); |
|
|
|
if (plugin.getConfig().getBoolean("remove.regeneration") == true) |
|
|
|
new BukkitRunnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
p.removePotionEffect(PotionEffectType.REGENERATION); |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 1); |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
p.removePotionEffect(PotionEffectType.REGENERATION); |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 1); |
|
|
|
} |
|
|
|
if (plugin.getGm().getGameFourByPlayer(p) != null) |
|
|
|
if (e.getItem().getType().equals(Material.GOLDEN_APPLE)) { |
|
|
|
p.setHealth(p.getMaxHealth()); |
|
|
|
if (plugin.getConfig().getBoolean("remove.absorption") == true) |
|
|
|
new BukkitRunnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
p.removePotionEffect(PotionEffectType.ABSORPTION); |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 1); |
|
|
|
|
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
p.removePotionEffect(PotionEffectType.ABSORPTION); |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 1); |
|
|
|
if (plugin.getConfig().getBoolean("remove.regeneration") == true) |
|
|
|
new BukkitRunnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
p.removePotionEffect(PotionEffectType.REGENERATION); |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 1); |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
p.removePotionEffect(PotionEffectType.REGENERATION); |
|
|
|
} |
|
|
|
}.runTaskLater(plugin, 1); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@EventHandler |
|
|
@ -1511,9 +1542,9 @@ public class PlayerListener implements Listener { |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName()) |
|
|
|
+ plugin.getLang().get("deathMessages.player") |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
else { |
|
|
|
final DamageCause cause = d.getLastDamageCause().getCause(); |
|
|
|
if (cause.equals(DamageCause.VOID)) |
|
|
@ -1523,9 +1554,9 @@ public class PlayerListener implements Listener { |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName()) |
|
|
|
+ plugin.getLang().get("deathMessages.player") |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
else if (cause.equals(DamageCause.ENTITY_ATTACK)) |
|
|
|
for (final Player on : game.getGamePlayers()) |
|
|
|
on.sendMessage(plugin.getLang().get("deathMessages.damage") |
|
|
@ -1533,9 +1564,9 @@ public class PlayerListener implements Listener { |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName()) |
|
|
|
+ plugin.getLang().get("deathMessages.player") |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
else |
|
|
|
for (final Player on : game.getGamePlayers()) |
|
|
|
on.sendMessage(plugin.getLang().get("deathMessages.custom") |
|
|
@ -1543,9 +1574,9 @@ public class PlayerListener implements Listener { |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName()) |
|
|
|
+ plugin.getLang().get("deathMessages.player") |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
} |
|
|
|
} else { |
|
|
|
final GameDuo game = plugin.getGm().getGameByPlayer(d); |
|
|
@ -1594,9 +1625,9 @@ public class PlayerListener implements Listener { |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName()) |
|
|
|
+ plugin.getLang().get("deathMessages.player") |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
else { |
|
|
|
final DamageCause cause = d.getLastDamageCause().getCause(); |
|
|
|
if (cause.equals(DamageCause.VOID)) |
|
|
@ -1606,9 +1637,9 @@ public class PlayerListener implements Listener { |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName()) |
|
|
|
+ plugin.getLang().get("deathMessages.player") |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
else if (cause.equals(DamageCause.ENTITY_ATTACK)) |
|
|
|
for (final Player on : game.getPlayers()) |
|
|
|
on.sendMessage(plugin.getLang().get("deathMessages.damage") |
|
|
@ -1616,9 +1647,9 @@ public class PlayerListener implements Listener { |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName()) |
|
|
|
+ plugin.getLang().get("deathMessages.player") |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
else |
|
|
|
for (final Player on : game.getPlayers()) |
|
|
|
on.sendMessage(plugin.getLang().get("deathMessages.custom") |
|
|
@ -1626,9 +1657,9 @@ public class PlayerListener implements Listener { |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName()) |
|
|
|
+ plugin.getLang().get("deathMessages.player") |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
.replaceAll("<TDColor>", game.getTeamPlayer(d).getColor() + "") |
|
|
|
.replaceAll("<TKColor>", game.getTeamPlayer(k).getColor() + "") |
|
|
|
.replaceAll("<death>", d.getName()).replaceAll("<player>", k.getName())); |
|
|
|
} |
|
|
|
} else { |
|
|
|
final GameFour game = plugin.getGm().getGameFourByPlayer(d); |
|
|
|