diff --git a/Plugins/Mineplex.Core/src/mineplex/core/MiniClientPlugin.java b/Plugins/Mineplex.Core/src/mineplex/core/MiniClientPlugin.java index 391e86a54..d90d08fe5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/MiniClientPlugin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/MiniClientPlugin.java @@ -35,7 +35,7 @@ public abstract class MiniClientPlugin extends MiniPlug synchronized (_clientDataLock) { if (!_clientData.containsKey(name)) - _clientData.put(name, AddPlayer(name)); + _clientData.put(name, addPlayer(name)); return _clientData.get(name); } @@ -66,5 +66,5 @@ public abstract class MiniClientPlugin extends MiniPlug } } - protected abstract DataType AddPlayer(String player); + protected abstract DataType addPlayer(String player); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/benefit/BenefitManager.java b/Plugins/Mineplex.Core/src/mineplex/core/benefit/BenefitManager.java index 045d6f42f..804ba1931 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/benefit/BenefitManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/benefit/BenefitManager.java @@ -67,7 +67,7 @@ public class BenefitManager extends MiniDbClientPlugin } @Override - protected BenefitData AddPlayer(String player) + protected BenefitData addPlayer(String player) { return new BenefitData(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java index 0fd3396b7..45736c3d6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java @@ -989,7 +989,7 @@ public class BonusManager extends MiniClientPlugin implements I } @Override - protected BonusClientData AddPlayer(String player) + protected BonusClientData addPlayer(String player) { return new BonusClientData(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/boosters/tips/BoosterTipManager.java b/Plugins/Mineplex.Core/src/mineplex/core/boosters/tips/BoosterTipManager.java index 1b5603ccd..be7f28ca9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/boosters/tips/BoosterTipManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/boosters/tips/BoosterTipManager.java @@ -110,7 +110,7 @@ public class BoosterTipManager extends MiniDbClientPlugin } @Override - protected PlayerTipData AddPlayer(String player) + protected PlayerTipData addPlayer(String player) { return new PlayerTipData(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java index 0f0686a42..8da12b5d9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java @@ -180,7 +180,7 @@ public class CosmeticManager extends MiniPlugin { _gadgetManager.disableAll(); _mountManager.DisableAll(); - _petManager.DisableAll(); + _petManager.disableAll(); } public void setHideParticles(boolean b) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/PetSorter.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/PetSorter.java index 8d339374e..64de96efc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/PetSorter.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/PetSorter.java @@ -8,7 +8,7 @@ public class PetSorter implements Comparator { public int compare(Pet a, Pet b) { - if (a.GetPetType().getTypeId() < b.GetPetType().getTypeId()) + if (a.getPetType().getTypeId() < b.getPetType().getTypeId()) return -1; return 1; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/activate/ActivatePetButton.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/activate/ActivatePetButton.java index 2f1dffd96..61539e368 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/activate/ActivatePetButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/activate/ActivatePetButton.java @@ -23,7 +23,7 @@ public class ActivatePetButton implements IButton public void onClick(Player player, ClickType clickType) { _page.playAcceptSound(player); - _page.getPlugin().getPetManager().AddPetOwner(player, _pet.GetPetType(), player.getLocation()); + _page.getPlugin().getPetManager().addPetOwner(player, _pet.getPetType(), player.getLocation()); _page.getShop().openPageForPlayer(player, new Menu(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), player)); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/deactivate/DeactivatePetButton.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/deactivate/DeactivatePetButton.java index 2b3fb0c61..1fc5c2af1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/deactivate/DeactivatePetButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/deactivate/DeactivatePetButton.java @@ -21,7 +21,7 @@ public class DeactivatePetButton implements IButton public void onClick(Player player, ClickType clickType) { _page.playAcceptSound(player); - _petManager.RemovePet(player, true); + _petManager.removePet(player, true); _page.refresh(); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/open/OpenPets.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/open/OpenPets.java index 711679214..a8ac5e906 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/open/OpenPets.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/open/OpenPets.java @@ -24,7 +24,7 @@ public class OpenPets implements IButton else { _menu.playAcceptSound(player); - _menu.getPlugin().getPetManager().RemovePet(player, true); + _menu.getPlugin().getPetManager().removePet(player, true); _menu.refresh(); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 154188ad8..ed351310b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -4,7 +4,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.banner.CountryFlag; +import mineplex.core.gadget.event.GadgetChangeEvent; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -393,6 +395,9 @@ public class GadgetPage extends ShopPageBase playAcceptSound(player); gadget.enable(player); + GadgetChangeEvent gadgetChangeEvent = new GadgetChangeEvent(player, gadget, + GadgetChangeEvent.GadgetState.ENABLED); + UtilServer.getPluginManager().callEvent(gadgetChangeEvent); refresh(); } @@ -409,6 +414,9 @@ public class GadgetPage extends ShopPageBase { playAcceptSound(player); gadget.disable(player); + GadgetChangeEvent gadgetChangeEvent = new GadgetChangeEvent(player, gadget, + GadgetChangeEvent.GadgetState.DISABLED); + UtilServer.getPluginManager().callEvent(gadgetChangeEvent); refresh(); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index a12a14307..c5d8df866 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -100,7 +100,7 @@ public class Menu extends ShopPageBase Mount mountActive = getPlugin().getMountManager().getActive(getPlayer()); for (Mount mount : getPlugin().getMountManager().getMounts()) { - if (getDonationManager().Get(getPlayer()).OwnsUnknownPackage(mount.getName()) || mount.hasMount(getPlayer())) + if (mount.hasMount(getPlayer())) { mountOwned++; } @@ -110,17 +110,17 @@ public class Menu extends ShopPageBase int petOwned = 0; int petMax = 0; - for (Pet pet : getPlugin().getPetManager().GetFactory().GetPets()) + for (Pet pet : getPlugin().getPetManager().getFactory().GetPets()) { - NautHashMap pets = getPlugin().getPetManager().Get(getPlayer()).GetPets(); - if (pets != null && pets.containsKey(pet.GetPetType())) + NautHashMap pets = getPlugin().getPetManager().Get(getPlayer()).getPets(); + if (pets != null && pets.containsKey(pet.getPetType())) { petOwned++; } petMax++; } - Creature petActive = getPlugin().getPetManager().GetPet(getPlayer()); + Creature petActive = getPlugin().getPetManager().getPet(getPlayer()); GadgetType type = GadgetType.PARTICLE; String[] lore = getLore(ownedCount.get(type), maxCount.get(type), "Show everyone how cool you are with swirly particles that follow you when you walk!", "Visible Everywhere", enabled.get(type)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java index 3b278c855..8ecd60944 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java @@ -49,7 +49,7 @@ public class PetPage extends ShopPageBase { int slot = 19; - List pets = new ArrayList(getPlugin().getPetManager().GetFactory().GetPets()); + List pets = new ArrayList(getPlugin().getPetManager().getFactory().GetPets()); Collections.sort(pets, new PetSorter()); @@ -61,7 +61,7 @@ public class PetPage extends ShopPageBase itemLore.add(C.cGray + "Your very own " + pet.getName() + "!"); //Chest Unlocks - if (!getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType())) + if (!getPlugin().getPetManager().Get(getPlayer()).getPets().containsKey(pet.getPetType())) { if (pet.getCost(CurrencyType.TREASURE_SHARD) == -1) { @@ -113,21 +113,21 @@ public class PetPage extends ShopPageBase } //Owned - if (getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType())) + if (getPlugin().getPetManager().Get(getPlayer()).getPets().containsKey(pet.getPetType())) { - String petName = getPlugin().getPetManager().Get(getPlayer()).GetPets().get(pet.GetPetType()); + String petName = getPlugin().getPetManager().Get(getPlayer()).getPets().get(pet.getPetType()); if (petName == null) { petName = pet.getName(); } - if (getPlugin().getPetManager().hasActivePet(getPlayer().getName()) && getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() == pet.GetPetType()) + if (getPlugin().getPetManager().hasActivePet(getPlayer().getName()) && getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() == pet.getPetType()) { itemLore.add(C.cBlack); itemLore.add(C.cGreen + "Click to Disable"); - addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.GetPetType().getTypeId(), - pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")", + addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.getPetType().getTypeId(), + pet.getPetName() + " (" + C.cWhite + petName + C.cGreen + ")", itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivatePetButton(this, getPlugin().getPetManager())); addGlow(slot); @@ -137,8 +137,8 @@ public class PetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.add(C.cGreen + "Click to Enable"); - addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.GetPetType().getTypeId(), - pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")", + addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.getPetType().getTypeId(), + pet.getPetName() + " (" + C.cWhite + petName + C.cGreen + ")", itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivatePetButton(pet, this)); } } @@ -156,18 +156,18 @@ public class PetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.add(C.cGreen + "Click to Purchase"); - addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new PetButton(pet, this)); + addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, pet.getPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new PetButton(pet, this)); } else if (pet.getCost(CurrencyType.TREASURE_SHARD) > 0) { itemLore.add(C.cBlack); itemLore.add(C.cRed + "Not enough Treasure Shards."); - setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.getPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); } else { - setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.getPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); } } @@ -178,7 +178,7 @@ public class PetPage extends ShopPageBase } slot = 49; - for (PetExtra petExtra : getPlugin().getPetManager().GetFactory().GetPetExtras()) + for (PetExtra petExtra : getPlugin().getPetManager().getFactory().GetPetExtras()) { List itemLore = new ArrayList(); @@ -233,7 +233,7 @@ public class PetPage extends ShopPageBase public void deactivatePet(Player player) { playAcceptSound(player); - getPlugin().getPetManager().RemovePet(player, true); + getPlugin().getPetManager().removePet(player, true); refresh(); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java index 4bc7ac740..27997f3a8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java @@ -108,8 +108,8 @@ public class PetTagPage extends ShopPageBase token.AccountId = PlayerCache.getInstance().getPlayer(getPlayer().getUniqueId()).getAccountId(); token.Name = getPlayer().getName(); - token.PetType = _pet.GetPetType().toString(); - token.PetId = _pet.GetPetType().ordinal(); + token.PetType = _pet.getPetType().toString(); + token.PetId = _pet.getPetType().ordinal(); token.PetName = _tagName; PetToken petToken = new PetToken(); @@ -117,16 +117,16 @@ public class PetTagPage extends ShopPageBase if (_petPurchase) { - getPlugin().getPetManager().GetRepository().AddPet(token); - getPlugin().getPetManager().addPetOwnerToQueue(getPlayer().getName(), _pet.GetPetType()); + getPlugin().getPetManager().getRepository().AddPet(token); + getPlugin().getPetManager().addPetOwnerToQueue(getPlayer().getName(), _pet.getPetType()); } else { - getPlugin().getPetManager().GetRepository().UpdatePet(token); + getPlugin().getPetManager().getRepository().UpdatePet(token); getPlugin().getPetManager().addRenamePetToQueue(getPlayer().getName(), token.PetName); } - getPlugin().getPetManager().Get(getPlayer()).GetPets().put(_pet.GetPetType(), token.PetName); + getPlugin().getPetManager().Get(getPlayer()).getPets().put(_pet.getPetType(), token.PetName); getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), getPlayer())); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/customdata/CustomDataManager.java b/Plugins/Mineplex.Core/src/mineplex/core/customdata/CustomDataManager.java index 26652d24a..45893a07d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/customdata/CustomDataManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/customdata/CustomDataManager.java @@ -43,7 +43,7 @@ public class CustomDataManager extends MiniDbClientPlugin } @Override - protected PlayerCustomData AddPlayer(String player) + protected PlayerCustomData addPlayer(String player) { return new PlayerCustomData(_repository); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/delayedtask/DelayedTask.java b/Plugins/Mineplex.Core/src/mineplex/core/delayedtask/DelayedTask.java index da5c6c7c0..d407ec093 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/delayedtask/DelayedTask.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/delayedtask/DelayedTask.java @@ -58,7 +58,7 @@ public class DelayedTask extends MiniClientPlugin } @Override - protected DelayedTaskClient AddPlayer(String player) + protected DelayedTaskClient addPlayer(String player) { return new DelayedTaskClient(Bukkit.getPlayer(player)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java b/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java index b5708c16e..fd0862c9d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java @@ -518,7 +518,7 @@ public class DonationManager extends MiniDbClientPlugin } @Override - protected Donor AddPlayer(String player) + protected Donor addPlayer(String player) { return new Donor(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/elo/EloManager.java b/Plugins/Mineplex.Core/src/mineplex/core/elo/EloManager.java index 4ba9e6932..cbfec07b9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/elo/EloManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/elo/EloManager.java @@ -114,7 +114,7 @@ public class EloManager extends MiniDbClientPlugin } @Override - protected EloClientData AddPlayer(String player) + protected EloClientData addPlayer(String player) { return new EloClientData(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/energy/Energy.java b/Plugins/Mineplex.Core/src/mineplex/core/energy/Energy.java index 313bde55d..51849c397 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/energy/Energy.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/energy/Energy.java @@ -137,7 +137,7 @@ public class Energy extends MiniClientPlugin } @Override - protected ClientEnergy AddPlayer(String player) + protected ClientEnergy addPlayer(String player) { return new ClientEnergy(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/facebook/FacebookManager.java b/Plugins/Mineplex.Core/src/mineplex/core/facebook/FacebookManager.java index 054ac2c79..4f1e56d17 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/facebook/FacebookManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/facebook/FacebookManager.java @@ -106,7 +106,7 @@ public class FacebookManager extends MiniDbClientPlugin } @Override - protected FacebookClient AddPlayer(String player) + protected FacebookClient addPlayer(String player) { return new FacebookClient(false); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java index 4e64f95b1..355aa3407 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java @@ -70,7 +70,7 @@ public class FriendManager extends MiniDbClientPlugin } @Override - protected FriendData AddPlayer(String player) + protected FriendData addPlayer(String player) { return new FriendData(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index f8c68e0ec..d143a6fb2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -4,6 +4,7 @@ import java.util.*; import java.util.function.Predicate; import mineplex.core.gadget.commands.LockCosmeticsCommand; +import mineplex.core.gadget.event.GadgetChangeEvent; import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom; import mineplex.core.gadget.gadgets.death.freedom.DeathFreedom; @@ -776,7 +777,9 @@ public class GadgetManager extends MiniPlugin @EventHandler public void onPlayerQuit(PlayerQuitEvent event) { - saveGadgets(event.getPlayer()); + //saveGadgets(event.getPlayer()); + event.getPlayer().setWalkSpeed(0.2f); + event.getPlayer().setFlySpeed(0.1f); disableAll(event.getPlayer(), false); _lastMove.remove(event.getPlayer()); _playerActiveGadgetMap.remove(event.getPlayer()); @@ -914,91 +917,144 @@ public class GadgetManager extends MiniPlugin event.setCancelled(true); } - private void saveGadgets(Player player) + @EventHandler + private void saveGadget(GadgetChangeEvent event) { - if (player.getGameMode() == GameMode.SPECTATOR) - return; - Map cache = new HashMap<>(); - for (Gadget gadget : getAllGadgets()) + Gadget gadget = event.getGadget(); + if (gadget != null) { + String value = "disabled", key = ""; 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 updateDefaultGadgets(Map 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())) + switch (gadgetType) { - String key = gadgetType.getDatabaseKey(); - if (gadgetType.equals(GadgetType.COSTUME)) - { - for (ArmorSlot armorSlot : ArmorSlot.values()) + case MUSIC_DISC: + case ITEM: + case MORPH: + case BALLOON: + return; + case COSTUME: + OutfitGadget outfitGadget = (OutfitGadget) gadget; + key = "activeCostume" + outfitGadget.getSlot().getDatabaseKey(); + if (event.getGadgetState() == GadgetChangeEvent.GadgetState.ENABLED) { - key = "activeCostume" + armorSlot.getDatabaseKey(); - if (!cache.containsKey(key)) + value = outfitGadget.getName(); + } + break; + case GAME_MODIFIER: + GameModifierGadget gameModifierGadget = (GameModifierGadget) gadget; + if (gameModifierGadget.canAllowMultiple()) + { + key = gameModifierGadget.getName(); + if (event.getGadgetState() == GadgetChangeEvent.GadgetState.ENABLED) { - cache.put(key, "disabled"); + value = "enabled"; } } - } - else - { - cache.put(key, "disabled"); - } + else + { + key = "activeModifier" + gameModifierGadget.getGameType().getName().replace(" ", ""); + if (event.getGadgetState() == GadgetChangeEvent.GadgetState.ENABLED) + { + value = gameModifierGadget.getName(); + } + } + break; + default: + key = gadgetType.getDatabaseKey(); + if (event.getGadgetState() == GadgetChangeEvent.GadgetState.ENABLED) + { + value = gadget.getName(); + } } + _userGadgetPersistence.save(event.getPlayer(), key, value); } - return cache; } +// private void saveGadgets(Player player) +// { +// if (player.getGameMode() == GameMode.SPECTATOR) +// return; +// Map 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 updateDefaultGadgets(Map 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)) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/LockCosmeticsCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/LockCosmeticsCommand.java index 7137b9def..1fc07c933 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/LockCosmeticsCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/LockCosmeticsCommand.java @@ -2,12 +2,17 @@ package mineplex.core.gadget.commands; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; +import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; +import mineplex.core.inventory.ClientItem; +import mineplex.core.inventory.data.Item; import mineplex.core.mount.Mount; +import mineplex.core.pet.Pet; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -28,7 +33,7 @@ public class LockCosmeticsCommand extends CommandBase // Removes all cosmetic types if (args.length == 0) { - addCosmetics(null, caller); + lockCosmetics(null, caller); } // Removes specific type else @@ -36,8 +41,16 @@ public class LockCosmeticsCommand extends CommandBase String type = args[0]; if (type.equalsIgnoreCase("all")) { - addCosmetics(null, caller); + lockCosmetics(null, caller); } + else if (type.equalsIgnoreCase("pet")) + { + lockPets(caller); + } + else if (type.equalsIgnoreCase("mount")) + { + lockMounts(caller); + } else { GadgetType gadgetType = GadgetType.valueOf(type); @@ -47,27 +60,74 @@ public class LockCosmeticsCommand extends CommandBase } else { - addCosmetics(gadgetType, caller); + lockCosmetics(gadgetType, caller); } } } } - private void addCosmetics(GadgetType gadgetType, Player caller) + private void lockCosmetics(GadgetType gadgetType, Player caller) { if (gadgetType == null) { for (GadgetType type : GadgetType.values()) { - addCosmetics(type, caller); + lockCosmetics(type, caller); } + lockMounts(caller); + lockPets(caller); return; } + int removed = 0; for (Gadget gadget : _plugin.getGadgets(gadgetType)) { - _plugin.getDonationManager().Get(caller.getName()).RemoveUnknownSalesPackagesOwned(gadget.getName()); + if (gadget.getGadgetType() == GadgetType.ITEM) + continue; + if (gadget.ownsGadget(caller)) + { + Item clientItem = _plugin.getInventoryManager().getItem(gadget.getName()); + if (clientItem == null) + continue; + _plugin.getInventoryManager().Get(caller.getName()).removeItem(new ClientItem(clientItem, 1)); + removed++; + } } - UtilPlayer.message(caller, F.main("Cosmetics", "Removed all the " + gadgetType.name() + " cosmetics!")); + UtilPlayer.message(caller, F.main("Cosmetics", "Removed all the " + gadgetType.name().toLowerCase() + .replace("_", " ") + "! (Removed " + C.cRed + removed + C.cGray + " " + + UtilText.plural("item", removed) + ")")); } + + private void lockMounts(Player caller) + { + int removed = 0; + for (Mount mount : _plugin.getMountManager().getMounts()) + { + if (mount.hasMount(caller)) + { + Item clientItem = _plugin.getInventoryManager().getItem(mount.getName()); + if (clientItem == null) + continue; + _plugin.getInventoryManager().Get(caller.getName()).removeItem(new ClientItem(clientItem, 1)); + removed++; + } + } + UtilPlayer.message(caller, F.main("Cosmetics", "Removed " + C.cRed + removed + C.cGray + " " + + UtilText.plural("mount", removed) + "!")); + } + + private void lockPets(Player caller) + { + int removed = 0; + for (Pet pet : _plugin.getPetManager().getFactory().GetPets()) + { + if (_plugin.getPetManager().Get(caller).getPets().containsKey(pet.getPetType())) + { + _plugin.getPetManager().Get(caller).getPets().remove(pet.getPetType()); + removed++; + } + } + UtilPlayer.message(caller, F.main("Cosmetics", "Removed " + C.cRed + removed + C.cGray + " " + + UtilText.plural("pet", removed) + "!")); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java index f55fb3394..36a279711 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java @@ -2,15 +2,15 @@ package mineplex.core.gadget.commands; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; +import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.mount.Mount; -import mineplex.core.mount.MountManager; import mineplex.core.pet.Pet; -import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; public class UnlockCosmeticsCommand extends CommandBase @@ -40,6 +40,14 @@ public class UnlockCosmeticsCommand extends CommandBase { addCosmetics(null, caller); } + else if (type.equalsIgnoreCase("pet")) + { + addPets(caller); + } + else if (type.equalsIgnoreCase("mount")) + { + addMounts(caller); + } else { GadgetType gadgetType = GadgetType.valueOf(type); @@ -64,12 +72,54 @@ public class UnlockCosmeticsCommand extends CommandBase { addCosmetics(type, caller); } + addMounts(caller); + addPets(caller); return; } + int added = 0; + int amount = 1; for (Gadget gadget : _plugin.getGadgets(gadgetType)) { - _plugin.getDonationManager().Get(caller.getName()).AddUnknownSalesPackagesOwned(gadget.getName()); + if (gadgetType == GadgetType.ITEM) + amount = 20; + if (!gadget.ownsGadget(caller)) + { + _plugin.getInventoryManager().addItemToInventory(caller, gadget.getName(), amount); + added++; + } } - UtilPlayer.message(caller, F.main("Cosmetics", "Added all the " + gadgetType.name() + " cosmetics!")); + UtilPlayer.message(caller, F.main("Cosmetics", "Added all the " + gadgetType.name().toLowerCase() + .replace("_", " ") + "! (Added " + C.cRed + added + C.cGray + " " + + UtilText.plural("item", added) + ")")); } + + private void addMounts(Player caller) + { + int added = 0; + for (Mount mount : _plugin.getMountManager().getMounts()) + { + if (!mount.hasMount(caller)) + { + _plugin.getInventoryManager().addItemToInventory(caller, mount.getName(), 1); + added++; + } + } + UtilPlayer.message(caller, F.main("Cosmetics", "Added " + C.cRed + added + C.cGray + " " + + UtilText.plural("mount", added) + "!")); + } + + private void addPets(Player caller) + { + int added = 0; + for (Pet pet : _plugin.getPetManager().getFactory().GetPets()) + { + if (!_plugin.getPetManager().Get(caller).getPets().containsKey(pet.getPetType())) + { + _plugin.getPetManager().Get(caller).getPets().put(pet.getPetType(), pet.getName()); + added++; + } + } + UtilPlayer.message(caller, F.main("Cosmetics", "Added " + C.cRed + added + C.cGray + " " + + UtilText.plural("pet", added) + "!")); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetChangeEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetChangeEvent.java new file mode 100644 index 000000000..0cb01a1c1 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetChangeEvent.java @@ -0,0 +1,55 @@ +package mineplex.core.gadget.event; + +import mineplex.core.gadget.types.Gadget; +import org.bukkit.entity.Player; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class GadgetChangeEvent extends Event +{ + + public enum GadgetState + { + ENABLED, + DISABLED + } + + private static final HandlerList handlers = new HandlerList(); + + private final Player _player; + private final Gadget _gadget; + private final GadgetState _gadgetState; + + public GadgetChangeEvent(Player player, Gadget gadget, GadgetState gadgetState) + { + _player = player; + _gadget = gadget; + _gadgetState = gadgetState; + } + + public Player getPlayer() + { + return _player; + } + + public Gadget getGadget() + { + return _gadget; + } + + public GadgetState getGadgetState() + { + return _gadgetState; + } + + public HandlerList getHandlers() + { + return handlers; + } + + public static HandlerList getHandlerList() + { + return handlers; + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java index 377c596f0..f031776d3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -117,7 +117,7 @@ public class ItemCoal extends ItemGadget } //Coal Apparition - if (!Manager.getPetManager().Get(player).GetPets().containsKey(EntityType.PIG_ZOMBIE)) + if (!Manager.getPetManager().Get(player).getPets().containsKey(EntityType.PIG_ZOMBIE)) { goal = _pet; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/WinEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/WinEffectGadget.java index b70b8ca49..059e4ec12 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/WinEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/WinEffectGadget.java @@ -262,7 +262,6 @@ public abstract class WinEffectGadget extends Gadget UtilPlayer.hideFromAll(p); p.setGameMode(GameMode.ADVENTURE); p.getInventory().clear(); - p.teleport(loc.clone().add(.5, 0, .5)); p.setAllowFlight(false); Manager.disableAll(p, false); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/giveaway/GiveawayManager.java b/Plugins/Mineplex.Core/src/mineplex/core/giveaway/GiveawayManager.java index bfcfa4981..9d86ffa9c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/giveaway/GiveawayManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/giveaway/GiveawayManager.java @@ -173,7 +173,7 @@ public class GiveawayManager extends MiniDbClientPlugin } @Override - protected PlayerGiveawayData AddPlayer(String player) + protected PlayerGiveawayData addPlayer(String player) { return new PlayerGiveawayData(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/ignore/IgnoreManager.java b/Plugins/Mineplex.Core/src/mineplex/core/ignore/IgnoreManager.java index a4735a7a4..15c0fca39 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/ignore/IgnoreManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/ignore/IgnoreManager.java @@ -80,7 +80,7 @@ public class IgnoreManager extends MiniDbClientPlugin } @Override - protected IgnoreData AddPlayer(String player) + protected IgnoreData addPlayer(String player) { return new IgnoreData(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/incognito/IncognitoManager.java b/Plugins/Mineplex.Core/src/mineplex/core/incognito/IncognitoManager.java index 92a1cb641..2594b4188 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/incognito/IncognitoManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/incognito/IncognitoManager.java @@ -191,7 +191,7 @@ public class IncognitoManager extends MiniDbClientPlugin UtilPlayer.message(player, " "); } - protected IncognitoClient AddPlayer(String player) + protected IncognitoClient addPlayer(String player) { return new IncognitoClient(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java index 72a33d939..43a1d22e8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java @@ -342,7 +342,7 @@ public class InventoryManager extends MiniDbClientPlugin } @Override - protected ClientInventory AddPlayer(String player) + protected ClientInventory addPlayer(String player) { return new ClientInventory(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java index 6d437d2d1..3faaee528 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java @@ -87,7 +87,7 @@ public class MessageManager extends MiniClientPlugin } @Override - protected ClientMessage AddPlayer(String player) + protected ClientMessage addPlayer(String player) { Set(player, new ClientMessage()); return Get(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/movement/Movement.java b/Plugins/Mineplex.Core/src/mineplex/core/movement/Movement.java index 9f801a28c..40d547a39 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/movement/Movement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/movement/Movement.java @@ -40,7 +40,7 @@ public class Movement extends MiniClientPlugin } @Override - protected ClientMovement AddPlayer(String player) + protected ClientMovement addPlayer(String player) { return new ClientMovement(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/Pet.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/Pet.java index 251b2827c..0ae459e78 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/Pet.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/Pet.java @@ -24,17 +24,17 @@ public class Pet extends SalesPackageBase KnownPackage = false; } - public EntityType GetPetType() + public EntityType getPetType() { return _petType; } - public void Update(PetSalesToken petToken) + public void update(PetSalesToken petToken) { _name = petToken.Name; } - public String GetPetName() + public String getPetName() { return _name; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetClient.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetClient.java index 5aa25843a..e24136065 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetClient.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetClient.java @@ -11,7 +11,7 @@ public class PetClient private NautHashMap _pets; private int _petNameTagCount; - public void Load(ClientPetToken token) + public void load(ClientPetToken token) { _pets = new NautHashMap(); @@ -26,7 +26,7 @@ public class PetClient _petNameTagCount = Math.max(0, token.PetNameTagCount); } - public NautHashMap GetPets() + public NautHashMap getPets() { return _pets; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index 4e609930f..d5f48d43b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -128,7 +128,7 @@ public class PetManager extends MiniClientPlugin if (player != null && player.isOnline()) { - AddPetOwner(player, _petOwnerQueue.get(playerName), player.getLocation()); + addPetOwner(player, _petOwnerQueue.get(playerName), player.getLocation()); } } @@ -160,24 +160,24 @@ public class PetManager extends MiniClientPlugin if (rank.has(Rank.LEGEND)) { - if (!Get(p).GetPets().containsKey(EntityType.WITHER)) - Get(p).GetPets().put(EntityType.WITHER, "Widder"); + if (!Get(p).getPets().containsKey(EntityType.WITHER)) + Get(p).getPets().put(EntityType.WITHER, "Widder"); } if (rank.has(Rank.TITAN)) { - if (!Get(p).GetPets().containsKey(EntityType.SKELETON)) - Get(p).GetPets().put(EntityType.SKELETON, "Guardian"); + if (!Get(p).getPets().containsKey(EntityType.SKELETON)) + Get(p).getPets().put(EntityType.SKELETON, "Guardian"); } } - public void AddPetOwner(Player player, EntityType entityType, Location location) + public void addPetOwner(Player player, EntityType entityType, Location location) { if (_activePetOwners.containsKey(player.getName())) { if (_activePetOwners.get(player.getName()).getType() != entityType) { - RemovePet(player, true); + removePet(player, true); } else return; @@ -214,10 +214,10 @@ public class PetManager extends MiniClientPlugin } //Named Pet - if (Get(player).GetPets().get(entityType) != null && Get(player).GetPets().get(entityType).length() > 0) + if (Get(player).getPets().get(entityType) != null && Get(player).getPets().get(entityType).length() > 0) { //pet.setCustomNameVisible(true); - pet.setCustomName(Get(player).GetPets().get(entityType)); + pet.setCustomName(Get(player).getPets().get(entityType)); } if (pet instanceof Zombie) @@ -245,9 +245,9 @@ public class PetManager extends MiniClientPlugin DisguiseGuardian disguise = new DisguiseGuardian(pet); - if (Get(player).GetPets().get(entityType) != null && Get(player).GetPets().get(entityType).length() > 0) + if (Get(player).getPets().get(entityType) != null && Get(player).getPets().get(entityType).length() > 0) { - disguise.setName(Get(player).GetPets().get(entityType)); + disguise.setName(Get(player).getPets().get(entityType)); } _disguiseManager.disguise(disguise); @@ -265,12 +265,12 @@ public class PetManager extends MiniClientPlugin UtilEnt.Vegetate(pet); } - public Creature GetPet(Player player) + public Creature getPet(Player player) { return _activePetOwners.get(player.getName()); } - public void RemovePet(final Player player, boolean removeOwner) + public void removePet(final Player player, boolean removeOwner) { if (_activePetOwners.containsKey(player.getName())) { @@ -303,7 +303,7 @@ public class PetManager extends MiniClientPlugin @EventHandler public void onPlayerQuit(PlayerQuitEvent event) { - RemovePet(event.getPlayer(), true); + removePet(event.getPlayer(), true); } @EventHandler @@ -336,7 +336,7 @@ public class PetManager extends MiniClientPlugin if (player != null && player.isOnline()) { - RemovePet(player, true); + removePet(player, true); } } } @@ -438,25 +438,25 @@ public class PetManager extends MiniClientPlugin } @EventHandler - public void OnClientWebResponse(ClientWebResponseEvent event) + public void onClientWebResponse(ClientWebResponseEvent event) { ClientPetTokenWrapper token = new Gson().fromJson(event.GetResponse(), ClientPetTokenWrapper.class); - Get(token.Name).Load(token.DonorToken); + Get(token.Name).load(token.DonorToken); } @Override - protected PetClient AddPlayer(String player) + protected PetClient addPlayer(String player) { return new PetClient(); } - public PetFactory GetFactory() + public PetFactory getFactory() { return _petFactory; } - public PetRepository GetRepository() + public PetRepository getRepository() { return _repository; } @@ -471,15 +471,15 @@ public class PetManager extends MiniClientPlugin return _activePetOwners.get(name); } - public void DisableAll() + public void disableAll() { for (Player player : UtilServer.getPlayers()) - RemovePet(player, true); + removePet(player, true); } - public void DisableAll(Player player) + public void disableAll(Player player) { - RemovePet(player, true); + removePet(player, true); } public Collection getPets() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/poll/PollManager.java b/Plugins/Mineplex.Core/src/mineplex/core/poll/PollManager.java index a2d5298b0..64abfc3cf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/poll/PollManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/poll/PollManager.java @@ -51,7 +51,7 @@ public class PollManager extends MiniDbClientPlugin } @Override - protected PlayerPollData AddPlayer(String player) + protected PlayerPollData addPlayer(String player) { return new PlayerPollData(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java index 5622bdef6..07592704a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java @@ -59,7 +59,7 @@ public class PreferencesManager extends MiniDbClientPlugin } @Override - protected UserPreferences AddPlayer(String player) + protected UserPreferences addPlayer(String player) { return new UserPreferences(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/progression/KitProgressionManager.java b/Plugins/Mineplex.Core/src/mineplex/core/progression/KitProgressionManager.java index 35511ac6a..4c3a962ea 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/progression/KitProgressionManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/progression/KitProgressionManager.java @@ -33,7 +33,7 @@ public class KitProgressionManager extends MiniClientPlugin @Override - protected PlayerKit AddPlayer(String player) + protected PlayerKit addPlayer(String player) { return null; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java index 7ff0962ab..a73557680 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java @@ -929,7 +929,7 @@ public class RewardManager public PetReward addPetReward(Type type, EntityType entityType, RewardRarity rarity, int weight, int shards) { - Pet pet = _petManager.GetFactory().getPet(entityType); + Pet pet = _petManager.getFactory().getPet(entityType); PetReward reward = new PetReward(_petManager, _inventoryManager, _donationManager, pet.getName() + " Pet", pet.getName(), entityType, rarity, weight, shards); addReward(type, reward); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/PetReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/PetReward.java index d3dba4662..9589502eb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/PetReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/PetReward.java @@ -50,8 +50,8 @@ public class PetReward extends UnknownPackageReward PetToken petToken = new PetToken(); petToken.PetType = token.PetType; - _petManager.GetRepository().AddPet(token); - _petManager.Get(player).GetPets().put(_petEntity, token.PetName); + _petManager.getRepository().AddPet(token); + _petManager.Get(player).getPets().put(_petEntity, token.PetName); _inventoryManager.addItemToInventory(player, _petEntity.toString(), 1); @@ -67,6 +67,6 @@ public class PetReward extends UnknownPackageReward return false; } - return !_petManager.Get(player).GetPets().containsKey(_petEntity); + return !_petManager.Get(player).getPets().containsKey(_petEntity); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsManager.java b/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsManager.java index 8c2bc5e06..52d19ec1e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsManager.java @@ -307,7 +307,7 @@ public class StatsManager extends MiniDbClientPlugin } @Override - protected PlayerStats AddPlayer(String player) + protected PlayerStats addPlayer(String player) { return new PlayerStats(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/task/TaskManager.java b/Plugins/Mineplex.Core/src/mineplex/core/task/TaskManager.java index 0427cb53e..ef09c15cb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/task/TaskManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/task/TaskManager.java @@ -49,7 +49,7 @@ public class TaskManager extends MiniDbClientPlugin } @Override - protected TaskClient AddPlayer(String playerName) + protected TaskClient addPlayer(String playerName) { return new TaskClient(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/tournament/TournamentManager.java b/Plugins/Mineplex.Core/src/mineplex/core/tournament/TournamentManager.java index d5bdf1a0b..4166c6a36 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/tournament/TournamentManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/tournament/TournamentManager.java @@ -80,7 +80,7 @@ public class TournamentManager extends MiniDbClientPlugin } @Override - protected ClientTournamentData AddPlayer(String player) + protected ClientTournamentData addPlayer(String player) { return new ClientTournamentData(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/youtube/YoutubeManager.java b/Plugins/Mineplex.Core/src/mineplex/core/youtube/YoutubeManager.java index 45963b9b8..01dc0f954 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/youtube/YoutubeManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/youtube/YoutubeManager.java @@ -68,7 +68,7 @@ public class YoutubeManager extends MiniDbClientPlugin } @Override - protected YoutubeClient AddPlayer(String player) + protected YoutubeClient addPlayer(String player) { return new YoutubeClient(null); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java index 314623f33..327bc3be5 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -984,7 +984,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati } @Override - protected ClientClan AddPlayer(String player) + protected ClientClan addPlayer(String player) { return new ClientClan(); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/murder/MurderManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/murder/MurderManager.java index 8f10f9f0b..49143cff6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/murder/MurderManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/murder/MurderManager.java @@ -204,7 +204,7 @@ public class MurderManager extends MiniClientPlugin } @Override - protected ClientMurder AddPlayer(String player) + protected ClientMurder addPlayer(String player) { return new ClientMurder(); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/playtime/Playtime.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/playtime/Playtime.java index 52c3dfeba..c64fd698a 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/playtime/Playtime.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/playtime/Playtime.java @@ -45,7 +45,7 @@ public class Playtime extends MiniClientPlugin @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { - Set(event.getPlayer(), AddPlayer(event.getPlayer().getName())); + Set(event.getPlayer(), addPlayer(event.getPlayer().getName())); } @EventHandler @@ -73,7 +73,7 @@ public class Playtime extends MiniClientPlugin } @Override - protected PlayingClient AddPlayer(String player) + protected PlayingClient addPlayer(String player) { return new PlayingClient(Bukkit.getPlayer(player), TaskManager.Instance); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index f53d023f4..c5c46b005 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -786,7 +786,7 @@ public class HubManager extends MiniClientPlugin } @Override - protected HubClient AddPlayer(String player) + protected HubClient addPlayer(String player) { return new HubClient(player); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/mail/MailManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/mail/MailManager.java index a5fd6ebb4..a31b07381 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/mail/MailManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/mail/MailManager.java @@ -27,7 +27,7 @@ public class MailManager extends MiniClientPlugin implements Not } @Override - protected PlayerMailData AddPlayer(String player) + protected PlayerMailData addPlayer(String player) { return new PlayerMailData(); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java index 6c0ad0d5b..0787e225b 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java @@ -197,7 +197,7 @@ public class KothManager extends MiniPlugin Manager.GetGadget().disableAll(player, outfit); Manager.GetMount().DisableAll(player); - Manager.getPetManager().DisableAll(player); + Manager.getPetManager().disableAll(player); } else { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java index 04fb771b8..078303737 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java @@ -472,7 +472,7 @@ public class SoccerManager extends MiniPlugin Manager.GetGadget().disableAll(player, outfit); Manager.GetMount().DisableAll(player); - Manager.getPetManager().DisableAll(player); + Manager.getPetManager().disableAll(player); } else { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index da26f23fd..a92a99b2e 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -948,7 +948,7 @@ public class ServerManager extends MiniDbClientPlugin implement } @Override - protected SimpleClanToken AddPlayer(String player) + protected SimpleClanToken addPlayer(String player) { return new SimpleClanToken(); } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClassManager.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClassManager.java index da87fc2da..4bc36c039 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClassManager.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClassManager.java @@ -322,7 +322,7 @@ public class ClassManager extends MiniClientPlugin implements IClas } @Override - protected ClientClass AddPlayer(String player) + protected ClientClass addPlayer(String player) { return new ClientClass(this, _skillFactory, _itemFactory, _clientManager.Get(player), _donationManager.Get(player), null); }