Removed commented lines

Added javadocs to GadgetChangeEvent
This commit is contained in:
LCastr0 2016-07-06 14:45:05 -03:00
parent 67adb34311
commit 63500c19c9
3 changed files with 5 additions and 88 deletions

View File

@ -974,91 +974,6 @@ public class GadgetManager extends MiniPlugin
}
}
// private void saveGadgets(Player player)
// {
// if (player.getGameMode() == GameMode.SPECTATOR)
// return;
// Map<String, String> cache = new HashMap<>();
// for (Gadget gadget : getAllGadgets())
// {
// GadgetType gadgetType = gadget.getGadgetType();
// if (gadget.ownsGadget(player))
// {
// switch (gadgetType)
// {
// case MUSIC_DISC:
// case ITEM:
// case MORPH:
// case BALLOON:
// break;
// case COSTUME:
// OutfitGadget outfitGadget = (OutfitGadget) gadget;
// String key = "activeCostume" + outfitGadget.getSlot().getDatabaseKey();
// if (cache.containsKey(key))
// continue;
// if (outfitGadget.isActive(player))
// cache.put(key, outfitGadget.getName());
// break;
// case GAME_MODIFIER:
// GameModifierGadget gameModifierGadget = (GameModifierGadget) gadget;
// if (gameModifierGadget.canAllowMultiple())
// {
// if (cache.containsKey(gadget.getName()))
// continue;
// cache.put(gadget.getName(), (gadget.isActive(player)) ? "enabled" : "disabled");
// } else
// {
// String dataKey = "activeModifier" + gameModifierGadget.getGameType().getName().replace(" ", "");
// if (cache.containsKey(dataKey))
// continue;
// if (gadget.isActive(player))
// cache.put(dataKey, gadget.getName());
// }
// break;
// default:
// if (cache.containsKey(gadgetType.getDatabaseKey()))
// continue;
// if (gadget.isActive(player))
// cache.put(gadgetType.getDatabaseKey(), gadget.getName());
// break;
// }
// }
// }
// cache = updateDefaultGadgets(cache);
// _userGadgetPersistence.save(player, cache);
// }
// private Map<String, String> updateDefaultGadgets(Map<String, String> cache)
// {
// for (GadgetType gadgetType : GadgetType.values())
// {
// if (gadgetType == GadgetType.MUSIC_DISC || gadgetType == GadgetType.ITEM
// || gadgetType == GadgetType.MORPH || gadgetType == GadgetType.BALLOON
// || gadgetType == GadgetType.GAME_MODIFIER)
// continue;
// if (!cache.containsKey(gadgetType.getDatabaseKey()))
// {
// String key = gadgetType.getDatabaseKey();
// if (gadgetType.equals(GadgetType.COSTUME))
// {
// for (ArmorSlot armorSlot : ArmorSlot.values())
// {
// key = "activeCostume" + armorSlot.getDatabaseKey();
// if (!cache.containsKey(key))
// {
// cache.put(key, "disabled");
// }
// }
// }
// else
// {
// cache.put(key, "disabled");
// }
// }
// }
// return cache;
// }
public boolean isKitModifierActive(KitModifier kitModifier, Player player)
{
for (Gadget gadget : getGadgets(GadgetType.GAME_MODIFIER))

View File

@ -5,6 +5,11 @@ import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Called when a player enables or disables a gadget manually,
* allowing it to be saved when the player changes a gadget, instead of
* when they quit or join a server
*/
public class GadgetChangeEvent extends Event
{

View File

@ -74,9 +74,6 @@ public class WinEffectManager
public WinEffectGadget getWinEffect()
{
GadgetManager manager = _game.getArcadeManager().getCosmeticManager().getGadgetManager();
/*Gadget gadget = manager.getActive(_winner, GadgetType.WIN_EFFECT);
if(gadget == null) gadget = manager.getGadget(WinEffectPodium.class);
return (WinEffectGadget) gadget;*/
Gadget winEffect = manager.getGadget(WinEffectPodium.class);
for (Gadget gadget : manager.getGadgets(GadgetType.WIN_EFFECT))
{