Merge branch 'master' of ssh://dev1.mineplex.com:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2014-03-14 02:20:01 -07:00
commit 0094c0ebeb
5 changed files with 75 additions and 33 deletions

View File

@ -0,0 +1,40 @@
package nautilus.game.arcade.events;
import nautilus.game.arcade.game.Game;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class PlayerPrepareTeleportEvent extends Event
{
private static final HandlerList handlers = new HandlerList();
private Game _game;
private Player _player;
public PlayerPrepareTeleportEvent(Game game, Player player)
{
_game = game;
_player = player;
}
public HandlerList getHandlers()
{
return handlers;
}
public static HandlerList getHandlerList()
{
return handlers;
}
public Game GetGame()
{
return _game;
}
public Player GetPlayer()
{
return _player;
}
}

View File

@ -47,6 +47,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.gravity.kits.*;
import nautilus.game.arcade.game.games.gravity.objects.GravityBomb;
@ -114,19 +115,15 @@ public class Gravity extends SoloGame
}
@EventHandler
public void CreatePlayerObjects(GameStateChangeEvent event)
public void CreatePlayerObjects(PlayerPrepareTeleportEvent event)
{
if (event.GetState() != GameState.Prepare)
return;
Player player = event.GetPlayer();
for (Player player : GetPlayers(true))
{
GravityPlayer obj = new GravityPlayer(this, player, 60, null);
_objects.add(obj);
player.setExp(0.9999f);
}
}
@EventHandler
public void AnnounceBoost(GameStateChangeEvent event)

View File

@ -24,7 +24,7 @@ public class KitArcher extends Kit
{
public KitArcher(ArcadeManager manager)
{
super(manager, "Archer", KitAvailability.Free,
super(manager, "Archer", KitAvailability.Green,
new String[]
{

View File

@ -19,7 +19,7 @@ public class KitBrute extends Kit
{
public KitBrute(ArcadeManager manager)
{
super(manager, "Brute", KitAvailability.Free,
super(manager, "Brute", KitAvailability.Blue,
new String[]
{

View File

@ -17,10 +17,12 @@ import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
import nautilus.game.arcade.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import org.bukkit.ChatColor;
import org.bukkit.Color;
@ -498,7 +500,6 @@ public class GameManager implements Listener
public void run()
{
//Teleport
if (team != null)
team.SpawnTeleport(player);
Manager.Clear(player);
@ -508,6 +509,10 @@ public class GameManager implements Listener
if (game.GetKit(player) != null)
game.GetKit(player).ApplyKit(player);
//Event
PlayerPrepareTeleportEvent playerStateEvent = new PlayerPrepareTeleportEvent(game, player);
UtilServer.getServer().getPluginManager().callEvent(playerStateEvent);
}
}, i);
}