Remove Spammy "Loaded default kit message".

Fixed SSM kits not closing the GUI when the central item is clicked.
Fixed Smash Crystals being carried over into the next game.
This commit is contained in:
TadahTech 2016-06-19 02:09:17 -05:00
parent 95649a5f14
commit 5316dfe0c6
3 changed files with 25 additions and 46 deletions

View File

@ -880,10 +880,6 @@ public abstract class Game implements Listener
if (announce) if (announce)
{ {
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 2f, 1f); player.playSound(player.getLocation(), Sound.ORB_PICKUP, 2f, 1f);
if (kit instanceof ProgressingKit && ((ProgressingKit) kit).isDefault(player.getUniqueId()))
{
player.sendMessage(F.main("Kit", "Loaded default kit " + F.elem(kit.GetFormattedName())));
}
UtilPlayer.message(player, F.main("Kit", "You equipped " + F.elem(kit.GetFormattedName() + " Kit") + ".")); UtilPlayer.message(player, F.main("Kit", "You equipped " + F.elem(kit.GetFormattedName() + " Kit") + "."));
} }
@ -891,6 +887,10 @@ public abstract class Game implements Listener
{ {
kit.ApplyKit(player); kit.ApplyKit(player);
} }
else
{
player.closeInventory();
}
} }
public Kit GetKit(Player player) public Kit GetKit(Player player)

View File

@ -1,17 +1,7 @@
package nautilus.game.arcade.game.games.smash; package nautilus.game.arcade.game.games.smash;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import mineplex.core.common.block.BlockData; import mineplex.core.common.block.BlockData;
import mineplex.core.common.util.C; import mineplex.core.common.util.*;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -24,40 +14,11 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.games.smash.kits.KitBlaze; import nautilus.game.arcade.game.games.smash.kits.*;
import nautilus.game.arcade.game.games.smash.kits.KitChicken;
import nautilus.game.arcade.game.games.smash.kits.KitCow;
import nautilus.game.arcade.game.games.smash.kits.KitCreeper;
import nautilus.game.arcade.game.games.smash.kits.KitEnderman;
import nautilus.game.arcade.game.games.smash.kits.KitGolem;
import nautilus.game.arcade.game.games.smash.kits.KitMagmaCube;
import nautilus.game.arcade.game.games.smash.kits.KitPig;
import nautilus.game.arcade.game.games.smash.kits.KitSheep;
import nautilus.game.arcade.game.games.smash.kits.KitSkeletalHorse;
import nautilus.game.arcade.game.games.smash.kits.KitSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitSkySquid;
import nautilus.game.arcade.game.games.smash.kits.KitSlime;
import nautilus.game.arcade.game.games.smash.kits.KitSnowman;
import nautilus.game.arcade.game.games.smash.kits.KitSpider;
import nautilus.game.arcade.game.games.smash.kits.KitWitch;
import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitWolf;
import nautilus.game.arcade.game.games.smash.kits.KitZombie;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.SmashKit; import nautilus.game.arcade.kit.SmashKit;
import nautilus.game.arcade.stats.FreeKitWinStatTracker; import org.bukkit.*;
import nautilus.game.arcade.stats.KillFastStatTracker;
import nautilus.game.arcade.stats.OneVThreeStatTracker;
import nautilus.game.arcade.stats.RecoveryMasterStatTracker;
import nautilus.game.arcade.stats.WinWithoutDyingStatTracker;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.FireworkEffect.Type; import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.EnderCrystal; import org.bukkit.entity.EnderCrystal;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -72,6 +33,9 @@ import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import java.util.HashMap;
import java.util.HashSet;
public abstract class SuperSmash extends Game public abstract class SuperSmash extends Game
{ {
private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>(); private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>();
@ -375,6 +339,7 @@ public abstract class SuperSmash extends Game
if (announce) if (announce)
{ {
player.closeInventory();
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 2f, 1f); player.playSound(player.getLocation(), Sound.ORB_PICKUP, 2f, 1f);
UtilPlayer.message(player, F.main("Kit", "You equipped " + F.elem(kit.GetFormattedName() + " Kit") + ".")); UtilPlayer.message(player, F.main("Kit", "You equipped " + F.elem(kit.GetFormattedName() + " Kit") + "."));
kit.ApplyKit(player); kit.ApplyKit(player);

View File

@ -5,6 +5,7 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
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 org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@ -118,6 +119,19 @@ public abstract class SmashKit extends ProgressingKit
} }
} }
@EventHandler
public void onEnd(GameStateChangeEvent event)
{
Iterator<Player> superIter = _superActive.keySet().iterator();
while (superIter.hasNext())
{
Player player = superIter.next();
superIter.remove();
deactivateSuper(player);
}
}
@EventHandler @EventHandler
public void expireSuper(UpdateEvent event) public void expireSuper(UpdateEvent event)
{ {