fixed 'self scoring' in Soccer

removed silverfish on wither pet despawn
This commit is contained in:
Cheese 2015-09-05 10:04:54 +10:00
parent 106a7dab2e
commit fc5ccd4a5e
2 changed files with 34 additions and 14 deletions

View File

@ -228,8 +228,14 @@ public class PetManager extends MiniClientPlugin<PetClient>
if (_activePetOwners.containsKey(player.getName()))
{
final Creature pet = _activePetOwners.get(player.getName());
//Wither Silverfish
if (pet.getPassenger() != null)
pet.getPassenger().remove();
pet.remove();
if (removeOwner)
{
_activePetOwners.remove(player.getName());

View File

@ -83,8 +83,9 @@ public class SoccerManager extends MiniPlugin
private Vector _ballVel;
private long _ballDeadTime = -1;
private String _lastKicker = "";
private Color _lastKick = null;
private String _lastRedKicker = "";
private String _lastBlueKicker = "";
private Color _lastKickColor = null;
//Item Rebound
protected Vector _vel;
@ -176,7 +177,7 @@ public class SoccerManager extends MiniPlugin
if (_ball == null)
return;
if (_lastKick == Color.AQUA)
if (_lastKickColor == Color.AQUA)
{
for (int i = 0 ; i < 3 ; i++)
UtilParticle.PlayParticle(ParticleType.RED_DUST, _ball.getLocation().add(0.0, 0.5, 0.0), -1, 1, 1, 1, 0,
@ -213,13 +214,22 @@ public class SoccerManager extends MiniPlugin
UtilAction.zeroVelocity(player);
_lastKick = getTeamColor(player);
if (_lastKick == null)
_lastKicker = player.getName();
else if (_lastKick == Color.RED)
_lastKicker = C.cRed + player.getName();
else if (_lastKick == Color.AQUA)
_lastKicker = C.cAqua + player.getName();
_lastKickColor = getTeamColor(player);
if (_lastKickColor == Color.RED)
{
_lastRedKicker = C.cRed + player.getName();
if (_lastBlueKicker.length() == 0)
_lastBlueKicker = C.cRed + player.getName();
}
else if (_lastKickColor == Color.AQUA)
{
_lastBlueKicker = C.cAqua + player.getName();
if (_lastRedKicker.length() == 0)
_lastRedKicker = C.cRed + player.getName();
}
}
}
}
@ -239,14 +249,15 @@ public class SoccerManager extends MiniPlugin
for (Player player : _active)
UtilTextMiddle.display("Goal! (" + C.cRed + _redGoals + C.cWhite + " : " + C.cBlue + _blueGoals + C.cWhite + ")",
_lastKicker + C.cWhite + " scored for " + C.cAqua + "Blue Team", 0, 70, 20, player);
_lastBlueKicker + C.cWhite + " scored for " + C.cAqua + "Blue Team", 0, 70, 20, player);
_ball.remove();
_ball = null;
_lastRedKicker = "";
_lastBlueKicker = "";
}
return;
}
@ -264,10 +275,13 @@ public class SoccerManager extends MiniPlugin
for (Player player : _active)
UtilTextMiddle.display("Goal! (" + C.cRed + _redGoals + C.cWhite + " : " + C.cBlue + _blueGoals + C.cWhite + ")",
_lastKicker + C.cWhite + " scored for " + C.cRed + "Red Team", 0, 70, 20, player);
_lastRedKicker + C.cWhite + " scored for " + C.cRed + "Red Team", 0, 70, 20, player);
_ball.remove();
_ball = null;
_lastRedKicker = "";
_lastBlueKicker = "";
}
return;