Added /spec toggle, to allow players to not partake in games.
Added TeamArmorAddon for games to use, to mark team colors easier. Minor other changes.
This commit is contained in:
parent
1d4d98b910
commit
e818662161
@ -2,6 +2,7 @@ package nautilus.game.arcade;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
import nautilus.game.arcade.addons.*;
|
import nautilus.game.arcade.addons.*;
|
||||||
import nautilus.game.arcade.command.*;
|
import nautilus.game.arcade.command.*;
|
||||||
@ -105,6 +106,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
private ClassCombatShop _classShop;
|
private ClassCombatShop _classShop;
|
||||||
|
|
||||||
private MiscManager _miscManager;
|
private MiscManager _miscManager;
|
||||||
|
|
||||||
|
//Observers
|
||||||
|
private HashSet<Player> _specList = new HashSet<Player>();
|
||||||
|
|
||||||
//Server Games
|
//Server Games
|
||||||
private GameServerConfig _serverConfig;
|
private GameServerConfig _serverConfig;
|
||||||
@ -191,6 +195,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
//Game Addons
|
//Game Addons
|
||||||
new CompassAddon(plugin, this);
|
new CompassAddon(plugin, this);
|
||||||
new SoupAddon(plugin, this);
|
new SoupAddon(plugin, this);
|
||||||
|
new TeamArmorAddon(plugin, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -396,6 +401,12 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void MessageMOTD(ServerListPingEvent event)
|
public void MessageMOTD(ServerListPingEvent event)
|
||||||
{
|
{
|
||||||
|
if (this.IsTournamentServer())
|
||||||
|
{
|
||||||
|
event.setMotd(ChatColor.RED + "Twitch.tv "+ ChatColor.YELLOW + "Charity Event");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String extrainformation = "|" + _serverConfig.ServerType + "|" + (_game == null ? "Unknown" : _game.GetName()) + "|" + ((_game == null || _game.WorldData == null) ? "Unknown" : _game.WorldData.MapName);
|
String extrainformation = "|" + _serverConfig.ServerType + "|" + (_game == null ? "Unknown" : _game.GetName()) + "|" + ((_game == null || _game.WorldData == null) ? "Unknown" : _game.WorldData.MapName);
|
||||||
|
|
||||||
if (_game == null || _game.GetState() == GameState.Recruit)
|
if (_game == null || _game.GetState() == GameState.Recruit)
|
||||||
@ -405,7 +416,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
event.setMotd(ChatColor.RED + "UHC - Season 5");
|
event.setMotd(ChatColor.RED + "UHC - Season 5");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_game != null && _game.GetCountdown() != -1)
|
if (_game != null && _game.GetCountdown() != -1)
|
||||||
{
|
{
|
||||||
event.setMotd(ChatColor.GREEN + "Starting in " + _game.GetCountdown() + " Seconds" + extrainformation);
|
event.setMotd(ChatColor.GREEN + "Starting in " + _game.GetCountdown() + " Seconds" + extrainformation);
|
||||||
@ -631,6 +642,54 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void Observer(PlayerCommandPreprocessEvent event)
|
||||||
|
{
|
||||||
|
if (event.getMessage().equalsIgnoreCase("/spec"))
|
||||||
|
{
|
||||||
|
if (!_specList.remove(event.getPlayer()))
|
||||||
|
{
|
||||||
|
_specList.add(event.getPlayer());
|
||||||
|
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Game", "You are now a Spectator!"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Game", "You are no longer a Spectator!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Clean
|
||||||
|
if (_game != null)
|
||||||
|
{
|
||||||
|
//Remove Data
|
||||||
|
_game.RemoveTeamPreference(event.getPlayer());
|
||||||
|
_game.GetPlayerKits().remove(event.getPlayer());
|
||||||
|
_game.GetPlayerGems().remove(event.getPlayer());
|
||||||
|
|
||||||
|
//Leave Team
|
||||||
|
GameTeam team = _game.GetTeam(event.getPlayer());
|
||||||
|
|
||||||
|
if (team != null)
|
||||||
|
{
|
||||||
|
team.RemovePlayer(event.getPlayer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void ObserverQuit(PlayerQuitEvent event)
|
||||||
|
{
|
||||||
|
_specList.remove(event.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean IsObserver(Player player)
|
||||||
|
{
|
||||||
|
return _specList.contains(player);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean IsTournamentServer()
|
public boolean IsTournamentServer()
|
||||||
{
|
{
|
||||||
return _serverConfig.Tournament;
|
return _serverConfig.Tournament;
|
||||||
|
@ -40,6 +40,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
import org.bukkit.scoreboard.DisplaySlot;
|
import org.bukkit.scoreboard.DisplaySlot;
|
||||||
import org.bukkit.scoreboard.Objective;
|
import org.bukkit.scoreboard.Objective;
|
||||||
import org.bukkit.scoreboard.Score;
|
import org.bukkit.scoreboard.Score;
|
||||||
@ -84,7 +85,7 @@ public abstract class Game implements Listener
|
|||||||
|
|
||||||
//Teams
|
//Teams
|
||||||
private ArrayList<GameTeam> _teamList = new ArrayList<GameTeam>();
|
private ArrayList<GameTeam> _teamList = new ArrayList<GameTeam>();
|
||||||
|
|
||||||
//Player Preferences
|
//Player Preferences
|
||||||
protected NautHashMap<Player, Kit> _playerKit = new NautHashMap<Player, Kit>();
|
protected NautHashMap<Player, Kit> _playerKit = new NautHashMap<Player, Kit>();
|
||||||
private NautHashMap<GameTeam, ArrayList<Player>> _teamPreference = new NautHashMap<GameTeam, ArrayList<Player>>();
|
private NautHashMap<GameTeam, ArrayList<Player>> _teamPreference = new NautHashMap<GameTeam, ArrayList<Player>>();
|
||||||
@ -147,7 +148,7 @@ public abstract class Game implements Listener
|
|||||||
public boolean CreatureAllow = false;
|
public boolean CreatureAllow = false;
|
||||||
public boolean CreatureAllowOverride = false;
|
public boolean CreatureAllowOverride = false;
|
||||||
|
|
||||||
public int WorldTimeSet = -1;
|
public int WorldTimeSet = 12000;
|
||||||
public boolean WorldWeatherEnabled = false;
|
public boolean WorldWeatherEnabled = false;
|
||||||
public int WorldWaterDamage = 0;
|
public int WorldWaterDamage = 0;
|
||||||
public boolean WorldBoundaryKill = true;
|
public boolean WorldBoundaryKill = true;
|
||||||
@ -177,6 +178,8 @@ public abstract class Game implements Listener
|
|||||||
//Addons
|
//Addons
|
||||||
public boolean CompassEnabled = false;
|
public boolean CompassEnabled = false;
|
||||||
public boolean SoupEnabled = true;
|
public boolean SoupEnabled = true;
|
||||||
|
public boolean TeamArmor = false;
|
||||||
|
public boolean TeamArmorHotbar = false;
|
||||||
|
|
||||||
public boolean GiveClock = true;
|
public boolean GiveClock = true;
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ public class GameTeam
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void SpawnTeleport(Player player)
|
public void SpawnTeleport(Player player)
|
||||||
{
|
{
|
||||||
player.leaveVehicle();
|
player.leaveVehicle();
|
||||||
player.eject();
|
player.eject();
|
||||||
player.teleport(GetSpawn());
|
player.teleport(GetSpawn());
|
||||||
|
@ -23,6 +23,7 @@ public abstract class TeamGame extends Game
|
|||||||
{
|
{
|
||||||
private NautHashMap<String, Long> _rejoinTime = new NautHashMap<String, Long>();
|
private NautHashMap<String, Long> _rejoinTime = new NautHashMap<String, Long>();
|
||||||
protected NautHashMap<String, GameTeam> RejoinTeam = new NautHashMap<String, GameTeam>();
|
protected NautHashMap<String, GameTeam> RejoinTeam = new NautHashMap<String, GameTeam>();
|
||||||
|
protected NautHashMap<String, Kit> RejoinKit = new NautHashMap<String, Kit>();
|
||||||
|
|
||||||
public TeamGame(ArcadeManager manager, GameType gameType, Kit[] kits, String[] gameDesc)
|
public TeamGame(ArcadeManager manager, GameType gameType, Kit[] kits, String[] gameDesc)
|
||||||
{
|
{
|
||||||
@ -53,6 +54,10 @@ public abstract class TeamGame extends Game
|
|||||||
//Store
|
//Store
|
||||||
_rejoinTime.put(player.getName(), System.currentTimeMillis());
|
_rejoinTime.put(player.getName(), System.currentTimeMillis());
|
||||||
RejoinTeam.put(player.getName(), team);
|
RejoinTeam.put(player.getName(), team);
|
||||||
|
|
||||||
|
if (GetKit(player) != null)
|
||||||
|
RejoinKit.put(player.getName(), GetKit(player));
|
||||||
|
|
||||||
GetLocationStore().put(player.getName(), player.getLocation());
|
GetLocationStore().put(player.getName(), player.getLocation());
|
||||||
|
|
||||||
//Announcement
|
//Announcement
|
||||||
@ -72,6 +77,12 @@ public abstract class TeamGame extends Game
|
|||||||
{
|
{
|
||||||
team.AddPlayer(event.getPlayer());
|
team.AddPlayer(event.getPlayer());
|
||||||
Announce(team.GetColor() + C.Bold + event.getPlayer().getName() + " has reconnected!");
|
Announce(team.GetColor() + C.Bold + event.getPlayer().getName() + " has reconnected!");
|
||||||
|
|
||||||
|
|
||||||
|
Kit kit = RejoinKit.remove(event.getPlayer().getName());
|
||||||
|
if (kit != null)
|
||||||
|
_playerKit.put(event.getPlayer(), kit);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,6 +118,8 @@ public abstract class TeamGame extends Game
|
|||||||
GameTeam team = RejoinTeam.remove(name);
|
GameTeam team = RejoinTeam.remove(name);
|
||||||
if (team != null)
|
if (team != null)
|
||||||
Announce(team.GetColor() + C.Bold + name + " did not reconnect in time!");
|
Announce(team.GetColor() + C.Bold + name + " did not reconnect in time!");
|
||||||
|
|
||||||
|
RejoinKit.remove(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ public class Bridge extends TeamGame implements OreObsfucation
|
|||||||
private HashSet<String> _usedLife = new HashSet<String>();
|
private HashSet<String> _usedLife = new HashSet<String>();
|
||||||
|
|
||||||
//Tourney Mode
|
//Tourney Mode
|
||||||
private boolean _tournament = false;
|
private boolean _tournament;
|
||||||
private HashMap<GameTeam, Integer> _tournamentKills = new HashMap<GameTeam, Integer>();
|
private HashMap<GameTeam, Integer> _tournamentKills = new HashMap<GameTeam, Integer>();
|
||||||
|
|
||||||
//Scoreboard
|
//Scoreboard
|
||||||
@ -152,9 +152,13 @@ public class Bridge extends TeamGame implements OreObsfucation
|
|||||||
|
|
||||||
GemMultiplier = 2.5;
|
GemMultiplier = 2.5;
|
||||||
|
|
||||||
|
PrepareFreeze = false;
|
||||||
|
|
||||||
//Tournament
|
//Tournament
|
||||||
if (Manager.IsTournamentServer())
|
if (Manager.IsTournamentServer())
|
||||||
QuitOut = false;
|
QuitOut = false;
|
||||||
|
|
||||||
|
_tournament = Manager.IsTournamentServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -165,13 +169,13 @@ public class Bridge extends TeamGame implements OreObsfucation
|
|||||||
|
|
||||||
Player player = event.GetPlayer();
|
Player player = event.GetPlayer();
|
||||||
|
|
||||||
if (Manager.GetClients().Get(player).GetRank().Has(Rank.ULTRA) || Manager.GetDonation().Get(player.getName()).OwnsUnknownPackage(GetName() + " ULTRA"))
|
if (Manager.IsTournamentServer() || Manager.GetClients().Get(player).GetRank().Has(Rank.ULTRA) || Manager.GetDonation().Get(player.getName()).OwnsUnknownPackage(GetName() + " ULTRA"))
|
||||||
{
|
{
|
||||||
if (!_usedLife.contains(player.getName()))
|
if (!_usedLife.contains(player.getName()))
|
||||||
{
|
{
|
||||||
_usedLife.add(player.getName());
|
_usedLife.add(player.getName());
|
||||||
|
|
||||||
UtilPlayer.message(player, F.main("Game", "You used your " + F.elem(C.cAqua + "Ultra Rank Revive") + "."));
|
UtilPlayer.message(player, F.main("Game", "You used your " + F.elem(C.cAqua + "Early Game Revive") + "."));
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ import mineplex.core.updater.event.UpdateEvent;
|
|||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.GameType;
|
import nautilus.game.arcade.GameType;
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
|
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
|
||||||
import nautilus.game.arcade.game.GameTeam;
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.game.SoloGame;
|
import nautilus.game.arcade.game.SoloGame;
|
||||||
import nautilus.game.arcade.game.TeamGame;
|
import nautilus.game.arcade.game.TeamGame;
|
||||||
@ -75,6 +76,8 @@ public class DragonEscapeTeams extends TeamGame
|
|||||||
|
|
||||||
this.DamagePvP = false;
|
this.DamagePvP = false;
|
||||||
this.HungerSet = 20;
|
this.HungerSet = 20;
|
||||||
|
|
||||||
|
this.TeamArmorHotbar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -144,6 +147,12 @@ public class DragonEscapeTeams extends TeamGame
|
|||||||
if (WorldData.MapName.contains("Hell"))
|
if (WorldData.MapName.contains("Hell"))
|
||||||
this.WorldTimeSet = 16000;
|
this.WorldTimeSet = 16000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void PlayerTeleport(PlayerPrepareTeleportEvent event)
|
||||||
|
{
|
||||||
|
Manager.GetCondition().Factory().Invisible(GetName(), event.GetPlayer(), event.GetPlayer(), 16, 1, false, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void SpawnDragon(GameStateChangeEvent event)
|
public void SpawnDragon(GameStateChangeEvent event)
|
||||||
|
@ -68,6 +68,10 @@ public class DragonsTeams extends TeamGame
|
|||||||
this.DamagePvP = false;
|
this.DamagePvP = false;
|
||||||
this.HungerSet = 20;
|
this.HungerSet = 20;
|
||||||
this.WorldWaterDamage = 4;
|
this.WorldWaterDamage = 4;
|
||||||
|
this.PrepareFreeze = false;
|
||||||
|
|
||||||
|
this.TeamArmor = true;
|
||||||
|
this.TeamArmorHotbar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -21,7 +21,7 @@ public class KitPyrotechnic extends Kit
|
|||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
"Dragons love sparklers, following them!"
|
"Dragons love sparklers!!"
|
||||||
},
|
},
|
||||||
|
|
||||||
new Perk[]
|
new Perk[]
|
||||||
|
@ -60,9 +60,13 @@ public class QuiverTeams extends TeamGame
|
|||||||
this.DamageSelf = false;
|
this.DamageSelf = false;
|
||||||
this.DamageTeamSelf = false;
|
this.DamageTeamSelf = false;
|
||||||
this.PrepareFreeze = false;
|
this.PrepareFreeze = false;
|
||||||
this.SpawnDistanceRequirement = 16;
|
this.SpawnDistanceRequirement = 24;
|
||||||
this.BlockBreakAllow.add(102);
|
this.BlockBreakAllow.add(102);
|
||||||
this.BlockBreakAllow.add(20);
|
this.BlockBreakAllow.add(20);
|
||||||
|
this.BlockBreakAllow.add(18);
|
||||||
|
|
||||||
|
this.TeamArmor = true;
|
||||||
|
this.TeamArmorHotbar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
|
@ -108,6 +108,9 @@ public class SheepGame extends TeamGame
|
|||||||
this.HungerSet = 20;
|
this.HungerSet = 20;
|
||||||
|
|
||||||
this.WorldTimeSet = 2000;
|
this.WorldTimeSet = 2000;
|
||||||
|
|
||||||
|
this.TeamArmor = true;
|
||||||
|
this.TeamArmorHotbar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -447,13 +450,6 @@ public class SheepGame extends TeamGame
|
|||||||
DropSheep(player);
|
DropSheep(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void InventoryClick(InventoryClickEvent event)
|
|
||||||
{
|
|
||||||
event.setCancelled(true);
|
|
||||||
event.getWhoClicked().closeInventory();
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void RespawnInvul(PlayerGameRespawnEvent event)
|
public void RespawnInvul(PlayerGameRespawnEvent event)
|
||||||
{
|
{
|
||||||
|
@ -46,32 +46,6 @@ public class KitArcher extends Kit
|
|||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WOOD_SWORD));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WOOD_SWORD));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SADDLE));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SADDLE));
|
||||||
|
|
||||||
ItemStack helm = new ItemStack(Material.LEATHER_HELMET);
|
|
||||||
LeatherArmorMeta metaHelm = (LeatherArmorMeta)helm.getItemMeta();
|
|
||||||
metaHelm.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
helm.setItemMeta(metaHelm);
|
|
||||||
player.getInventory().setHelmet(helm);
|
|
||||||
|
|
||||||
ItemStack armor = new ItemStack(Material.LEATHER_CHESTPLATE);
|
|
||||||
LeatherArmorMeta meta = (LeatherArmorMeta)armor.getItemMeta();
|
|
||||||
meta.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
armor.setItemMeta(meta);
|
|
||||||
player.getInventory().setChestplate(armor);
|
|
||||||
|
|
||||||
ItemStack legs = new ItemStack(Material.LEATHER_LEGGINGS);
|
|
||||||
LeatherArmorMeta metaLegs = (LeatherArmorMeta)armor.getItemMeta();
|
|
||||||
metaLegs.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
legs.setItemMeta(metaLegs);
|
|
||||||
player.getInventory().setLeggings(legs);
|
|
||||||
|
|
||||||
ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
|
|
||||||
LeatherArmorMeta metaBoots = (LeatherArmorMeta)armor.getItemMeta();
|
|
||||||
metaBoots.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
boots.setItemMeta(metaBoots);
|
|
||||||
player.getInventory().setBoots(boots);
|
|
||||||
|
|
||||||
player.getInventory().setItem(8, armor.clone());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,32 +38,6 @@ public class KitBeserker extends Kit
|
|||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SADDLE));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SADDLE));
|
||||||
|
|
||||||
ItemStack helm = new ItemStack(Material.LEATHER_HELMET);
|
|
||||||
LeatherArmorMeta metaHelm = (LeatherArmorMeta)helm.getItemMeta();
|
|
||||||
metaHelm.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
helm.setItemMeta(metaHelm);
|
|
||||||
player.getInventory().setHelmet(helm);
|
|
||||||
|
|
||||||
ItemStack armor = new ItemStack(Material.LEATHER_CHESTPLATE);
|
|
||||||
LeatherArmorMeta meta = (LeatherArmorMeta)armor.getItemMeta();
|
|
||||||
meta.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
armor.setItemMeta(meta);
|
|
||||||
player.getInventory().setChestplate(armor);
|
|
||||||
|
|
||||||
ItemStack legs = new ItemStack(Material.LEATHER_LEGGINGS);
|
|
||||||
LeatherArmorMeta metaLegs = (LeatherArmorMeta)armor.getItemMeta();
|
|
||||||
metaLegs.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
legs.setItemMeta(metaLegs);
|
|
||||||
player.getInventory().setLeggings(legs);
|
|
||||||
|
|
||||||
ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
|
|
||||||
LeatherArmorMeta metaBoots = (LeatherArmorMeta)armor.getItemMeta();
|
|
||||||
metaBoots.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
boots.setItemMeta(metaBoots);
|
|
||||||
player.getInventory().setBoots(boots);
|
|
||||||
|
|
||||||
player.getInventory().setItem(8, armor.clone());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -39,32 +39,6 @@ public class KitBrute extends Kit
|
|||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SADDLE));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SADDLE));
|
||||||
|
|
||||||
ItemStack helm = new ItemStack(Material.LEATHER_HELMET);
|
|
||||||
LeatherArmorMeta metaHelm = (LeatherArmorMeta)helm.getItemMeta();
|
|
||||||
metaHelm.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
helm.setItemMeta(metaHelm);
|
|
||||||
player.getInventory().setHelmet(helm);
|
|
||||||
|
|
||||||
ItemStack armor = new ItemStack(Material.LEATHER_CHESTPLATE);
|
|
||||||
LeatherArmorMeta meta = (LeatherArmorMeta)armor.getItemMeta();
|
|
||||||
meta.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
armor.setItemMeta(meta);
|
|
||||||
player.getInventory().setChestplate(armor);
|
|
||||||
|
|
||||||
ItemStack legs = new ItemStack(Material.LEATHER_LEGGINGS);
|
|
||||||
LeatherArmorMeta metaLegs = (LeatherArmorMeta)armor.getItemMeta();
|
|
||||||
metaLegs.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
legs.setItemMeta(metaLegs);
|
|
||||||
player.getInventory().setLeggings(legs);
|
|
||||||
|
|
||||||
ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
|
|
||||||
LeatherArmorMeta metaBoots = (LeatherArmorMeta)armor.getItemMeta();
|
|
||||||
metaBoots.setColor(Manager.GetGame().GetTeam(player).GetColorBase());
|
|
||||||
boots.setItemMeta(metaBoots);
|
|
||||||
player.getInventory().setBoots(boots);
|
|
||||||
|
|
||||||
player.getInventory().setItem(8, armor.clone());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,24 +49,24 @@ public class SuperSmashTeam extends TeamGame
|
|||||||
{
|
{
|
||||||
|
|
||||||
new KitSkeleton(manager),
|
new KitSkeleton(manager),
|
||||||
new KitGolem(manager),
|
//new KitGolem(manager),
|
||||||
new KitSpider(manager),
|
//new KitSpider(manager),
|
||||||
new KitSlime(manager),
|
//new KitSlime(manager),
|
||||||
|
|
||||||
new KitCreeper(manager),
|
new KitCreeper(manager),
|
||||||
new KitEnderman(manager),
|
//new KitEnderman(manager),
|
||||||
new KitSnowman(manager),
|
//new KitSnowman(manager),
|
||||||
new KitWolf(manager),
|
new KitWolf(manager),
|
||||||
|
|
||||||
|
|
||||||
new KitBlaze(manager),
|
new KitBlaze(manager),
|
||||||
new KitWitch(manager),
|
new KitWitch(manager),
|
||||||
new KitChicken(manager),
|
//new KitChicken(manager),
|
||||||
new KitSkeletalHorse(manager),
|
new KitSkeletalHorse(manager),
|
||||||
new KitPig(manager),
|
//new KitPig(manager),
|
||||||
new KitSkySquid(manager),
|
new KitSkySquid(manager),
|
||||||
new KitWitherSkeleton(manager),
|
new KitWitherSkeleton(manager),
|
||||||
new KitMagmaCube(manager),
|
//new KitMagmaCube(manager),
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -81,13 +81,15 @@ public class SuperSmashTeam extends TeamGame
|
|||||||
|
|
||||||
this.DeathOut = false;
|
this.DeathOut = false;
|
||||||
|
|
||||||
this.DamageTeamSelf = true;
|
this.DamageTeamSelf = false;
|
||||||
|
|
||||||
this.CompassEnabled = true;
|
this.CompassEnabled = true;
|
||||||
|
|
||||||
this.SpawnDistanceRequirement = 16;
|
this.SpawnDistanceRequirement = 16;
|
||||||
|
|
||||||
this.InventoryOpen = false;
|
this.InventoryOpen = false;
|
||||||
|
|
||||||
|
this.TeamArmorHotbar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
@ -221,9 +223,6 @@ public class SuperSmashTeam extends TeamGame
|
|||||||
event.GetDamageeEntity().eject();
|
event.GetDamageeEntity().eject();
|
||||||
event.GetDamageeEntity().leaveVehicle();
|
event.GetDamageeEntity().leaveVehicle();
|
||||||
|
|
||||||
if (event.GetDamageePlayer() != null)
|
|
||||||
event.GetDamageeEntity().getWorld().strikeLightningEffect(event.GetDamageeEntity().getLocation());
|
|
||||||
|
|
||||||
event.AddMod("Smash", "Super Smash Mobs", 5000, false);
|
event.AddMod("Smash", "Super Smash Mobs", 5000, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import org.bukkit.entity.EntityType;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.disguise.disguises.DisguiseSkeleton;
|
import mineplex.core.disguise.disguises.DisguiseSkeleton;
|
||||||
@ -51,7 +52,7 @@ public class KitWitherSkeleton extends SmashKit
|
|||||||
ChatColor.RESET + "block to guide the missile! Release",
|
ChatColor.RESET + "block to guide the missile! Release",
|
||||||
ChatColor.RESET + "block to detonate it midair.",
|
ChatColor.RESET + "block to detonate it midair.",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1,
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1,
|
||||||
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Wither Image",
|
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Wither Image",
|
||||||
new String[]
|
new String[]
|
||||||
@ -68,7 +69,7 @@ public class KitWitherSkeleton extends SmashKit
|
|||||||
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
|
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
|
||||||
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
|
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
|
||||||
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
|
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
|
||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
||||||
|
|
||||||
@ -76,13 +77,13 @@ public class KitWitherSkeleton extends SmashKit
|
|||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||||
else
|
else
|
||||||
disguise.SetName(player.getName());
|
disguise.SetName(player.getName());
|
||||||
|
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
disguise.SetSkeletonType(SkeletonType.WITHER);
|
disguise.SetSkeletonType(SkeletonType.WITHER);
|
||||||
disguise.hideArmor();
|
disguise.hideArmor();
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int GetCost()
|
public int GetCost()
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,6 @@ public class SpleefTeams extends TeamGame
|
|||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
"Punch blocks to break them!",
|
"Punch blocks to break them!",
|
||||||
"1 Hunger per block smashed!",
|
|
||||||
"Last team alive wins!"
|
"Last team alive wins!"
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -51,6 +50,9 @@ public class SpleefTeams extends TeamGame
|
|||||||
this.WorldWaterDamage = 4;
|
this.WorldWaterDamage = 4;
|
||||||
|
|
||||||
this.PrepareFreeze = false;
|
this.PrepareFreeze = false;
|
||||||
|
|
||||||
|
this.TeamArmor = true;
|
||||||
|
this.TeamArmorHotbar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -201,6 +203,9 @@ public class SpleefTeams extends TeamGame
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void Hunger(UpdateEvent event)
|
public void Hunger(UpdateEvent event)
|
||||||
{
|
{
|
||||||
|
if (Manager.IsTournamentServer())
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.getType() != UpdateType.SEC)
|
if (event.getType() != UpdateType.SEC)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -127,12 +127,12 @@ public class SurvivalGamesTeams extends TeamGame
|
|||||||
new KitKnight(manager),
|
new KitKnight(manager),
|
||||||
|
|
||||||
new KitArcher(manager),
|
new KitArcher(manager),
|
||||||
new KitBrawler(manager),
|
//new KitBrawler(manager),
|
||||||
|
|
||||||
new KitAssassin(manager),
|
//new KitAssassin(manager),
|
||||||
new KitBeastmaster(manager),
|
new KitBeastmaster(manager),
|
||||||
new KitBomber(manager),
|
//new KitBomber(manager),
|
||||||
new KitNecromancer(manager)
|
//new KitNecromancer(manager)
|
||||||
},
|
},
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
@ -230,6 +230,10 @@ public class SurvivalGamesTeams extends TeamGame
|
|||||||
System.out.println("CREEP TYPE: " + _spreadName);
|
System.out.println("CREEP TYPE: " + _spreadName);
|
||||||
System.out.println("===================");
|
System.out.println("===================");
|
||||||
//Manager.GetStatsManager().addTable(GetName(), "kills", "deaths", "chestsOpened");
|
//Manager.GetStatsManager().addTable(GetName(), "kills", "deaths", "chestsOpened");
|
||||||
|
|
||||||
|
//Tournament
|
||||||
|
if (Manager.IsTournamentServer())
|
||||||
|
QuitOut = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -433,14 +437,14 @@ public class SurvivalGamesTeams extends TeamGame
|
|||||||
for (int i = 0; i < 30; i++) _baseChestLoot.add(new ItemStack(Material.WEB, 2));
|
for (int i = 0; i < 30; i++) _baseChestLoot.add(new ItemStack(Material.WEB, 2));
|
||||||
|
|
||||||
//Food
|
//Food
|
||||||
for (int i = 0; i < 40; i++) _baseChestLoot.add(new ItemStack(Material.MUSHROOM_SOUP));
|
for (int i = 0; i < 60; i++) _baseChestLoot.add(new ItemStack(Material.MUSHROOM_SOUP, 1));
|
||||||
for (int i = 0; i < 50; i++) _baseChestLoot.add(new ItemStack(Material.COOKED_CHICKEN));
|
for (int i = 0; i < 50; i++) _baseChestLoot.add(new ItemStack(Material.COOKED_CHICKEN, 4));
|
||||||
for (int i = 0; i < 80; i++) _baseChestLoot.add(new ItemStack(Material.RAW_BEEF));
|
for (int i = 0; i < 80; i++) _baseChestLoot.add(new ItemStack(Material.RAW_BEEF, 4));
|
||||||
for (int i = 0; i < 50; i++) _baseChestLoot.add(new ItemStack(Material.GRILLED_PORK));
|
for (int i = 0; i < 50; i++) _baseChestLoot.add(new ItemStack(Material.GRILLED_PORK, 4));
|
||||||
for (int i = 0; i < 100; i++) _baseChestLoot.add(new ItemStack(Material.BREAD));
|
for (int i = 0; i < 100; i++) _baseChestLoot.add(new ItemStack(Material.BREAD, 4));
|
||||||
for (int i = 0; i < 40; i++) _baseChestLoot.add(new ItemStack(Material.PUMPKIN_PIE));
|
for (int i = 0; i < 40; i++) _baseChestLoot.add(new ItemStack(Material.PUMPKIN_PIE, 4));
|
||||||
for (int i = 0; i < 80; i++) _baseChestLoot.add(new ItemStack(Material.COOKIE));
|
for (int i = 0; i < 80; i++) _baseChestLoot.add(new ItemStack(Material.COOKIE, 4));
|
||||||
for (int i = 0; i < 90; i++) _baseChestLoot.add(new ItemStack(Material.ROTTEN_FLESH));
|
for (int i = 0; i < 90; i++) _baseChestLoot.add(new ItemStack(Material.ROTTEN_FLESH, 4));
|
||||||
|
|
||||||
for (int i = 0; i < 80; i++) _baseChestLoot.add(new ItemStack(Material.WHEAT, 6));
|
for (int i = 0; i < 80; i++) _baseChestLoot.add(new ItemStack(Material.WHEAT, 6));
|
||||||
|
|
||||||
|
@ -4,8 +4,11 @@ import mineplex.core.common.util.C;
|
|||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilInv;
|
import mineplex.core.common.util.UtilInv;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
import nautilus.game.arcade.ArcadeFormat;
|
import nautilus.game.arcade.ArcadeFormat;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
|
import nautilus.game.arcade.events.PlayerKitGiveEvent;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -98,7 +101,7 @@ public abstract class Kit implements Listener
|
|||||||
|
|
||||||
return Manager.GetGame().HasKit(player, this);
|
return Manager.GetGame().HasKit(player, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyKit(Player player)
|
public void ApplyKit(Player player)
|
||||||
{
|
{
|
||||||
UtilInv.Clear(player);
|
UtilInv.Clear(player);
|
||||||
@ -106,11 +109,20 @@ public abstract class Kit implements Listener
|
|||||||
for (Perk perk : _kitPerks)
|
for (Perk perk : _kitPerks)
|
||||||
perk.Apply(player);
|
perk.Apply(player);
|
||||||
|
|
||||||
GiveItems(player);
|
GiveItemsCall(player);
|
||||||
|
|
||||||
UtilInv.Update(player);
|
UtilInv.Update(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void GiveItemsCall(Player player)
|
||||||
|
{
|
||||||
|
GiveItems(player);
|
||||||
|
|
||||||
|
//Event
|
||||||
|
PlayerKitGiveEvent kitEvent = new PlayerKitGiveEvent(Manager.GetGame(), this, player);
|
||||||
|
UtilServer.getServer().getPluginManager().callEvent(kitEvent);
|
||||||
|
}
|
||||||
|
|
||||||
public abstract void GiveItems(Player player);
|
public abstract void GiveItems(Player player);
|
||||||
|
|
||||||
public Entity SpawnEntity(Location loc)
|
public Entity SpawnEntity(Location loc)
|
||||||
@ -190,4 +202,6 @@ public abstract class Kit implements Listener
|
|||||||
public void Deselected(Player player) { }
|
public void Deselected(Player player) { }
|
||||||
|
|
||||||
public void Selected(Player player) { }
|
public void Selected(Player player) { }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,10 @@ public class PerkThrower extends Perk implements IThrown
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Damage Event
|
//Damage Event
|
||||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||||
@ -112,7 +116,7 @@ public class PerkThrower extends Perk implements IThrown
|
|||||||
|
|
||||||
dir = UtilAlg.getTrajectory(target, data.GetThrown());
|
dir = UtilAlg.getTrajectory(target, data.GetThrown());
|
||||||
if (dir.getY() < 0) dir.setY(0);
|
if (dir.getY() < 0) dir.setY(0);
|
||||||
UtilAction.velocity(data.GetThrown(), dir, 1.2, false, 0, 0.4, 1, true);
|
UtilAction.velocity(data.GetThrown(), dir, 0.2, false, 0, 0.2, 1, true);
|
||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.SHEEP_IDLE, 3f, 5f);
|
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.SHEEP_IDLE, 3f, 5f);
|
||||||
|
@ -79,7 +79,11 @@ public class PerkWitherImage extends Perk
|
|||||||
skel.setMaxHealth(20);
|
skel.setMaxHealth(20);
|
||||||
skel.setHealth(skel.getMaxHealth());
|
skel.setHealth(skel.getMaxHealth());
|
||||||
|
|
||||||
skel.setCustomName(C.cYellow + player.getName());
|
if (Manager.GetGame().GetTeamList().size() > 1)
|
||||||
|
skel.setCustomName(Manager.GetColor(player) + player.getName());
|
||||||
|
else
|
||||||
|
skel.setCustomName(C.cYellow + player.getName());
|
||||||
|
|
||||||
skel.setCustomNameVisible(true);
|
skel.setCustomNameVisible(true);
|
||||||
|
|
||||||
//skel.setLeashHolder(player);
|
//skel.setLeashHolder(player);
|
||||||
|
@ -416,6 +416,10 @@ public class GameManager implements Listener
|
|||||||
{
|
{
|
||||||
player.sendMessage(F.main("Afk Monitor", "You are being sent to the Lobby for being AFK."));
|
player.sendMessage(F.main("Afk Monitor", "You are being sent to the Lobby for being AFK."));
|
||||||
Manager.GetPortal().SendPlayerToServer(player, "Lobby");
|
Manager.GetPortal().SendPlayerToServer(player, "Lobby");
|
||||||
|
}
|
||||||
|
else if (Manager.IsObserver(player))
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (!game.IsPlaying(player))
|
else if (!game.IsPlaying(player))
|
||||||
{
|
{
|
||||||
@ -523,6 +527,15 @@ public class GameManager implements Listener
|
|||||||
UtilServer.getServer().getPluginManager().callEvent(event);
|
UtilServer.getServer().getPluginManager().callEvent(event);
|
||||||
}
|
}
|
||||||
}, players.size());
|
}, players.size());
|
||||||
|
|
||||||
|
//Spectators Move
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
if (Manager.GetGame().IsAlive(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Manager.GetGame().SetSpectator(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -43,14 +43,14 @@ import org.bukkit.event.player.PlayerRespawnEvent;
|
|||||||
public class GamePlayerManager implements Listener
|
public class GamePlayerManager implements Listener
|
||||||
{
|
{
|
||||||
ArcadeManager Manager;
|
ArcadeManager Manager;
|
||||||
|
|
||||||
public GamePlayerManager(ArcadeManager manager)
|
public GamePlayerManager(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
Manager = manager;
|
Manager = manager;
|
||||||
|
|
||||||
Manager.GetPluginManager().registerEvents(this, Manager.GetPlugin());
|
Manager.GetPluginManager().registerEvents(this, Manager.GetPlugin());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void PlayerDeath(CombatDeathEvent event)
|
public void PlayerDeath(CombatDeathEvent event)
|
||||||
{
|
{
|
||||||
@ -60,7 +60,7 @@ public class GamePlayerManager implements Listener
|
|||||||
//Dont display message
|
//Dont display message
|
||||||
if (Manager.GetGame() != null)
|
if (Manager.GetGame() != null)
|
||||||
event.SetBroadcastType(Manager.GetGame().GetDeathMessageType());
|
event.SetBroadcastType(Manager.GetGame().GetDeathMessageType());
|
||||||
|
|
||||||
//Colors
|
//Colors
|
||||||
if (event.GetLog().GetKiller() != null)
|
if (event.GetLog().GetKiller() != null)
|
||||||
{
|
{
|
||||||
@ -82,7 +82,7 @@ public class GamePlayerManager implements Listener
|
|||||||
public void PlayerJoin(PlayerJoinEvent event)
|
public void PlayerJoin(PlayerJoinEvent event)
|
||||||
{
|
{
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
//Lobby Name
|
//Lobby Name
|
||||||
Manager.GetLobby().AddPlayerToScoreboards(player, null);
|
Manager.GetLobby().AddPlayerToScoreboards(player, null);
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ public class GamePlayerManager implements Listener
|
|||||||
event.setRespawnLocation(Manager.GetGame().GetSpectatorLocation());
|
event.setRespawnLocation(Manager.GetGame().GetSpectatorLocation());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void TeamInteract(PlayerInteractEntityEvent event)
|
public void TeamInteract(PlayerInteractEntityEvent event)
|
||||||
{
|
{
|
||||||
@ -149,6 +149,13 @@ public class GamePlayerManager implements Listener
|
|||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
//Observer
|
||||||
|
if (Manager.IsObserver(player))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Game", "Spectators cannot partake in games."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
GameTeam team = Manager.GetLobby().GetClickedTeam(event.getRightClicked());
|
GameTeam team = Manager.GetLobby().GetClickedTeam(event.getRightClicked());
|
||||||
|
|
||||||
if (team == null)
|
if (team == null)
|
||||||
@ -163,6 +170,13 @@ public class GamePlayerManager implements Listener
|
|||||||
Player player = event.GetDamagerPlayer(false);
|
Player player = event.GetDamagerPlayer(false);
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
|
|
||||||
|
//Observer
|
||||||
|
if (Manager.IsObserver(player))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Game", "Spectators cannot partake in games."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LivingEntity target = event.GetDamageeEntity();
|
LivingEntity target = event.GetDamageeEntity();
|
||||||
|
|
||||||
GameTeam team = Manager.GetLobby().GetClickedTeam(target);
|
GameTeam team = Manager.GetLobby().GetClickedTeam(target);
|
||||||
@ -186,7 +200,7 @@ public class GamePlayerManager implements Listener
|
|||||||
|
|
||||||
AddTeamPreference(Manager.GetGame(), player, team);
|
AddTeamPreference(Manager.GetGame(), player, team);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddTeamPreference(Game game, Player player, GameTeam team)
|
public void AddTeamPreference(Game game, Player player, GameTeam team)
|
||||||
{
|
{
|
||||||
GameTeam past = game.GetTeamPreference(player);
|
GameTeam past = game.GetTeamPreference(player);
|
||||||
@ -204,16 +218,16 @@ public class GamePlayerManager implements Listener
|
|||||||
if (past != null)
|
if (past != null)
|
||||||
{
|
{
|
||||||
game.RemoveTeamPreference(player);
|
game.RemoveTeamPreference(player);
|
||||||
|
|
||||||
if (game.GetType() == GameType.UHC)
|
if (game.GetType() == GameType.UHC)
|
||||||
{
|
{
|
||||||
String players = "";
|
String players = "";
|
||||||
for (Player other : game.GetTeamPreferences().get(past))
|
for (Player other : game.GetTeamPreferences().get(past))
|
||||||
players += other.getName() + " ";
|
players += other.getName() + " ";
|
||||||
|
|
||||||
if (players.length() > 0)
|
if (players.length() > 0)
|
||||||
players = players.substring(0, players.length()-1);
|
players = players.substring(0, players.length()-1);
|
||||||
|
|
||||||
for (Player other : game.GetTeamPreferences().get(past))
|
for (Player other : game.GetTeamPreferences().get(past))
|
||||||
UtilPlayer.message(other, past.GetFormattedName() + " Team: " + ChatColor.RESET + players);
|
UtilPlayer.message(other, past.GetFormattedName() + " Team: " + ChatColor.RESET + players);
|
||||||
}
|
}
|
||||||
@ -230,10 +244,10 @@ public class GamePlayerManager implements Listener
|
|||||||
String players = "";
|
String players = "";
|
||||||
for (Player other : game.GetTeamPreferences().get(team))
|
for (Player other : game.GetTeamPreferences().get(team))
|
||||||
players += other.getName() + " ";
|
players += other.getName() + " ";
|
||||||
|
|
||||||
if (players.length() > 0)
|
if (players.length() > 0)
|
||||||
players = players.substring(0, players.length()-1);
|
players = players.substring(0, players.length()-1);
|
||||||
|
|
||||||
for (Player other : game.GetTeamPreferences().get(team))
|
for (Player other : game.GetTeamPreferences().get(team))
|
||||||
UtilPlayer.message(other, team.GetFormattedName() + " Team: " + ChatColor.RESET + players);
|
UtilPlayer.message(other, team.GetFormattedName() + " Team: " + ChatColor.RESET + players);
|
||||||
}
|
}
|
||||||
@ -250,7 +264,14 @@ public class GamePlayerManager implements Listener
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
//Observer
|
||||||
|
if (Manager.IsObserver(player))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Game", "Spectators cannot partake in games."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (player.getGameMode() != GameMode.SURVIVAL)
|
if (player.getGameMode() != GameMode.SURVIVAL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -260,7 +281,7 @@ public class GamePlayerManager implements Listener
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
KitClick(player, kit, event.getRightClicked());
|
KitClick(player, kit, event.getRightClicked());
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,13 +290,20 @@ public class GamePlayerManager implements Listener
|
|||||||
{
|
{
|
||||||
if (Manager.GetGame() != null && Manager.GetGame().InProgress())
|
if (Manager.GetGame() != null && Manager.GetGame().InProgress())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
|
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = event.GetDamagerPlayer(false);
|
Player player = event.GetDamagerPlayer(false);
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
|
|
||||||
|
//Observer
|
||||||
|
if (Manager.IsObserver(player))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Game", "Spectators cannot partake in games."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (player.getGameMode() != GameMode.SURVIVAL)
|
if (player.getGameMode() != GameMode.SURVIVAL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -311,16 +339,16 @@ public class GamePlayerManager implements Listener
|
|||||||
{
|
{
|
||||||
Manager.GetShop().OpenPageForPlayer(player, new ConfirmationPage<ArcadeManager, ArcadeShop>(
|
Manager.GetShop().OpenPageForPlayer(player, new ConfirmationPage<ArcadeManager, ArcadeShop>(
|
||||||
Manager, Manager.GetShop(), Manager.GetClients(), Manager.GetDonation(), new Runnable()
|
Manager, Manager.GetShop(), Manager.GetClients(), Manager.GetDonation(), new Runnable()
|
||||||
{
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
if (player.isOnline())
|
|
||||||
{
|
{
|
||||||
Manager.GetGame().SetKit(player, kit, true);
|
public void run()
|
||||||
((CraftPlayer)player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entity.getEntityId(), ((CraftEntity)entity).getHandle().getDataWatcher(), true));
|
{
|
||||||
}
|
if (player.isOnline())
|
||||||
}
|
{
|
||||||
}, null, new KitPackage(Manager.GetGame().GetName(), kit), CurrencyType.Gems, player));
|
Manager.GetGame().SetKit(player, kit, true);
|
||||||
|
((CraftPlayer)player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entity.getEntityId(), ((CraftEntity)entity).getHandle().getDataWatcher(), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, null, new KitPackage(Manager.GetGame().GetName(), kit), CurrencyType.Gems, player));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user